Skip to content

addpkg(main/turbopack): 16.2.0~canary.84#28772

Merged
robertkirkman merged 1 commit intotermux:masterfrom
xingguangcuican6666:turbopack
Mar 9, 2026
Merged

addpkg(main/turbopack): 16.2.0~canary.84#28772
robertkirkman merged 1 commit intotermux:masterfrom
xingguangcuican6666:turbopack

Conversation

@xingguangcuican6666
Copy link
Copy Markdown
Contributor

@xingguangcuican6666 xingguangcuican6666 commented Mar 5, 2026

A high-performance build tool for the modern web. Turbopack uses an incremental engine to provide near-instantaneous HMR and build speeds, leveraging the power of Rust and SWC.

@xingguangcuican6666 xingguangcuican6666 changed the title addpkg(main/turbopack): 6.1.16 addpkg(main/turbopack): 16.1.6 Mar 5, 2026
@xingguangcuican6666 xingguangcuican6666 force-pushed the turbopack branch 2 times, most recently from 0652e15 to e2c13fd Compare March 5, 2026 01:39
@xingguangcuican6666
Copy link
Copy Markdown
Contributor Author

It's seem like wasmer upstream bug of 32 bits system.

error[E0425]: cannot find value `UNWIND_DATA_REG` in this scope
   --> /home/builder/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wasmer-vm-6.1.0-rc.3/src/libcalls/eh/gcc.rs:129:48
    |
129 |                     uw::_Unwind_SetGR(context, UNWIND_DATA_REG.0, uw_exc as _);
    |                                                ^^^^^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find value `UNWIND_DATA_REG` in this scope
   --> /home/builder/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wasmer-vm-6.1.0-rc.3/src/libcalls/eh/gcc.rs:130:48
    |
130 |                     uw::_Unwind_SetGR(context, UNWIND_DATA_REG.1, 0);
    |                                                ^^^^^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find value `UNWIND_DATA_REG` in this scope
   --> /home/builder/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wasmer-vm-6.1.0-rc.3/src/libcalls/eh/gcc.rs:135:48
    |
135 |                     uw::_Unwind_SetGR(context, UNWIND_DATA_REG.0, uw_exc as _);
    |                                                ^^^^^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find value `UNWIND_DATA_REG` in this scope
   --> /home/builder/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wasmer-vm-6.1.0-rc.3/src/libcalls/eh/gcc.rs:137:48
    |
137 |                     uw::_Unwind_SetGR(context, UNWIND_DATA_REG.1, tag as _);
    |                                                ^^^^^^^^^^^^^^^ not found in this scope

For more information about this error, try `rustc --explain E0425`.
error: could not compile `wasmer-vm` (lib) due to 4 previous errors
warning: build failed, waiting for other jobs to finish...
Internal Error: Command failed: cargo build --release --target i686-linux-android --features plugin,image-extended,tracing/release_max_level_trace -p next-swc-napi
    at genericNodeError (node:internal/errors:983:15)
    at wrappedFn (node:internal/errors:537:14)
    at checkExecSyncError (node:child_process:916:11)
    at Object.execSync (node:child_process:988:15)
    at BuildCommand.<anonymous> (/home/builder/.termux-build/turbopack/src/node_modules/.pnpm/@napi-rs+cli@2.18.4/node_modules/@napi-rs/cli/scripts/index.js:11529:30)
    at Generator.next (<anonymous>)
    at /home/builder/.termux-build/turbopack/src/node_modules/.pnpm/@napi-rs+cli@2.18.4/node_modules/@napi-rs/cli/scripts/index.js:3526:69
    at new Promise (<anonymous>)
    at __awaiter$1 (/home/builder/.termux-build/turbopack/src/node_modules/.pnpm/@napi-rs+cli@2.18.4/node_modules/@napi-rs/cli/scripts/index.js:3522:10)
    at BuildCommand.execute (/home/builder/.termux-build/turbopack/src/node_modules/.pnpm/@napi-rs+cli@2.18.4/node_modules/@napi-rs/cli/scripts/index.js:11299:16)
 ELIFECYCLE  Command failed with exit code 1.

@robertkirkman
Copy link
Copy Markdown
Member

It's seem like wasmer upstream bug of 32 bits system.

error[E0425]: cannot find value `UNWIND_DATA_REG` in this scope
   --> /home/builder/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wasmer-vm-6.1.0-rc.3/src/libcalls/eh/gcc.rs:129:48
    |
129 |                     uw::_Unwind_SetGR(context, UNWIND_DATA_REG.0, uw_exc as _);
    |                                                ^^^^^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find value `UNWIND_DATA_REG` in this scope
   --> /home/builder/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wasmer-vm-6.1.0-rc.3/src/libcalls/eh/gcc.rs:130:48
    |
130 |                     uw::_Unwind_SetGR(context, UNWIND_DATA_REG.1, 0);
    |                                                ^^^^^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find value `UNWIND_DATA_REG` in this scope
   --> /home/builder/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wasmer-vm-6.1.0-rc.3/src/libcalls/eh/gcc.rs:135:48
    |
135 |                     uw::_Unwind_SetGR(context, UNWIND_DATA_REG.0, uw_exc as _);
    |                                                ^^^^^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find value `UNWIND_DATA_REG` in this scope
   --> /home/builder/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wasmer-vm-6.1.0-rc.3/src/libcalls/eh/gcc.rs:137:48
    |
137 |                     uw::_Unwind_SetGR(context, UNWIND_DATA_REG.1, tag as _);
    |                                                ^^^^^^^^^^^^^^^ not found in this scope

For more information about this error, try `rustc --explain E0425`.
error: could not compile `wasmer-vm` (lib) due to 4 previous errors
warning: build failed, waiting for other jobs to finish...
Internal Error: Command failed: cargo build --release --target i686-linux-android --features plugin,image-extended,tracing/release_max_level_trace -p next-swc-napi
    at genericNodeError (node:internal/errors:983:15)
    at wrappedFn (node:internal/errors:537:14)
    at checkExecSyncError (node:child_process:916:11)
    at Object.execSync (node:child_process:988:15)
    at BuildCommand.<anonymous> (/home/builder/.termux-build/turbopack/src/node_modules/.pnpm/@napi-rs+cli@2.18.4/node_modules/@napi-rs/cli/scripts/index.js:11529:30)
    at Generator.next (<anonymous>)
    at /home/builder/.termux-build/turbopack/src/node_modules/.pnpm/@napi-rs+cli@2.18.4/node_modules/@napi-rs/cli/scripts/index.js:3526:69
    at new Promise (<anonymous>)
    at __awaiter$1 (/home/builder/.termux-build/turbopack/src/node_modules/.pnpm/@napi-rs+cli@2.18.4/node_modules/@napi-rs/cli/scripts/index.js:3522:10)
    at BuildCommand.execute (/home/builder/.termux-build/turbopack/src/node_modules/.pnpm/@napi-rs+cli@2.18.4/node_modules/@napi-rs/cli/scripts/index.js:11299:16)
 ELIFECYCLE  Command failed with exit code 1.

yes, wasmer does not support 32-bit and the termux wasmer package also does not

TERMUX_PKG_EXCLUDED_ARCHES="arm, i686"

so you will need to add TERMUX_PKG_EXCLUDED_ARCHES="arm, i686"

Comment thread packages/turbopack/build.sh Outdated
@xingguangcuican6666
Copy link
Copy Markdown
Contributor Author

The test did not pass; it used mimalloc, resulting in a SIGSEGV (Address boundary error)

@xingguangcuican6666 xingguangcuican6666 force-pushed the turbopack branch 7 times, most recently from f4d35a6 to 8ae409a Compare March 5, 2026 06:03
@xingguangcuican6666
Copy link
Copy Markdown
Contributor Author

xingguangcuican6666 commented Mar 5, 2026

I check this issue #27937 .
I think I need make the patch with @Kuldeep-Dilliwar 's repo.
This build can package in a new npm packages and hand out by pkg.

@Kuldeep-Dilliwar
Copy link
Copy Markdown
Contributor

In my repo the patch didn't work for 32bit architecture, and only work for aarch64 and x86_64. I looked into adding 32-bit support, but it turns out I would need to patch several underlying Next.js dependencies to make it work, so I left it out, as there was no segmentation fault in arm 32bit patched compile binary but a dl open error. You can look my patch in my forked repo of nextjs in personal build branch, it only include patch for 64bit and not for 32bit once. vercel/next.js@canary...Kuldeep-Dilliwar:next.js:personal-build

@xingguangcuican6666
Copy link
Copy Markdown
Contributor Author

In my repo the patch didn't work for 32bit architecture, and only work for aarch64 and x86_64. I looked into adding 32-bit support, but it turns out I would need to patch several underlying Next.js dependencies to make it work, so I left it out, as there was no segmentation fault in arm 32bit patched compile binary but a dl open error. You can look my patch in my forked repo of nextjs in personal build branch, it only include patch for 64bit and not for 32bit once. vercel/next.js@canary...Kuldeep-Dilliwar:next.js:personal-build

Yes, I know, I have also encountered some issues with 32-bit, and I am currently not compiling it. It relies on Wasmer, but Wasmer does not support 32-bit.

@xingguangcuican6666 xingguangcuican6666 force-pushed the turbopack branch 4 times, most recently from 1b149a2 to 2dfcca4 Compare March 7, 2026 08:37
@xingguangcuican6666 xingguangcuican6666 changed the title addpkg(main/turbopack): 16.1.6 addpkg(main/turbopack): canary Mar 7, 2026
@xingguangcuican6666 xingguangcuican6666 force-pushed the turbopack branch 2 times, most recently from d2eb98d to 491adf1 Compare March 7, 2026 08:58
@Kuldeep-Dilliwar
Copy link
Copy Markdown
Contributor

Add ca-certificates dependency. This is required because the binary patch uses a hard-coded path for Termux-installed certificates instead of utilizing the Android system's native CA store.

@Kuldeep-Dilliwar
Copy link
Copy Markdown
Contributor

I mean in order to run the binary they have to first install certificates via "pkg install ca-certificates".

@xingguangcuican6666
Copy link
Copy Markdown
Contributor Author

xingguangcuican6666 commented Mar 7, 2026

OK, I just test for patch generator.
Obviously, it mistakenly wrote the changes to the workflow into the patch.

@xingguangcuican6666 xingguangcuican6666 force-pushed the turbopack branch 2 times, most recently from 5ac0aa1 to b13f08b Compare March 7, 2026 09:33
Comment thread packages/turbopack/build.sh Outdated
@xingguangcuican6666
Copy link
Copy Markdown
Contributor Author

xingguangcuican6666 commented Mar 7, 2026

Ah, oops, It's seem like it download https://github.com/vercel/next.js/archive/refs/tags/v16.2.0~canary.84.tar.gz, not https://github.com/vercel/next.js/archive/refs/tags/v16.2.0-canary.84.tar.gz

Downloading https://github.com/vercel/next.js/archive/refs/tags/v16.2.0~canary.84.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0    14    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (22) The requested URL returned error: 404
Retrying #1 download https://github.com/vercel/next.js/archive/refs/tags/v16.2.0~canary.84.tar.gz in 60

@robertkirkman
Copy link
Copy Markdown
Member

Ah, oops

Downloading https://github.com/vercel/next.js/archive/refs/tags/v16.2.0~canary.84.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0    14    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (22) The requested URL returned error: 404
Retrying #1 download https://github.com/vercel/next.js/archive/refs/tags/v16.2.0~canary.84.tar.gz in 60

Yes I think it needs this syntax #28772 (comment)

Comment thread packages/turbopack/build.sh Outdated
Comment thread packages/turbopack/build.sh Outdated
@xingguangcuican6666
Copy link
Copy Markdown
Contributor Author

All passed!

Comment thread packages/turbopack/build.sh
Comment thread packages/turbopack/build.sh Outdated
@xingguangcuican6666
Copy link
Copy Markdown
Contributor Author

Based on my testing on Termux, I found that the Next.js JavaScript layer and the Turbopack native bindings are tightly coupled. A version mismatch (e.g., using Next 16.1.5 with a later Turbopack canary) triggers errors like Missing field isPersistentCachingEnabled.

@xingguangcuican6666
Copy link
Copy Markdown
Contributor Author

In other words, it is not backward compatible.

@xingguangcuican6666
Copy link
Copy Markdown
Contributor Author

xingguangcuican6666 commented Mar 7, 2026

Like this.

Installing the version in your repository (^2.8.14) before calling `turbo` will result in more predictable behavior across environments.
• turbo 2.8.13
• Packages in scope: @repo/eslint-config, @repo/typescript-config, @repo/ui, docs, web
• Running build in 5 packages
• Remote caching disabled
┌─ docs#build > cache miss, executing e6c5743e03f92a86 


> docs@0.1.0 build /data/data/com.termux/files/home/test/my-compat-test-1/apps/docs
> next build

  Using cached swc package @next/swc-wasm-nodejs...
▲ Next.js 16.1.5 (Turbopack)

  Creating an optimized production build ...
 ELIFECYCLE  Command failed with exit code 130.
└─ docs#build ──
┌─ web#build > cache miss, executing fd1bdf05e7a2d26c 


> web@0.1.0 build /data/data/com.termux/files/home/test/my-compat-test-1/apps/web
> next build

▲ Next.js 16.1.5 (Turbopack)

  Creating an optimized production build ...

> Build error occurred
Error: Missing field `isPersistentCachingEnabled`
    at ignore-listed frames
 ELIFECYCLE  Command failed with exit code 1.
command finished with error: command (/data/data/com.termux/files/home/test/my-compat-test-1/apps/web) /data/data/com.termux/files/usr/bin/pnpm run build exited (1)
└─ web#build ──
web#build: command (/data/data/com.termux/files/home/test/my-compat-test-1/apps/web) /data/data/com.termux/files/usr/bin/pnpm run build exited (1)

 Tasks:    0 successful, 2 total
Cached:    0 cached, 2 total
  Time:    6.037s 
Failed:    web#build

 ERROR  run failed: command  exited (1)

When the versions match:

Installing the version in your repository (^2.8.14) before calling `turbo` will result in more predictable behavior across environments.
• turbo 2.8.13
• Packages in scope: @repo/eslint-config, @repo/typescript-config, @repo/ui, docs, web
• Running build in 5 packages
• Remote caching disabled
┌─ web#build > cache hit, replaying logs 5bc8567322c1337d 


> web@0.1.0 build /data/data/com.termux/files/home/test/my-compat-test/apps/web
> next build

▲ Next.js 16.2.0-canary.84 (Turbopack)

  Creating an optimized production build ...
✓ Compiled successfully in 7.0s
✓ Finished TypeScript in 4.7s    
✓ Collecting page data using 1 worker in 1060ms    
✓ Generating static pages using 1 worker (4/4) in 403ms
✓ Finalizing page optimization in 13ms    

Route (app)
┌ ○ /
└ ○ /_not-found


○  (Static)  prerendered as static content
└─ web#build ──
┌─ docs#build > cache hit, replaying logs 048284b769505f34 


> docs@0.1.0 build /data/data/com.termux/files/home/test/my-compat-test/apps/docs
> next build

▲ Next.js 16.2.0-canary.84 (Turbopack)

  Creating an optimized production build ...
✓ Compiled successfully in 7.5s
✓ Finished TypeScript in 4.5s    
✓ Collecting page data using 1 worker in 1087ms    
✓ Generating static pages using 1 worker (4/4) in 381ms
✓ Finalizing page optimization in 12ms    

Route (app)
┌ ○ /
└ ○ /_not-found


○  (Static)  prerendered as static content
└─ docs#build ──

 Tasks:    2 successful, 2 total
Cached:    2 cached, 2 total
  Time:    164ms >>> FULL TURBO

u0_a315@localhost ~/t/my-compat-test (main)> 

My testing indicates that the version offset must not exceed one minor version to maintain stability.

@Kuldeep-Dilliwar
Copy link
Copy Markdown
Contributor

Users have to explicitly use the npx create-next-app@v16.2.0-canary.84 command to create the next app, it's the the reason in my script repo i always had to update the installation command with specified canary version for next js installation.

@TomJo2000
Copy link
Copy Markdown
Member

Users have to explicitly use the npx create-next-app@v16.2.0-canary.84 command to create the next app

Yeah that's not ideal...
But presumably would only be an issue for this initial version since we won't be updating to canaries afterwards.

@xingguangcuican6666
Copy link
Copy Markdown
Contributor Author

Yes, maybe it's just an issue with the canary version. Let's keep things as they are for now. If there are problems in the stable version in the future, I will open a new PR to resolve them.

@robertkirkman
Copy link
Copy Markdown
Member

robertkirkman commented Mar 8, 2026

Users have to explicitly use the npx create-next-app@v16.2.0-canary.84 command to create the next app, it's the the reason in my script repo i always had to update the installation command with specified canary version for next js installation.

Could we add a postinst script that prints a message "you must explicitly use 'npx create-next-app@v${TERMUX_PKG_VERSION//\~/-}'"? This way the way to use the package and avoid Error: Missing field 'isPersistentCachingEnabled' is clear. I also saw that error

Co-authored-by: Kuldeep-Dilliwar <kuldeepdilliwar@gmail.com>
@xingguangcuican6666
Copy link
Copy Markdown
Contributor Author

Users have to explicitly use the npx create-next-app@v16.2.0-canary.84 command to create the next app, it's the the reason in my script repo i always had to update the installation command with specified canary version for next js installation.

Could we add a postinst script that prints a message "you must explicitly use 'npx create-next-app@v${TERMUX_PKG_VERSION//\~/-}'"? This way the way to use the package and avoid Error: Missing field 'isPersistentCachingEnabled' is clear. I also saw that error

How about this

termux_step_create_debscripts() {
	cat > ./postinst <<-EOF
	#!$TERMUX_PREFIX/bin/sh
	echo "You must explicitly use 'npx create-next-app@v${TERMUX_PKG_VERSION//\~/-}' to avoid the error of Missing field 'isPersistentCachingEnabled'"
	EOF
}

@robertkirkman
Copy link
Copy Markdown
Member

Yes

@xingguangcuican6666
Copy link
Copy Markdown
Contributor Author

Okay, It's build sucessful

@robertkirkman
Copy link
Copy Markdown
Member

Ok it looks good now I will merge it in 24 hours

@robertkirkman robertkirkman merged commit 1d9c3b4 into termux:master Mar 9, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Error: turbo.createProject is not supported by the wasm bindings.

4 participants