Support `--emit-tsd` in Docker container by default
merceyz opened this issue · 3 comments
merceyz commented
The emscripten/emsdk:3.1.57
container doesn't contain tsc
so the --emit-tsd
flag doesn't work by default.
It would be nice if the Docker container could contain tsc
by default.
Reproduction:
touch test.c && docker run --rm -it -v "$(pwd):/src" emscripten/emsdk:3.1.57 emcc -o ./build.js --emit-tsd ./build.d.ts -v ./test.c
/emsdk/upstream/bin/clang -target wasm32-unknown-emscripten -fignore-exceptions -fvisibility=default -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr --sysroot=/emsdk/upstream/emscripten/cache/sysroot -DEMSCRIPTEN -Werror=implicit-function-declaration -Xclang -iwithsysroot/include/fakesdl -Xclang -iwithsysroot/include/compat -v ./test.c -c -o /tmp/emscripten_temp_dmia875v/test_0.o
clang version 19.0.0git (https:/github.com/llvm/llvm-project ccdebbae4d77d3efc236af92c22941de5d437e01)
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: /emsdk/upstream/bin
(in-process)
"/emsdk/upstream/bin/clang-19" -cc1 -triple wasm32-unknown-emscripten -emit-obj -mrelax-all -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name test.c -mrelocation-model static -mframe-pointer=none -ffp-contract=on -fno-rounding-math -mconstructor-aliases -target-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/src -v -fcoverage-compilation-dir=/src -resource-dir /emsdk/upstream/lib/clang/19 -D EMSCRIPTEN -isysroot /emsdk/upstream/emscripten/cache/sysroot -internal-isystem /emsdk/upstream/lib/clang/19/include -internal-isystem /emsdk/upstream/emscripten/cache/sysroot/include/wasm32-emscripten -internal-isystem /emsdk/upstream/emscripten/cache/sysroot/include -Werror=implicit-function-declaration -ferror-limit 19 -fvisibility=default -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -fignore-exceptions -fcolor-diagnostics -iwithsysroot/include/fakesdl -iwithsysroot/include/compat -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr -o /tmp/emscripten_temp_dmia875v/test_0.o -x c ./test.c
clang -cc1 version 19.0.0git based upon LLVM 19.0.0git default target x86_64-unknown-linux-gnu
ignoring nonexistent directory "/emsdk/upstream/emscripten/cache/sysroot/include/wasm32-emscripten"
#include "..." search starts here:
#include <...> search starts here:
/emsdk/upstream/emscripten/cache/sysroot/include/fakesdl
/emsdk/upstream/emscripten/cache/sysroot/include/compat
/emsdk/upstream/lib/clang/19/include
/emsdk/upstream/emscripten/cache/sysroot/include
End of search list.
/emsdk/upstream/bin/clang --version
cache:INFO: generating system asset: symbol_lists/01e1e9a4c0bd6ca93092d8b7f3eedeb510e4cfc6.json... (this will be cached in "/emsdk/upstream/emscripten/cache/symbol_lists/01e1e9a4c0bd6ca93092d8b7f3eedeb510e4cfc6.json" for subsequent builds)
/emsdk/node/16.20.0_64bit/bin/node /emsdk/upstream/emscripten/src/compiler.mjs /tmp/tmp4p3ssnds.json --symbols-only
cache:INFO: - ok
/emsdk/upstream/bin/wasm-ld -o ./build.wasm -L/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten /tmp/emscripten_temp_dmia875v/test_0.o -lGL-getprocaddr -lal -lhtml5 -lstubs-debug -lnoexit -lc-debug -ldlmalloc -lcompiler_rt -lc++-noexcept -lc++abi-debug-noexcept -lsockets -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr /tmp/tmpibd69osblibemscripten_js_symbols.so --strip-debug --export=emscripten_stack_get_end --export=emscripten_stack_get_free --export=emscripten_stack_get_base --export=emscripten_stack_get_current --export=emscripten_stack_init --export=_emscripten_stack_alloc --export=__get_temp_ret --export=__set_temp_ret --export=__wasm_call_ctors --export=_emscripten_stack_restore --export-if-defined=__start_em_asm --export-if-defined=__stop_em_asm --export-if-defined=__start_em_lib_deps --export-if-defined=__stop_em_lib_deps --export-if-defined=__start_em_js --export-if-defined=__stop_em_js --export-if-defined=main --export-if-defined=__main_argc_argv --export-if-defined=fflush --export-table -z stack-size=65536 --no-growable-memory --initial-heap=16777216 --no-entry --stack-first --table-base=1
/emsdk/upstream/bin/llvm-objcopy ./build.wasm ./build.wasm --remove-section=.debug* --remove-section=producers
/emsdk/upstream/bin/wasm-emscripten-finalize --dyncalls-i64 --pass-arg=legalize-js-interface-exported-helpers ./build.wasm -o ./build.wasm --detect-features
/emsdk/node/16.20.0_64bit/bin/node /emsdk/upstream/emscripten/src/compiler.mjs /tmp/tmp0xih23ki.json
emcc: error: tsc was not found! Please run "npm install" in Emscripten root directory to set up npm dependencies
sbc100 commented
Sounds reasonable. What is the best why to install tsc do you think? Would you have time to set a PR the Dockerfile to ensure it is installed?