Skip to content

--emit-tsd broken since 4.0.7 #24403

Closed
@stevenwdv

Description

@stevenwdv

Since v4.0.7 (up to current v4.0.9), --emit-tsd seems to include stderr output in the generated .d.ts Typescript declarations file, meaning it won't compile:

...
interface WasmModule { ... }

w:0,t:0x00000000: fetch: indexedDB.open(dbname="emscripten_filesystem", dbversion="1");
w:0,t:0x00000000: fetch: IndexedDB open failed.
w:0,t:0x00000000: locateFile: tsgen.wasm scriptDirectory: /tmp/emscripten_temp_ysh8fi7k/
w:0,t:0x00000000: asynchronously preparing wasm
w:0,t:0x00000000: run() called, but dependencies remain, so not running
w:0,t:0x00000000: writeStackCookie: 0x00000000
w:0,t:0x00000000: initRuntime
w:0,t:0x00000000: setStackLimits: 0x00010000, 0x00000000
w:0,t:0x00121948: threadInitTLS
type EmbindString = ...
...

In v4.0.6, this was printed to the build console instead:

cmake --build --target pepWeblib --preset wasm32-debug-swdv
[1/1] Linking CXX executable cpp/pep/weblib/pepWeblib.mjs
shared:INFO: (Emscripten: Running sanity checks)
cache:INFO: generating system asset: symbol_lists/6cea4a478039fe812f8385c9c8789511147626ef.json... (this will be cached in "/home/swdv/emsdk/upstream/emscripten/cache/symbol_lists/6cea4a478039fe812f8385c9c8789511147626ef.json" for subsequent builds)
cache:INFO:  - ok
w:0,t:0x00000000: fetch: indexedDB.open(dbname="emscripten_filesystem", dbversion="1");
w:0,t:0x00000000: fetch: IndexedDB open failed.
w:0,t:0x00000000: locateFile: tsgen.wasm scriptDirectory: /tmp/emscripten_temp_1nxy_r6e/
w:0,t:0x00000000: asynchronously preparing wasm
w:0,t:0x00000000: run() called, but dependencies remain, so not running
w:0,t:0x00000000: writeStackCookie: 0x00000000
w:0,t:0x00000000: initRuntime
w:0,t:0x00000000: setStackLimits: 0x00010000, 0x00000000
w:0,t:0x001218f8: threadInitTLS

Version of emscripten/emsdk:

emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 4.0.7 (8dc91db45bf96c174531006839472a3924d105aa)
clang version 21.0.0git (https:/github.com/llvm/llvm-project 57025b42c43b2f14f7e58692bc19cd53d1b8a45e)
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: /home/swdv/emsdk/upstream/bin

Failing command line in full:

/home/swdv/emsdk/upstream/emscripten/em++ -matomics -mbulk-memory -fwasm-exceptions -pthread -DBOOST_LOG_USE_NATIVE_SYSLOG -DBOOST_PROCESS_USE_STD_FS -Werror -DBUILD_PROJECT_PATH=\"\" -DBUILD_REF=\"\" -DBUILD_REV=\"\" -DBUILD_MAJOR_VERSION=1 -DBUILD_MINOR_VERSION=4 -DBUILD_PIPELINE_ID=0 -DBUILD_JOB_ID=0 -DBUILD_TARGET=\"Emscripten\" -g -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG -Wbad-function-cast -Wcast-function-type -Wl,--fatal-warnings -sASSERTIONS=2 -sEXCEPTION_DEBUG -sPTHREADS_DEBUG -sFETCH_DEBUG   -sPROXY_TO_PTHREAD -Wl,--no-demangle -sEXIT_RUNTIME -gseparate-dwarf -sRUNTIME_DEBUG -sNO_PROXY_TO_PTHREAD -sNO_EXIT_RUNTIME -sNO_PTHREAD_POOL_SIZE_STRICT -sFETCH -lembind -lidbfs.js -sNO_INVOKE_RUN -sEXPORTED_RUNTIME_METHODS=FS,IDBFS,callMain -sENVIRONMENT=web,worker --emit-tsd=/home/swdv/core/build/wasm32/Debug/cpp/pep/weblib/pepWeblib.d.mts -pthread --shared-memory cpp/pep/weblib/CMakeFiles/pepWeblib.dir/Weblib.cpp.o -o cpp/pep/weblib/pepWeblib.mjs -L/home/swdv/.conan2/p/b/proto594c2cb05eb8c/p/lib   -L/home/swdv/.conan2/p/b/zliba527a5aa627aa/p/lib   -L/home/swdv/.conan2/p/b/boost365e830e1b927/p/lib   -L/home/swdv/.conan2/p/b/opensfec3f48b92f2e/p/lib   -L/home/swdv/.conan2/p/b/xxhas81d0c222d10d0/p/lib cpp/pep/application/libpepApplicationlib.a  cpp/pep/client/libpepClientlib.a  cpp/pep/oauth-client/libpepOAuthClientlib.a  cpp/pep/core-client/libpepCoreClientlib.a  cpp/pep/accessmanager/libpepAccessManagerApilib.a  cpp/pep/structure/libpepStructurelib.a  /home/swdv/.conan2/p/b/boost365e830e1b927/p/lib/libboost_random.a  cpp/pep/transcryptor/libpepTranscryptorApilib.a  cpp/pep/storagefacility/libpepStorageFacilityApilib.a  cpp/pep/morphing/libpepMorphinglib.a  cpp/pep/ticketing/libpepTicketinglib.a  cpp/pep/server/libpepServerApilib.a  cpp/pep/auth/libpepAuthlib.a  cpp/pep/content/libpepContentlib.a  /home/swdv/.conan2/p/b/boost365e830e1b927/p/lib/libboost_date_time.a  cpp/pep/keyserver/libpepKeyServerApilib.a  cpp/pep/authserver/libpepAuthserverApilib.a  cpp/pep/registrationserver/libpepRegistrationServerApilib.a  cpp/pep/rsk-pep/libpepRskPeplib.a  cpp/pep/rsk/libpepRsklib.a  cpp/pep/elgamal/libpepElgamallib.a  cpp/ext/panda/libpanda.a  cpp/pep/networking/libpepNetworkinglib.a  cpp/pep/versioning/libpepVersioninglib.a  cpp/pep/crypto/libpepCryptolib.a  cpp/pep/serialization/libpepSerializationlib.a  /home/swdv/.conan2/p/b/proto594c2cb05eb8c/p/lib/libprotobuf.a  /home/swdv/.conan2/p/b/zliba527a5aa627aa/p/lib/libz.a  /home/swdv/.conan2/p/b/boost365e830e1b927/p/lib/libboost_date_time.a  /home/swdv/.conan2/p/b/opensfec3f48b92f2e/p/lib/libcrypto.a  /home/swdv/.conan2/p/b/zliba527a5aa627aa/p/lib/libz.a  cpp/pep/async/libpepAsynclib.a  cpp/pep/utils/libpepUtilslib.a  /home/swdv/.conan2/p/b/boost365e830e1b927/p/lib/libboost_log_setup.a  /home/swdv/.conan2/p/b/boost365e830e1b927/p/lib/libboost_log.a  /home/swdv/.conan2/p/b/boost365e830e1b927/p/lib/libboost_filesystem.a  /home/swdv/.conan2/p/b/boost365e830e1b927/p/lib/libboost_random.a  /home/swdv/.conan2/p/b/boost365e830e1b927/p/lib/libboost_regex.a  /home/swdv/.conan2/p/b/boost365e830e1b927/p/lib/libboost_thread.a  /home/swdv/.conan2/p/b/boost365e830e1b927/p/lib/libboost_exception.a  /home/swdv/.conan2/p/b/boost365e830e1b927/p/lib/libboost_atomic.a  /home/swdv/.conan2/p/b/boost365e830e1b927/p/lib/libboost_date_time.a  /home/swdv/.conan2/p/b/boost365e830e1b927/p/lib/libboost_chrono.a  /home/swdv/.conan2/p/b/boost365e830e1b927/p/lib/libboost_container.a  /home/swdv/.conan2/p/b/opensfec3f48b92f2e/p/lib/libcrypto.a  /home/swdv/.conan2/p/b/zliba527a5aa627aa/p/lib/libz.a  /home/swdv/.conan2/p/b/xxhas81d0c222d10d0/p/lib/libxxhash.a  /home/swdv/.conan2/p/b/boost365e830e1b927/p/lib/libboost_url.a  /home/swdv/.conan2/p/b/opensfec3f48b92f2e/p/lib/libssl.a  /home/swdv/.conan2/p/b/opensfec3f48b92f2e/p/lib/libcrypto.a  /home/swdv/.conan2/p/b/zliba527a5aa627aa/p/lib/libz.a

Full link command and output with -v appended:

 /home/swdv/emsdk/upstream/bin/clang --version
 /home/swdv/emsdk/upstream/bin/wasm-ld -o cpp/pep/weblib/pepWeblib.wasm --fatal-warnings --no-demangle -lembind-rtti cpp/pep/weblib/CMakeFiles/pepWeblib.dir/Weblib.cpp.o -L/home/swdv/.conan2/p/b/proto594c2cb05eb8c/p/lib -L/home/swdv/.conan2/p/b/zliba527a5aa627aa/p/lib -L/home/swdv/.conan2/p/b/boost365e830e1b927/p/lib -L/home/swdv/.conan2/p/b/opensfec3f48b92f2e/p/lib -L/home/swdv/.conan2/p/b/xxhas81d0c222d10d0/p/lib cpp/pep/application/libpepApplicationlib.a cpp/pep/client/libpepClientlib.a cpp/pep/oauth-client/libpepOAuthClientlib.a cpp/pep/core-client/libpepCoreClientlib.a cpp/pep/accessmanager/libpepAccessManagerApilib.a cpp/pep/structure/libpepStructurelib.a /home/swdv/.conan2/p/b/boost365e830e1b927/p/lib/libboost_random.a cpp/pep/transcryptor/libpepTranscryptorApilib.a cpp/pep/storagefacility/libpepStorageFacilityApilib.a cpp/pep/morphing/libpepMorphinglib.a cpp/pep/ticketing/libpepTicketinglib.a cpp/pep/server/libpepServerApilib.a cpp/pep/auth/libpepAuthlib.a cpp/pep/content/libpepContentlib.a /home/swdv/.conan2/p/b/boost365e830e1b927/p/lib/libboost_date_time.a cpp/pep/keyserver/libpepKeyServerApilib.a cpp/pep/authserver/libpepAuthserverApilib.a cpp/pep/registrationserver/libpepRegistrationServerApilib.a cpp/pep/rsk-pep/libpepRskPeplib.a cpp/pep/rsk/libpepRsklib.a cpp/pep/elgamal/libpepElgamallib.a cpp/ext/panda/libpanda.a cpp/pep/networking/libpepNetworkinglib.a cpp/pep/versioning/libpepVersioninglib.a cpp/pep/crypto/libpepCryptolib.a cpp/pep/serialization/libpepSerializationlib.a /home/swdv/.conan2/p/b/proto594c2cb05eb8c/p/lib/libprotobuf.a /home/swdv/.conan2/p/b/zliba527a5aa627aa/p/lib/libz.a /home/swdv/.conan2/p/b/boost365e830e1b927/p/lib/libboost_date_time.a /home/swdv/.conan2/p/b/opensfec3f48b92f2e/p/lib/libcrypto.a /home/swdv/.conan2/p/b/zliba527a5aa627aa/p/lib/libz.a cpp/pep/async/libpepAsynclib.a cpp/pep/utils/libpepUtilslib.a /home/swdv/.conan2/p/b/boost365e830e1b927/p/lib/libboost_log_setup.a /home/swdv/.conan2/p/b/boost365e830e1b927/p/lib/libboost_log.a /home/swdv/.conan2/p/b/boost365e830e1b927/p/lib/libboost_filesystem.a /home/swdv/.conan2/p/b/boost365e830e1b927/p/lib/libboost_random.a /home/swdv/.conan2/p/b/boost365e830e1b927/p/lib/libboost_regex.a /home/swdv/.conan2/p/b/boost365e830e1b927/p/lib/libboost_thread.a /home/swdv/.conan2/p/b/boost365e830e1b927/p/lib/libboost_exception.a /home/swdv/.conan2/p/b/boost365e830e1b927/p/lib/libboost_atomic.a /home/swdv/.conan2/p/b/boost365e830e1b927/p/lib/libboost_date_time.a /home/swdv/.conan2/p/b/boost365e830e1b927/p/lib/libboost_chrono.a /home/swdv/.conan2/p/b/boost365e830e1b927/p/lib/libboost_container.a /home/swdv/.conan2/p/b/opensfec3f48b92f2e/p/lib/libcrypto.a /home/swdv/.conan2/p/b/zliba527a5aa627aa/p/lib/libz.a /home/swdv/.conan2/p/b/xxhas81d0c222d10d0/p/lib/libxxhash.a /home/swdv/.conan2/p/b/boost365e830e1b927/p/lib/libboost_url.a /home/swdv/.conan2/p/b/opensfec3f48b92f2e/p/lib/libssl.a /home/swdv/.conan2/p/b/opensfec3f48b92f2e/p/lib/libcrypto.a /home/swdv/.conan2/p/b/zliba527a5aa627aa/p/lib/libz.a -L/home/swdv/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten -L/home/swdv/emsdk/upstream/emscripten/src/lib -lfetch-mt /home/swdv/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/crtbegin.o -lGL-mt-getprocaddr -lal -lhtml5 -lstubs-debug -lnoexit -lc-mt-debug -ldlmalloc-mt-debug -lcompiler_rt-legacysjlj-mt -lc++-mt-legacyexcept -lc++abi-debug-mt-legacyexcept -lunwind-mt-legacyexcept -lsockets-mt -mllvm -combiner-global-alias-analysis=false -mllvm -wasm-enable-sjlj -mllvm -wasm-use-legacy-eh -mllvm -disable-lsr -mllvm -wasm-enable-eh -mllvm -wasm-use-legacy-eh -mllvm -exception-model=wasm /tmp/tmpkxknioctlibemscripten_js_symbols.so --import-memory --shared-memory --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=__getTypeName --export=_emscripten_thread_free_data --export=_emscripten_thread_crashed --export=_embind_initialize_bindings --export=__trap --export=__cpp_exception --export=__wasm_call_ctors --export=_emscripten_tls_init --export=_emscripten_thread_init --export=emscripten_stack_set_limits --export=_emscripten_stack_restore --export=_emscripten_thread_exit --export=strerror --export=__get_exception_message --export=free --export=__thrown_object_from_unwind_exception --export=__cxa_increment_exception_refcount --export=__cxa_decrement_exception_refcount --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-memory=16777216 --no-entry --stack-first --table-base=1
 /home/swdv/emsdk/upstream/bin/llvm-objcopy cpp/pep/weblib/pepWeblib.wasm cpp/pep/weblib/pepWeblib.wasm --remove-section=producers
 /home/swdv/emsdk/upstream/bin/wasm-emscripten-finalize -g --bigint --no-dyncalls --no-legalize-javascript-ffi --check-stack-overflow --dwarf cpp/pep/weblib/pepWeblib.wasm -o cpp/pep/weblib/pepWeblib.wasm --detect-features
 /home/swdv/emsdk/upstream/bin/wasm-emscripten-finalize -g --bigint --no-dyncalls --no-legalize-javascript-ffi --check-stack-overflow --dwarf cpp/pep/weblib/pepWeblib.wasm -o cpp/pep/weblib/pepWeblib.wasm --detect-features
 /home/swdv/emsdk/node/20.18.0_64bit/bin/node /home/swdv/emsdk/upstream/emscripten/tools/compiler.mjs -
 /home/swdv/emsdk/node/20.18.0_64bit/bin/node /home/swdv/emsdk/upstream/emscripten/tools/compiler.mjs -
 /home/swdv/emsdk/node/20.18.0_64bit/bin/node /tmp/emscripten_temp_g2ek9rb0/tsgen.js
 /home/swdv/emsdk/node/20.18.0_64bit/bin/node /home/swdv/emsdk/upstream/emscripten/node_modules/.bin/tsc --outFile /tmp/emscripten_temp_g2ek9rb0/jsdoc.d.ts --skipLibCheck --declaration --emitDeclarationOnly --allowJs /tmp/emscripten_temp_g2ek9rb0/jsdoc.js
 /home/swdv/emsdk/upstream/bin/llvm-objcopy cpp/pep/weblib/pepWeblib.wasm.debug.wasm cpp/pep/weblib/pepWeblib.wasm --remove-section=.debug*

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions