sql-js / sql-js/sql.js

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

Open
#613 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
13.7k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

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.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, javascript, node.js, sqlite, wasm
Domain
build-system, developer-experience, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.