emscripten-core / emscripten

Emscripten: An LLVM-to-WebAssembly Compiler
Other
25.92k stars 3.32k forks source link

Compiler seems to truncate file when building #20718

Closed kohakukun closed 2 months ago

kohakukun commented 1 year ago

Version of emscripten/emsdk: emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.48 (e967e20b4727956a30592165a3c1cde5c67fa0a8) clang version 18.0.0 (https://github.com/llvm/llvm-project a54545ba6514802178cf7cf1c1dd9f7efbf3cde7) Target: wasm32-unknown-emscripten Thread model: posix

Failing command line in full: In file included from /usd/pxr/base/arch/initConfig.cpp:28: /usd/pxr/base/arch/systemInfo.h:1:1: error: unknown type name 'sion' 1 | sion 2.0 (the "Apache License")

em++: error: '/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 -DEMSCRIPTEN_SHARED_MEMORY=1 -DEMSCRIPTEN --sysroot=/emsdk/upstream/emscripten/cache/sysroot -Xclang -iwithsysroot/include/fakesdl -Xclang -iwithsysroot/include/compat -DARCH_EXPORTS=1 -DBOOST_PYTHON_NO_PY_SIGNATURES -DGLX_GLXEXT_PROTOTYPES -DGL_GLEXT_PROTOTYPES -DMFB_ALT_PACKAGE_NAME=arch -DMFB_PACKAGE_MODULE=Arch -DMFB_PACKAGE_NAME=arch -DPXR_BUILD_LOCATION=usd -DPXR_PLUGIN_BUILD_LOCATION=../plugin/usd -DPXR_STATIC=1 -DPXR_WEBGPU_SUPPORT_ENABLED -I/Builds/emscripten/build/usd/include -Wall -Wformat-security -pthread -Wno-deprecated -Wno-deprecated-declarations -Wno-unused-local-typedefs -Wno-unused-command-line-argument -O3 -DNDEBUG -std=c++14 -fPIC -fPIC -MD -MT pxr/base/arch/CMakeFiles/arch_internal.dir/initConfig.cpp.o -MF CMakeFiles/arch_internal.dir/initConfig.cpp.o.d -c -matomics -mbulk-memory /usd/pxr/base/arch/initConfig.cpp -o CMakeFiles/arch_internal.dir/initConfig.cpp.o' failed (returned 1)

Emscripten seems to be truncating the files when compiling, this is the first few lines of the "faulty" file

//
// Copyright 2016 Pixar
//
// Licensed under the Apache License, Version 2.0 (the "Apache License")
// with the following modification; you may not use this file except in

See how the error reports line 4 as the first line and is skipping over the comment characters.

This didn't happen before version 3.1.46. I also tried running emcc --clear-cache to see if it would help.

sbc100 commented 1 year ago

That seems very strange. This seems like it must be an issue with clang itself rather than Emscripten.

Is there anything strange about that file? Can you attach /usd/pxr/base/arch/systemInfo.h to this ticket perhaps?

Perhaps trying running that header directly through the pre-processor with /emsdk/upstream/bin/clang++ -E /usd/pxr/base/arch/systemInfo.h?

kripken commented 1 year ago

If this started happening with 3.1.46 then bisecting is another option here: https://emscripten.org/docs/contributing/developers_guide.html#bisecting

kohakukun commented 2 months ago

Sorry, seems it was an internal issue with our tooling