-
-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failed to make bytecode for arm64 on Linux x86 #95
Comments
@robvanderleek Could you tell me if it's woking with past versions of pkg or other nodejs versions like 18/16? I just want to understand where the issue could be It should come from: Line 91 in db7f2c5
Could you debug it? |
See below how it fails for ARM64 with nodejs 20/18/16 versions, but works for x86 with nodejs 20/18/16. I've tried I think it's host platform related, since building for arm64 fails on Linux Ubuntu 24, but succeeds on macOS. rob:~/projects/yao-pkg-linuxstatic-arm64-bug$ npx pkg -o index -t node20-linuxstatic-arm64 index.js
> [email protected]
(node:19081) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
> Fetching base Node.js binaries to PKG_CACHE_PATH
fetched-v20.17.0-linuxstatic-arm64 [====================] 100%
> Warning Failed to make bytecode node20-arm64 for file /snapshot/yao-pkg-linuxstatic-arm64-bug/index.js rob:~/projects/yao-pkg-linuxstatic-arm64-bug$ npx pkg -o index -t node18-linuxstatic-arm64 index.js
> [email protected]
(node:19116) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
> Fetching base Node.js binaries to PKG_CACHE_PATH
fetched-v18.20.4-linuxstatic-arm64 [====================] 100%
> Warning Failed to make bytecode node18-arm64 for file /snapshot/yao-pkg-linuxstatic-arm64-bug/index.js rob:~/projects/yao-pkg-linuxstatic-arm64-bug$ npx pkg -o index -t node16-linuxstatic-arm64 index.js
> [email protected]
(node:19151) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
> Fetching base Node.js binaries to PKG_CACHE_PATH
fetched-v16.20.2-linuxstatic-arm64 [====================] 100%
> Warning Failed to make bytecode node16-arm64 for file /snapshot/yao-pkg-linuxstatic-arm64-bug/index.js error (write EPIPE) rob:~/projects/yao-pkg-linuxstatic-arm64-bug$ npx pkg -o index -t node20-linuxstatic-x64 index.js
> [email protected]
(node:19186) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
> Fetching base Node.js binaries to PKG_CACHE_PATH
fetched-v20.17.0-linuxstatic-x64 [====================] 100%
fetched-v20.17.0-linux-x64 [====================] 100% rob:~/projects/yao-pkg-linuxstatic-arm64-bug$ npx pkg -o index -t node18-linuxstatic-x64 index.js
> [email protected]
(node:19224) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
> Fetching base Node.js binaries to PKG_CACHE_PATH
fetched-v18.20.4-linuxstatic-x64 [====================] 100%
fetched-v18.20.4-linux-x64 [====================] 100%
rob:~/projects/yao-pkg-linuxstatic-arm64-bug$ npx pkg -o index -t node16-linuxstatic-x64 index.js
> [email protected]
(node:19261) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
> Fetching base Node.js binaries to PKG_CACHE_PATH
fetched-v16.20.2-linuxstatic-x64 [====================] 100%
fetched-v16.20.2-linux-x64 [====================] 100% |
@robvanderleek I actually have no time to look at this issue but I suggest to try debug it to see if you are able to find the root cause of the issue, aboce I linked you the code that makes the bytecode, try to put some breakpoints there to see what's the line that triggers that issue |
That comes from fabricator |
I've same issue in https://github.com/emacs-eask/cli/actions/runs/12576251914/job/35052168042?pr=292#step:5:24.
|
|
@jcs090218 is this happening only with node20? Could you try to use 18-16? |
Here is the latest result; see https://github.com/emacs-eask/cli/actions/runs/12580756239/job/35063275367#step:5:18. I've tried |
@jcs090218 could it be those modules are esm? |
No, it's only CJS. Here is the I can build for x86, but not for ARM. The results are the same across all operating systems: Linux, macOS, and Windows. If you take a closer look to the link I have pasted in the previous comment: https://github.com/emacs-eask/cli/actions/runs/12580756239. All arm builds are failing. |
@faulpeltz any clue? |
Do we have a small sample where this can be reproduced? does this also happen when building from on linux x64 -> linux static x64 ? |
Also, make sure for that the |
Got it. That was the problem. I got all warnings solved but the executable no longer works... You can download the executable at https://github.com/emacs-eask/cli/actions/runs/12660523277 and try it out. Only Linux is working. |
which node version are you using for the pkg binaries? |
The
|
It includes the script source for the project in the result binary instead of just the code cache bytecode. This is a little bit slower because of additional steps on startup for parsing/compiling, and is basically the same as running Getting code-cache-only to work is currently an open issue in Node 22, but should work with earlier versions. |
What version of pkg are you using?
5.15.0
What version of Node.js are you using?
21.2.0
What operating system are you using?
Ubuntu
What CPU architecture are you using?
x86_64
What Node versions, OSs and CPU architectures are you building for?
node20-linuxstatic-arm64
Describe the Bug
Building a static binary for Linux ARM64 failes on Linux x86. For example, this command:
Generates the following error:
Adding the
--debug
flag to the build shows:I am able to generate an ARM64 static Linux binary on macOS.
Expected Behavior
A static Linux ARM64 is generated without warnings.
To Reproduce
I created a minimal example repository that demonstrates the problem:
Not that:
does not generate the warning.
The text was updated successfully, but these errors were encountered: