emscripten-core / emscripten

Emscripten: An LLVM-to-WebAssembly Compiler
Other
25.8k stars 3.31k forks source link

Boost build emscripten toolset fails on Windows #17187

Open mpconte opened 2 years ago

mpconte commented 2 years ago

Version of emscripten/emsdk: emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.13 (531257621816c200bc7c3be53129494afd029aec) clang version 15.0.0 (https://github.com/llvm/llvm-project 5c6ed60c517c47b25b6b25d8ac3666d0e746b0c3) Target: wasm32-unknown-emscripten Thread model: posix InstalledDir: E:\emsdk\upstream\bin

Failing command line in full: b2.exe toolset=emscripten

Output

E:\emsdk\python\3.9.2-nuget_64bit\python.exe: can't open file 'E:\boost\boost_1_78_0\emcc.py': [Errno 2] No such file or directory
E:/boost/boost_1_78_0/tools/build/src/build\property.jam:816: in class@property-map.find from module object(property-map)@39
error: Ambiguous key <abi>ms <asynch-exceptions>off <binary-format>pe <boost.json.mode>boost <closure>off <context-impl>fcontext <coverage>off <debug-symbols>on <define>BOOST_ALL_NO_LIB=1 <embind>off <exception-handling>on <extern-c-nothrow>off <hardcode-dll-paths>true <host-os>windows <include>. <inlining>off <install-dependencies>off <link-optimization>off <link>shared <local-visibility>hidden <main-target-type>OBJ <optimization>off <os>NT <pch>on <preserve-test-targets>on <profiling>off <python-debugging>off <python>3.8 <relevant>address-model <relevant>address-sanitizer <relevant>architecture <relevant>c++-template-depth <relevant>cflags <relevant>coverage <relevant>cxxflags <relevant>cxxstd <relevant>cxxstd-dialect <relevant>debug-symbols <relevant>define <relevant>define:<relevant>toolset <relevant>exception-handling <relevant>flags <relevant>force-include <relevant>include <relevant>inlining <relevant>instruction-set <relevant>leak-sanitizer <relevant>link <relevant>link:<relevant>toolset <relevant>local-visibility <relevant>lto <relevant>lto-mode <relevant>optimization <relevant>pch <relevant>pch-file <relevant>profiling <relevant>rtti <relevant>stdlib <relevant>target-os <relevant>thread-sanitizer <relevant>threading <relevant>toolset <relevant>undefined-sanitizer <relevant>warnings <relevant>warnings-as-errors <response-file>auto <rtti>on <runtime-debugging>on <runtime-link>shared <stdlib>native <strip>off <suppress-import-lib>false <symlink-location>project-relative <tag>@Jamfile<E:\boost\boost_1_78_0>%Jamfile<E:\boost\boost_1_78_0>.tag <target-os>windows <target>object(file-target)@7017 <testing.execute>on <threadapi>win32 <threading>multi <toolset>emscripten <user-interface>console <variant>debug <vectorize>off <visibility>hidden <warnings-as-errors>off <warnings>on <xsl:param>boost.defaults=Boost
E:/boost/boost_1_78_0/tools/build/src/build\type.jam:340: in generated-target-ps from module type
E:/boost/boost_1_78_0/tools/build/src/build\type.jam:277: in type.generated-target-suffix from module type
E:/boost/boost_1_78_0/tools/build/src/build\virtual-target.jam:531: in virtual-target.add-prefix-and-suffix from module virtual-target
E:/boost/boost_1_78_0/tools/build/src/build\virtual-target.jam:490: in _adjust-name from module object(file-target)@7017
E:/boost/boost_1_78_0/tools/build/src/build\virtual-target.jam:287: in abstract-file-target.__init__ from module object(file-target)@7017
E:/boost/boost_1_78_0/tools/build/src/build\virtual-target.jam:583: in class@file-target.__init__ from module object(file-target)@7017
E:/boost/boost_1_78_0/tools/build/src/kernel\class.jam:90: in class.new from module class
E:/boost/boost_1_78_0/tools/build/src/build\generators.jam:582: in generated-targets from module object(C-compiling-generator)@136
E:/boost/boost_1_78_0/tools/build/src/build\generators.jam:468: in construct-result from module object(C-compiling-generator)@136
E:/boost/boost_1_78_0/tools/build/src/build\generators.jam:418: in run-really from module object(C-compiling-generator)@136
E:/boost/boost_1_78_0/tools/build/src/build\generators.jam:392: in class@generator.run from module object(C-compiling-generator)@136
E:/boost/boost_1_78_0/tools/build/src/build\generators.jam:1025: in try-one-generator-really from module generators
E:/boost/boost_1_78_0/tools/build/src/build\generators.jam:1087: in try-one-generator from module generators
E:/boost/boost_1_78_0/tools/build/src/build\generators.jam:1325: in construct-really from module generators
E:/boost/boost_1_78_0/tools/build/src/build\generators.jam:1411: in generators.construct from module generators
E:/boost/boost_1_78_0/tools/build/src/build\targets.jam:1635: in construct from module object(typed-target)@1379
E:/boost/boost_1_78_0/tools/build/src/build\targets.jam:1393: in class@basic-target.generate from module object(typed-target)@1379
E:/boost/boost_1_78_0/tools/build/src/build\targets.jam:812: in generate-really from module object(main-target)@6996
E:/boost/boost_1_78_0/tools/build/src/build\targets.jam:784: in class@main-target.generate from module object(main-target)@6996
E:/boost/boost_1_78_0/tools/build/src/build\targets.jam:934: in targets.generate-from-reference from module targets
E:/boost/boost_1_78_0/tools/build/src/build\configure.jam:389: in find-builds-raw from module configure
E:/boost/boost_1_78_0/tools/build/src/build\configure.jam:470: in configure.find-builds from module configure
E:/boost/boost_1_78_0\boostcpp.jam:618: in boostcpp.deduce-address-model from module boostcpp
E:/boost/boost_1_78_0/tools/build/src/kernel\modules.jam:106: in modules.call-in from module Jamfile<E:\boost\boost_1_78_0>
E:/boost/boost_1_78_0/tools/build/src/util\indirect.jam:105: in indirect.call from module indirect
E:/boost/boost_1_78_0/tools/build/src/build\property.jam:135: in property.evaluate-conditionals-in-context from module property
E:/boost/boost_1_78_0/tools/build/src/build\targets.jam:1088: in evaluate-requirements from module targets
E:/boost/boost_1_78_0/tools/build/src/build\targets.jam:1122: in common-properties2 from module targets
E:/boost/boost_1_78_0/tools/build/src/build\targets.jam:1018: in targets.common-properties from module targets
E:/boost/boost_1_78_0/tools/build/src/build\targets.jam:1314: in alias-target-class.generate from module object(top-level-target)@204
E:/boost/boost_1_78_0\boostcpp.jam:430: in build-multiple from module object(top-level-target)@204
E:/boost/boost_1_78_0\boostcpp.jam:420: in class@top-level-target.generate from module object(top-level-target)@204
E:/boost/boost_1_78_0/tools/build/src/build\targets.jam:812: in generate-really from module object(main-target)@6986
E:/boost/boost_1_78_0/tools/build/src/build\targets.jam:784: in class@main-target.generate from module object(main-target)@6986
E:/boost/boost_1_78_0/tools/build/src/build\targets.jam:273: in class@project-target.generate from module object(project-target)@147
E:/boost/boost_1_78_0/tools/build/src\build-system.jam:805: in load from module build-system
E:/boost/boost_1_78_0/tools/build/src/kernel\modules.jam:294: in import from module modules
E:/boost/boost_1_78_0/tools/build/src/kernel/bootstrap.jam:139: in boost-build from module
E:/boost/boost_1_78_0/boost-build.jam:17: in module scope from module
SenliangWang commented 1 year ago

did you solve this problem successfully? @mpconte

David-Herzog-Vexcel commented 1 year ago

I'm stuck on the same problem. Please, can you recommend me another way of doing it so?, for rookies / beginner's ...

yhgu2000 commented 1 year ago

@David-Herzog-Vexcel Did you solve this? I encounter this problem in boost 1.81 again!

eagleoflqj commented 1 year ago

By printing some context of property.jam I notice the problem is that target-os is windows, which means the object suffix is obj. But the toolset emscripten also claims it to be bc, which is the "ambiguity". A workaround is to provide target-os=linux to b2. It builds filesystem for me but it's still not the behavior that I want:

  1. The installed headers is under PREFIX/include/boost-1_81/boost, not the PREFIX/include/boost that I get on Linux and macOS.
  2. The libboost_filesystem-31-1_81.bc has the same md5 with Linux/macOS artifact but the name is strange. I guess 31 is the version of emscripten (3.1.44) but I really want the name to be libboost_filesystem.bc.

I guess there are some hacks to be made so that they can be unified.

EDIT: The 2 problems are solved by providing --layout=system to b2.

Kojoley commented 6 months ago

19212 fixed the issue. Boost 1.85 / b2 5.0.0 also has a workaround for the cmd.exe bug.