VSCodium / vscodium

binary releases of VS Code without MS branding/telemetry/licensing
https://vscodium.com
MIT License
24.83k stars 1.06k forks source link

Failed to build VSCodium source code on a riscv64 machine #1961

Open siwan-tc opened 1 month ago

siwan-tc commented 1 month ago

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:

  1. Go to ~/vscodium
  2. ./build/build.sh
  3. 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):

Additional context Add any other context about the problem here.

daiyam commented 1 month ago

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 :(

siwan-tc commented 1 month ago

I've tried many times, but it always breaks due to this error.QAQ

微信图片_20240723103447

kxxt commented 1 month ago

I've tried many times, but it always breaks due to this error.QAQ

微信图片_20240723103447

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

siwan-tc commented 1 month ago

what

I've tried many times, but it always breaks due to this error.QAQ 微信图片_20240723103447

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?

siwan-tc commented 1 month ago

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 node-gyp@10.1.0 gyp info using node@20.16.0 | 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. (/home/siwan/mycode/node-v20.16.0-linux-x64/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:209:23) gyp ERR! System Linux 5.15.0-113-generic gyp ERR! command "/home/siwan/mycode/node-v20.16.0-linux-x64/bin/node" "/home/siwan/mycode/node-v20.16.0-linux-x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /home/siwan/mycode/vscodium/vscodium/vscode/node_modules/@parcel/watcher gyp ERR! node -v v20.16.0 gyp ERR! node-gyp -v v10.1.0 gyp ERR! not ok info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

kxxt commented 1 month ago

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.

siwan-tc commented 1 month ago

That's not the correct compiler flag for cross-compilation. -m64 is 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 error