Failed to build VSCodium source code on a riscv64 machine
Describe the bug When I ran ./build/build.sh in the VSCodium directory, it failed with an error during node --max-old-space-size=8192 ./node_modules/gulp/bin/gulp.js vscode-linux-riscv64-min-ci.
Please confirm that the issue/resolution isn't already documented [X ] I checked the Docs page and the Troubleshooting page and my issue is not mentioned there.
To Reproduce Steps to reproduce the behavior:
- Go to ~/vscodium
- ./build/build.sh
- See error
node --max-old-space-size=8192 ./node_modules/gulp/bin/gulp.js vscode-linux-riscv64-min-ci
[13:49:29] Using gulpfile ~/myCode/vscodium/vscode/gulpfile.js
[13:49:29] Starting 'vscode-linux-riscv64-min-ci'...
[13:49:29] Starting clean-vscode-linux-riscv64 ...
[13:49:29] Finished clean-vscode-linux-riscv64 after 140 ms
[13:49:29] Starting vscode-linux-riscv64-min-ci ...
Downloading electron: [=================================] 100% ETA: 0.0 seconds
[13:49:55] 'vscode-linux-riscv64-min-ci' errored after 26 s
[13:49:55] HTTPError: Response code 404 (Not Found)
at Request._onResponseBase (/home/openkylin/myCode/vscodium/vscode/node_modules/got/dist/source/core/index.js:913:31)
at Request._onResponse (/home/openkylin/myCode/vscodium/vscode/node_modules/got/dist/source/core/index.js:948:24)
at ClientRequest.
(/home/openkylin/myCode/vscodium/vscode/node_modules/got/dist/source/core/index.js:962:23) at Object.onceWrapper (node:events:632:26) at ClientRequest.emit (node:events:529:35) at ClientRequest.emit (node:domain:552:15) at origin.emit (/home/openkylin/myCode/vscodium/vscode/node_modules/@szmarczak/http-timer/dist/source/index.js:43:20) at HTTPParser.parserOnIncomingClient (node:_http_client:700:27) at HTTPParser.parserOnHeadersComplete (node:_http_common:119:17) at TLSSocket.socketOnData (node:_http_client:541:22) error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Expected behavior help for build the code success
Desktop (please complete the following information):
- OS: [openkylin 2.0]
- Architecture [riscv64]
- Version [6.1.22]
- App Manager [apt]
- Sandboxed no
Additional context Add any other context about the problem here.
Network error, can you retry. It can happen time to time.
Since I don't have access to a riscv64 pc, I can't test it :(
I've tried many times, but it always breaks due to this error.QAQ
I've tried many times, but it always breaks due to this error.QAQ
That's pretty much expected if you are building natively on riscv64. It's trying to download official electron for riscv64, which doesn't exist. In general, the node.js ecosystem doesn't support riscv64 well. It's much easier to build VSCodium on x86_64 targeting riscv64. See also https://github.com/riscv-forks/electron-riscv-releases/issues/1
what
I've tried many times, but it always breaks due to this error.QAQ
That's pretty much expected if you are building natively on riscv64. It's trying to download official electron for riscv64, which doesn't exist. In general, the node.js ecosystem doesn't support riscv64 well. It's much easier to build VSCodium on x86_64 targeting riscv64. See also riscv-forks/electron-riscv-releases#1
Thank you very much for your help, now that I've built the riscv cross-compilation environment, how do I cross-compile this project next? Should I use nodejs on x64 or do I compile nodejs and electron on riscv by myself?
When I try to cross-compile on x64, I get an error
rror /home/siwan/mycode/vscodium/vscodium/vscode/node_modules/@parcel/watcher: Command failed. Exit code: 1 Command: node-gyp-build Arguments: Directory: /home/siwan/mycode/vscodium/vscodium/vscode/node_modules/@parcel/watcher Output: gyp info it worked if it ends with ok gyp info using [email protected] gyp info using [email protected] | linux | x64 gyp info find Python using Python version 3.8.10 found at "/usr/bin/python3"
gyp info spawn /usr/bin/python3
gyp info spawn args [
gyp info spawn args '/home/siwan/mycode/node-v20.16.0-linux-x64/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/home/siwan/mycode/vscodium/vscodium/vscode/node_modules/@parcel/watcher/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/home/siwan/mycode/node-v20.16.0-linux-x64/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/home/siwan/.cache/node-gyp/29.4.0/include/node/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/home/siwan/.cache/node-gyp/29.4.0',
gyp info spawn args '-Dnode_gyp_dir=/home/siwan/mycode/node-v20.16.0-linux-x64/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/home/siwan/.cache/node-gyp/29.4.0/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/home/siwan/mycode/vscodium/vscodium/vscode/node_modules/@parcel/watcher',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: 进入目录“/home/siwan/mycode/vscodium/vscodium/vscode/node_modules/@parcel/watcher/build”
CC(target) Release/obj.target/nothing/node_modules/node-addon-api/nothing.o
riscv64-unknown-linux-gnu-gcc: error: unrecognized command-line option '-m64'
make: *** [node_modules/node-addon-api/nothing.target.mk:123:Release/obj.target/nothing/node_modules/node-addon-api/nothing.o] 错误 1
make: 离开目录“/home/siwan/mycode/vscodium/vscodium/vscode/node_modules/@parcel/watcher/build”
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.
CC(target) Release/obj.target/nothing/node_modules/node-addon-api/nothing.o riscv64-unknown-linux-gnu-gcc: error: unrecognized command-line option '-m64'
That's not the correct compiler flag for cross-compilation. -m64 is for x86_64 architecture.
That's not the correct compiler flag for cross-compilation.
-m64is for x86_64 architecture.
Thank you for your help, I successfully compiled it with github action, can I refer to the log in github action, and compile it locally with docker
Oddly enough, even in the log of a successfully compiled github action, the following error occurs
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment, and we'll keep it open. If you have any new additional information, please include it with your comment!
This issue has been closed due to inactivity, and will not be monitored. If this is a bug and you can reproduce this issue, please open a new issue.
Have you any remorse @github-actions?
