enable,bump(main/deno): 2.1.2
WIP
- [x] Bump
deno- [ ] ~~Fix i686 and arm for "index out of bounds" error on
src_binding.rs~~ See https://github.com/denoland/deno/issues/2295#issuecomment-2329248010 - [ ] Successfully built
deno
- [ ] ~~Fix i686 and arm for "index out of bounds" error on
- [x] ~~Bump
librusty-v8~~ Moved to #22404- [x] ~~Successfully build
librusty-v8~~
- [x] ~~Successfully build
Ninja tries to link libclang_rt which is not possible to link, and there's no way to disable it nor replace it with libgcc.
Waiting for denoland/rusty_v8#1662.
The linkage should comes from chromium or v8, not really related to rusty_v8. I'll have a look this night or tomorrow.
The linkage should comes from
chromiumorv8, not really related torusty_v8. I'll have a look this night or tomorrow.
I can take a look at it later. Seems it comes from V8's BUILD.gn.
TODO: Patch src/binding.cc regarding static assertation error (probably bad architecture assumption)
PKG_CONFIG_PATH maybe required to make Cargo recognize Termux's libraries.
Better to split librusty-v8 into a seperate PR and merge it before building deno. It takes too much time to build librusty-v8.
Better to split librusty-v8 into a seperate PR and merge it before building deno. It takes too much time to build librusty-v8.
I'll do that in the next commit
- i686 and arm build failed because of "index out of bounds" error inside
src_binding.rs.
All builds failed because of librusty-v8, seems like it needs a further more patches to get it working.
aarch64 build might failed because of snapshot being compiled for x86_64.
Cargo built x86_64 deno on aarch64 build, thus ld: error: /data/data/com.termux/files/usr/lib/libsqlite3.so is incompatible with elf64-x86-64 error shows up
Need to patch this one
Thanks for this, I have successfully build and install it π₯°β₯οΈ
I'd like to merge this PR and then bump deno to the latest stable version. After this PR is merged, I'll transfer github.com/licy183/deno-snapshot to termux.
CC: @thunder-coding As the maintainer of nodejs
@licy183 can you try to fix this issue https://github.com/denoland/deno/issues/19759#issuecomment-2914426954
It happens in your buid
@licy183 can you try to fix this issue denoland/deno#19759 (comment)
It happens in your buid
Addressed in 11bf2b553e324e8f5988bcd32118120e129dff45
@licy183 can you try to fix this issue denoland/deno#19759 (comment) It happens in your buid
Addressed in 11bf2b5
Deno Android Compatibility Test Results β
I've verified the new build works perfectly on Android (Termux) using a comprehensive test. Here are the results:
Test File Used
async function main() {
console.log("=== Starting Deno Android Compatibility Test ===");
// 1. Core functionality
console.log("\nβ
Core Test");
console.log("Deno version:", Deno.version.deno);
console.log("Fetch test:", await fetch("https://example.com").then(r => r.status));
// 2. Process spawning (historically problematic on Android)
console.log("\nπ Process Spawn Test");
try {
const cmd = new Deno.Command("echo", {
args: ["Process spawn successful!"],
stdout: "piped"
});
const { stdout } = await cmd.output();
console.log(new TextDecoder().decode(stdout).trim());
} catch (e) {
console.log("β Process spawn failed:", e.message);
}
// 3. Filesystem operations
console.log("\nπ Filesystem Test");
try {
const testFile = "deno_test_file.txt";
await Deno.writeTextFile(testFile, "Filesystem works!");
console.log("File content:", await Deno.readTextFile(testFile));
await Deno.remove(testFile);
} catch (e) {
console.log("β Filesystem failed:", e.message);
}
// 4. Native bindings check
console.log("\nπ Native Binding Test");
try {
const tempDir = await Deno.makeTempDir();
console.log("Temp dir created:", tempDir);
await Deno.remove(tempDir, { recursive: true });
} catch (e) {
console.log("β Native bindings failed:", e.message);
}
console.log("\n=== Test Complete ===");
}
main();
Successful Output
=== Starting Deno Android Compatibility Test ===
β
Core Test
Deno version: 2.1.2
Fetch test: 200
π Process Spawn Test
Process spawn successful!
π Filesystem Test
File content: Filesystem works!
π Native Binding Test
Temp dir created: /data/data/com.termux/files/usr/tmp/c276bb488d231afc
=== Test Complete ===
Screenshot Proof:
Key Features Confirmed Working:
- β
Process spawning (
Deno.Command) - β Filesystem operations
- β Network access
- β Native bindings
- β Permission system
This resolves the previous Android compatibility issues we observed.
Great work !! Maybe these patches can be send to deno upstream ?
Great work !! Maybe these patches can be send to deno upstream ?
That's unnecesarry to do, and it would be hard to maintain it's stability for platform that the maintainers doesn't even use.
@0komo
$ lldb deno
(lldb) target create "deno"
Current executable set to '/data/data/com.termux/files/usr/bin/deno' (aarch64).
(lldb) run --allow-all --unstable-worker-options main.ts
Process 21068 launched: '/data/data/com.termux/files/usr/bin/deno' (aarch64)
Listening on http://0.0.0.0:3300/
Process 21068 stopped
* thread #13, name = 'tokio-runtime-w', stop reason = signal SIGTRAP
frame #0: 0x00000055594d51a8 deno`___lldb_unnamed_symbol69746 + 1432
deno`___lldb_unnamed_symbol69746:
-> 0x55594d51a8 <+1432>: brk #0x1
0x55594d51ac <+1436>: add x0, x19, #0x10
0x55594d51b0 <+1440>: b 0x55594d51a0 ; <+1424>
0x55594d51b4 <+1444>: mov x20, x0
(lldb) bt
* thread #13, name = 'tokio-runtime-w', stop reason = signal SIGTRAP
* frame #0: 0x00000055594d51a8 deno`___lldb_unnamed_symbol69746 + 1432
frame #1: 0x00000055594d4e24 deno`___lldb_unnamed_symbol69746 + 532
frame #2: 0x00000055594d3b84 deno`___lldb_unnamed_symbol69721 + 276
frame #3: 0x00000055594d3a5c deno`___lldb_unnamed_symbol69720 + 32
frame #4: 0x00000055594d8ed8 deno`___lldb_unnamed_symbol69904 + 76
frame #5: 0x00000055594a69a0 deno`___lldb_unnamed_symbol68510 + 428
frame #6: 0x00000055594add4c deno`___lldb_unnamed_symbol68572 + 232
frame #7: 0x000000555803f9f0 deno`___lldb_unnamed_symbol4756 + 2188
frame #8: 0x000000555808a2c8 deno`___lldb_unnamed_symbol5385 + 5352
frame #9: 0x0000005558088940 deno`___lldb_unnamed_symbol5382 + 344
frame #10: 0x0000005558dee87c deno`___lldb_unnamed_symbol42248 + 332
frame #11: 0x0000005558df7f04 deno`___lldb_unnamed_symbol42384 + 164
frame #12: 0x00000055594e5f7c deno`___lldb_unnamed_symbol70195 + 440
frame #13: 0x00000055594e5c8c deno`___lldb_unnamed_symbol70194 + 144
frame #14: 0x000000555941ba74 deno`___lldb_unnamed_symbol65550 + 36
frame #15: 0x0000007fec1342a8 libc.so`__pthread_start(void*) + 200
frame #16: 0x0000007fec125624 libc.so`__start_thread + 68
(lldb)
```
Please provide the files of your project.
I think the problem is from the package, please investigate
const workerCode = `
import { InlineKeyboard } from 'jsr:@gramio/core';
`;
const blob = new Blob([workerCode], { type: "application/javascript" });
const worker = new Worker(URL.createObjectURL(blob), { type: "module" });
console.log("Main script: worker started");
Not a bug of Termux's deno. It is also reproducible on deno-v2.1.2-x86_64-unknown-linux-gnu. It may be fixed in the latest version of deno, but I want to bump deno to the latest version after this PR is merged.
@licy183 Thanks for the info! Is there a way I can get the latest Deno version now? Version 2.1.2 has many bugs that have been fixed in the latest release.
@Jobians You can fork this PR branch, change the TERMUX_PKG_VERSION to latest, and run the build CI. But expect things to not work out properly.
Deno is now bumped to the latest LTS version.
Hi! Thanks for the update π
Unfortunately, this version still has the same issue:
error: Uncaught (in promise) AssertionError: unreachable
throw new AssertionError("unreachable");
^
at unreachable (https://deno.land/[email protected]/testing/asserts.ts:865:9)
at https://deno.land/[email protected]/node/internal_binding/uv.ts:320:7
Would it be possible for you to share the relevant patches or changes so I can try building Deno v2.3.6 with them locally?
Thanks again for your work!
Would it be possible for you to share the relevant patches or changes so I can try building Deno v2.3.6 with them locally?
The relevant patches are on this branch. You can either check them out via the GitHub CLI:
gh pr checkout 22379
Or grab the .patch file of this PR and apply it to your fork of termux/termux-packages on a branch of your choice.
git clone https://github.com/termux/termux-packages
# Or clone your own fork if you have one
cd termux-packages
wget https://github.com/termux/termux-packages/pull/22379.patch
git apply 22379.patch
(This does lose some granularity by compressing the commits on this branch into a single patch that is applied on top of your working state.)
Thanks again, Tom!
Iβve actually already tried applying that patch, but unfortunately it doesnβt fully work with Deno v2.3.6.
It seems there are some internal code changes in the Deno VM in this version that break compatibility β so additional adjustments beyond the current patch are likely needed.
Let me know if thereβs an updated patch or workaround. Iβm happy to help test it!
Please provide the steps that trigger this error. I can't reproduce it using the ts file above in https://github.com/termux/termux-packages/pull/22379#issuecomment-2959981767.
Seems like it came from this.
https://github.com/denoland/deno/blob/v2.2.13/ext/node/polyfills/internal_binding/uv.ts#L490-L520
Can anyone verify the output of Deno.build.os?