Error building in dev container: falling back to java version of closure compiler / google-closure-compiler returned non-zero exit status 254

未關閉
#613 3 則留言 2 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
35/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
停滯
技術堆疊
docker, javascript, node.js, sqlite, wasm

研究方向

Start with Makefile:94 and the emcc invocation shown in the npm run rebuild log; reproduce the closure compiler failure in the ARM64 dev container and inspect how that compiler is selected. Done means npm run rebuild completes and produces dist/sql-asm.js without the non-zero exit status.

由索引模型根據 Issue 內容生成。

描述

I'm on an ARM64 Mac Book Pro, running the DevContainer in VS Code.

After a fresh checkout, no pending changes, npm install and then npm run rebuild, I get this error:

building:WARNING: falling back to java version of closure compiler
Command '['/emsdk/node/20.18.0_64bit/bin/node', '--max_old_space_size=8192', '/emsdk/upstream/emscripten/node_modules/.bin/google-closure-compiler', '--platform=java', '--version']' returned non-zero exit status 254.
emcc: error: closure compiler (/emsdk/node/20.18.0_64bit/bin/node --max_old_space_size=8192 /emsdk/upstream/emscripten/node_modules/.bin/google-closure-compiler --platform=java --version) did not execute properly!
make: *** [Makefile:94: dist/sql-asm.js] Error 1

Here's the full log after running npm run rebuild:

node ➜ /workspaces/sql.js-with-sqlean (master) $ npm run rebuild

> sql.js@1.13.0 rebuild
> npm run clean && npm run build


> sql.js@1.13.0 clean
> make clean

rm -f out/* dist/* cache/*
rm -rf sqlite-src/

> sql.js@1.13.0 build
> make

mkdir -p cache
curl -LsSf 'https://sqlite.org/2025/sqlite-amalgamation-3490100.zip' -o cache/sqlite-amalgamation-3490100.zip
mkdir -p cache
curl -LsSf 'https://www.sqlite.org/contrib/download/extension-functions.c?get=25' -o cache/extension-functions.c
mkdir -p sqlite-src/sqlite-amalgamation-3490100
echo 'c68fa706d6d9ff98608044c00212473f9c14892f  ./cache/extension-functions.c' > cache/check.txt
sha1sum -c cache/check.txt
./cache/extension-functions.c: OK
cp 'cache/extension-functions.c' sqlite-src/sqlite-amalgamation-3490100/extension-functions.c
mkdir -p sqlite-src/sqlite-amalgamation-3490100
echo 'e7eb4cfb2d95626e782cfa748f534c74482f2c3c93f13ee828b9187ce05b2da7  ./cache/sqlite-amalgamation-3490100.zip' > cache/check.txt
sha3sum -a 256 -c cache/check.txt
./cache/sqlite-amalgamation-3490100.zip: OK
# We don't delete the sqlite_amalgamation folder. That's a job for clean
# Also, the extension functions get copied here, and if we get the order of these steps wrong,
# this step could remove the extension functions, and that's not what we want
unzip -u 'cache/sqlite-amalgamation-3490100.zip' -d sqlite-src/
Archive:  cache/sqlite-amalgamation-3490100.zip
  inflating: sqlite-src/sqlite-amalgamation-3490100/sqlite3.c  
  inflating: sqlite-src/sqlite-amalgamation-3490100/shell.c  
  inflating: sqlite-src/sqlite-amalgamation-3490100/sqlite3.h  
  inflating: sqlite-src/sqlite-amalgamation-3490100/sqlite3ext.h  
touch sqlite-src/sqlite-amalgamation-3490100
mkdir -p out
# Generate llvm bitcode
emcc -Oz -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_DISABLE_LFS -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_THREADSAFE=0 -DSQLITE_ENABLE_NORMALIZE -c sqlite-src/sqlite-amalgamation-3490100/sqlite3.c -o out/sqlite3.o
mkdir -p out
# Generate llvm bitcode
emcc -Oz -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_DISABLE_LFS -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_THREADSAFE=0 -DSQLITE_ENABLE_NORMALIZE -c sqlite-src/sqlite-amalgamation-3490100/extension-functions.c -o out/extension-functions.o
emcc -s RESERVED_FUNCTION_POINTERS=64 -s ALLOW_TABLE_GROWTH=1 -s EXPORTED_FUNCTIONS=@src/exported_functions.json -s EXPORTED_RUNTIME_METHODS=@src/exported_runtime_methods.json -s SINGLE_FILE=0 -s NODEJS_CATCH_EXIT=0 -s NODEJS_CATCH_REJECTION=0 -s STACK_SIZE=5MB -Oz -flto --closure 1 -s WASM=0 out/sqlite3.o out/extension-functions.o --pre-js src/api.js -o dist/sql-asm.js
cache:INFO: generating system library: sysroot/lib/wasm32-emscripten/lto/libGL-getprocaddr.a... (this will be cached in "/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/lto/libGL-getprocaddr.a" for subsequent builds)
system_libs:INFO: compiled 4 inputs in 0.30s
cache:INFO:  - ok
cache:INFO: generating system library: sysroot/lib/wasm32-emscripten/lto/libal.a... (this will be cached in "/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/lto/libal.a" for subsequent builds)
system_libs:INFO: compiled 1 inputs in 0.12s
cache:INFO:  - ok
cache:INFO: generating system library: sysroot/lib/wasm32-emscripten/lto/libhtml5.a... (this will be cached in "/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/lto/libhtml5.a" for subsequent builds)
system_libs:INFO: compiled 5 inputs in 0.36s
cache:INFO:  - ok
cache:INFO: generating system library: sysroot/lib/wasm32-emscripten/lto/libc_optz.a... (this will be cached in "/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/lto/libc_optz.a" for subsequent builds)
system_libs:INFO: compiled 7 inputs in 0.46s
cache:INFO:  - ok
cache:INFO: generating system library: sysroot/lib/wasm32-emscripten/lto/libstubs.a... (this will be cached in "/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/lto/libstubs.a" for subsequent builds)
system_libs:INFO: compiled 2 inputs in 0.12s
cache:INFO:  - ok
cache:INFO: generating system library: sysroot/lib/wasm32-emscripten/lto/libnoexit.a... (this will be cached in "/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/lto/libnoexit.a" for subsequent builds)
system_libs:INFO: compiled 1 inputs in 0.16s
cache:INFO:  - ok
cache:INFO: generating system library: sysroot/lib/wasm32-emscripten/lto/libc.a... (this will be cached in "/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/lto/libc.a" for subsequent builds)
system_libs:INFO: compiled 1043 inputs in 7.77s
cache:INFO:  - ok
cache:INFO: generating system library: sysroot/lib/wasm32-emscripten/lto/libdlmalloc.a... (this will be cached in "/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/lto/libdlmalloc.a" for subsequent builds)
system_libs:INFO: compiled 2 inputs in 0.32s
cache:INFO:  - ok
cache:INFO: generating system library: sysroot/lib/wasm32-emscripten/lto/libcompiler_rt.a... (this will be cached in "/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/lto/libcompiler_rt.a" for subsequent builds)
system_libs:INFO: compiled 162 inputs in 1.62s
cache:INFO:  - ok
cache:INFO: generating system library: sysroot/lib/wasm32-emscripten/lto/libc++-noexcept.a... (this will be cached in "/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/lto/libc++-noexcept.a" for subsequent builds)
system_libs:INFO: compiled 57 inputs in 18.51s
cache:INFO:  - ok
cache:INFO: generating system library: sysroot/lib/wasm32-emscripten/lto/libc++abi-noexcept.a... (this will be cached in "/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/lto/libc++abi-noexcept.a" for subsequent builds)
system_libs:INFO: compiled 16 inputs in 1.74s
cache:INFO:  - ok
cache:INFO: generating system library: sysroot/lib/wasm32-emscripten/lto/libsockets.a... (this will be cached in "/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/lto/libsockets.a" for subsequent builds)
system_libs:INFO: compiled 27 inputs in 0.79s
cache:INFO:  - ok
cache:INFO: generating system asset: symbol_lists/8108443b04583d75a36e7cbeb5b4b4fc329d6878.json... (this will be cached in "/emsdk/upstream/emscripten/cache/symbol_lists/8108443b04583d75a36e7cbeb5b4b4fc329d6878.json" for subsequent builds)
cache:INFO:  - ok
building:WARNING: falling back to java version of closure compiler
Command '['/emsdk/node/20.18.0_64bit/bin/node', '--max_old_space_size=8192', '/emsdk/upstream/emscripten/node_modules/.bin/google-closure-compiler', '--platform=java', '--version']' returned non-zero exit status 254.
emcc: error: closure compiler (/emsdk/node/20.18.0_64bit/bin/node --max_old_space_size=8192 /emsdk/upstream/emscripten/node_modules/.bin/google-closure-compiler --platform=java --version) did not execute properly!
make: *** [Makefile:94: dist/sql-asm.js] Error 1
主要語言
JavaScript
星號
13.7k
分支
1.1k
PR 合併指標
30 天內沒有已合併 PR

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

sql-js/sql.js 的其他 Issue

查看 sql-js/sql.js 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。