https://bugzilla.redhat.com/show_bug.cgi?id=2267683
Bug ID: 2267683 Summary: Review Request: wasi-sdk - The WebAssembly System Interface SDK Product: Fedora Version: rawhide Hardware: All OS: Linux Status: NEW Component: Package Review Severity: medium Priority: medium Assignee: nobody@fedoraproject.org Reporter: jhorak@redhat.com QA Contact: extras-qa@fedoraproject.org CC: package-review@lists.fedoraproject.org Target Milestone: --- Classification: Fedora
Spec URL: https://xhorak.fedorapeople.org/wasi-sdk.spec SRPM URL: https://xhorak.fedorapeople.org/wasi-sdk-20-1.fc39.src.rpm Description: The WebAssembly System Interface SDK Fedora Account System Username: xhorak
Note: this is build dependency for the Firefox rlbox implementation - ie. sandboxing of the C/C++ libraries by using webassembler.
https://bugzilla.redhat.com/show_bug.cgi?id=2267683
--- Comment #1 from Fedora Review Service fedora-review-bot@fedoraproject.org --- There seems to be some problem with the following file. SRPM URL: https://xhorak.fedorapeople.org/wasi-sdk-20-1.fc39.src.rpm Fetching it results in a 404 Not Found error. Please make sure the URL is correct and publicly available.
--- This comment was created by the fedora-review-service https://github.com/FrostyX/fedora-review-service
If you want to trigger a new Copr build, add a comment containing new Spec and SRPM URLs or [fedora-review-service-build] string.
https://bugzilla.redhat.com/show_bug.cgi?id=2267683
--- Comment #2 from Jan Horak jhorak@redhat.com --- fedora-review-service-build
https://bugzilla.redhat.com/show_bug.cgi?id=2267683
--- Comment #3 from Jan Horak jhorak@redhat.com --- [fedora-review-service-build]
https://bugzilla.redhat.com/show_bug.cgi?id=2267683
Fedora Review Service fedora-review-bot@fedoraproject.org changed:
What |Removed |Added ---------------------------------------------------------------------------- URL| |https://github.com/WebAssem | |bly/wasi-sdk
--- Comment #4 from Fedora Review Service fedora-review-bot@fedoraproject.org --- Copr build: https://copr.fedorainfracloud.org/coprs/build/7103368 (succeeded)
Review template: https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-rev...
Please take a look if any issues were found.
--- This comment was created by the fedora-review-service https://github.com/FrostyX/fedora-review-service
If you want to trigger a new Copr build, add a comment containing new Spec and SRPM URLs or [fedora-review-service-build] string.
https://bugzilla.redhat.com/show_bug.cgi?id=2267683
Elliott Sales de Andrade quantum.analyst@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |quantum.analyst@gmail.com
--- Comment #5 from Elliott Sales de Andrade quantum.analyst@gmail.com --- A submodule-recursive checkout include LLVM; I don't think you should be including that.
https://bugzilla.redhat.com/show_bug.cgi?id=2267683
--- Comment #6 from Jan Horak jhorak@redhat.com --- I understand, but the wasi-sdk is basically using the sub modules to build the package. Do you have any other suggestions? What worries me is the DLLVM_TARGETS_TO_BUILD define and some more: cmake -G Ninja \ -DCMAKE_BUILD_TYPE=MinSizeRel \ -DLLVM_ENABLE_TERMINFO=OFF \ -DLLVM_ENABLE_ZLIB=OFF \ -DLLVM_ENABLE_ZSTD=OFF \ -DLLVM_STATIC_LINK_CXX_STDLIB=ON \ -DLLVM_HAVE_LIBXAR=OFF \ -DCMAKE_INSTALL_PREFIX=$(PREFIX) \ -DLLVM_INCLUDE_TESTS=OFF \ -DLLVM_INCLUDE_UTILS=OFF \ -DLLVM_INCLUDE_BENCHMARKS=OFF \ -DLLVM_INCLUDE_EXAMPLES=OFF \ -DLLVM_TARGETS_TO_BUILD=WebAssembly \ -DLLVM_DEFAULT_TARGET_TRIPLE=wasm32-wasi \ -DLLVM_ENABLE_PROJECTS="lld;clang;clang-tools-extra" \ $(if $(patsubst 9,,$(CLANG_VERSION)), \ $(if $(patsubst 10,,$(CLANG_VERSION)), \ -DDEFAULT_SYSROOT=../share/wasi-sysroot, \ -DDEFAULT_SYSROOT=$(PREFIX)/share/wasi-sysroot), \ -DDEFAULT_SYSROOT=$(PREFIX)/share/wasi-sysroot) \ -DLLVM_INSTALL_BINUTILS_SYMLINKS=TRUE \ -DLLVM_ENABLE_LIBXML2=OFF \ $(LLVM_CMAKE_FLAGS) \ $(LLVM_PROJ_DIR)/llvm
https://bugzilla.redhat.com/show_bug.cgi?id=2267683
Josh Stone jistone@redhat.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jistone@redhat.com, | |tstellar@redhat.com
--- Comment #7 from Josh Stone jistone@redhat.com --- The system LLVM_TARGETS_TO_BUILD already includes WebAssembly, and I think most of the other settings are fine as well.
The main tricky thing I see is the *default* target and sysroot, because the system tools default to native compilation. If the sdk wants to use clang without specifying the target, you may need something like a wrapper script to set the target and sysroot in that context.
The other one I'm not sure about is -DLLVM_STATIC_LINK_CXX_STDLIB=ON, as I haven't dealt with that.
cc Tom for additional LLVM feedback.
https://bugzilla.redhat.com/show_bug.cgi?id=2267683
--- Comment #8 from Jan Horak jhorak@redhat.com --- Thanks for the feedback guys. I'd rather put the whole Makefile there: https://github.com/WebAssembly/wasi-sdk/blob/main/Makefile
I forget that we also need compiler-rt lib. Without it I get some missing symbols (we've tried really hard without it together with jstanek): wasm-ld: error: /home/jhorak/wasi-sdk/build/install/opt/wasi-sdk/share/wasi-sysroot/lib/wasm32-wasi/libc.a(intscan.o): undefined symbol: __multi3 wasm-ld: error: /home/jhorak/wasi-sdk/build/install/opt/wasi-sdk/share/wasi-sysroot/lib/wasm32-wasi/libc++.a(algorithm.cpp.o): undefined symbol: __lttf2 wasm-ld: error: /home/jhorak/wasi-sdk/build/install/opt/wasi-sdk/share/wasi-sysroot/lib/wasm32-wasi/libc.a(intscan.o): undefined symbol: __multi3 wasm-ld: error: /home/jhorak/wasi-sdk/build/install/opt/wasi-sdk/share/wasi-sysroot/lib/wasm32-wasi/libc++.a(int128_builtins.cpp.o): undefined symbol: _ _divti3 wasm-ld: error: /home/jhorak/wasi-sdk/build/install/opt/wasi-sdk/share/wasi-sysroot/lib/wasm32-wasi/libc++.a(int128_builtins.cpp.o): undefined symbol: _ _divti3
( https://github.com/mono/mono/issues/18560#issuecomment-578902458 )
And we also need libcxx which is not in the rpms.
https://bugzilla.redhat.com/show_bug.cgi?id=2267683
--- Comment #9 from Elliott Sales de Andrade quantum.analyst@gmail.com --- compiler-rt and libcxx are separate packages from llvm: https://src.fedoraproject.org/rpms/compiler-rt https://src.fedoraproject.org/rpms/libcxx
https://bugzilla.redhat.com/show_bug.cgi?id=2267683
--- Comment #10 from Jan Horak jhorak@redhat.com --- (In reply to Elliott Sales de Andrade from comment #9)
compiler-rt and libcxx are separate packages from llvm: https://src.fedoraproject.org/rpms/compiler-rt https://src.fedoraproject.org/rpms/libcxx
I don't think any of these has been built for the wasi, ie. using toolchain file -DCMAKE_TOOLCHAIN_FILE=$(ROOT_DIR)/wasi-sdk.cmake.
I'm not sure if the worth the trouble to trying recreate what already exists. Also I doubt the package will be used by anyone but Firefox package only as a BuildRequires.
https://bugzilla.redhat.com/show_bug.cgi?id=2267683
--- Comment #11 from Josh Stone jistone@redhat.com --- It looks like build/config.BUILT is the only thing that's really unique to the wasi-sdk. The rest can potentially use existing packages.
(In reply to Jan Horak from comment #10)
I don't think any of these has been built for the wasi, ie. using toolchain file -DCMAKE_TOOLCHAIN_FILE=$(ROOT_DIR)/wasi-sdk.cmake.
Just because they haven't been, doesn't mean they can't. They could probably produce noarch wasm packages, just like rust builds a rust-std-static-wasm32-wasi subpackage, for example.
Also I doubt the package will be used by anyone but Firefox package only as a BuildRequires.
Maybe that's true at first, but we should still design for general use.
https://bugzilla.redhat.com/show_bug.cgi?id=2267683
--- Comment #12 from Jan Horak jhorak@redhat.com --- I've spent few hours trying to build the compile-rt without any luck [1] - mostly ending by unable to find the llvm compiler. Unless someone steps in and do the necessary work - ie. build the compiler-rt and libc++ for WASI in the end we'll have to bundle the wasi-sdk in the Firefox package and rebuild it every time.
[1] https://pastebin.com/684d9jru
package-review@lists.fedoraproject.org