Skip to content

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

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

Open
KevBelisle opened this issue May 2, 2025 · 2 comments

Comments

@KevBelisle
Copy link

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
@lovasoa
Copy link
Member

lovasoa commented May 3, 2025

Thanks for the report!

I don't have an arm machine, but I'll be happy to merge your pull request if you make one!

@KevBelisle
Copy link
Author

I think it might be linked to an open issue that google-closure-compiler-linux doesn't support arm64.

google/closure-compiler-npm#291

I can get it to run by simply removing the closure compilation flag (--closure 1) from the EMFLAGS_OPTIMIZED

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants