mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-04-24 21:52:13 +00:00
Switch to Cargo's -Zbuild-std
for building libstd (#1796)
This commit switches away from `xargo` to using `-Zbuild-std` to building the standard library for the raytrace-parallel example (which needs to rebuild std with new target features).
This commit is contained in:
parent
6b31777794
commit
025b1d8bca
@ -211,13 +211,11 @@ jobs:
|
||||
steps:
|
||||
- template: ci/azure-install-rust.yml
|
||||
parameters:
|
||||
toolchain: nightly-2019-08-27
|
||||
toolchain: nightly-2019-09-26
|
||||
# Temporarily disable sccache because it is failing on CI.
|
||||
# - template: ci/azure-install-sccache.yml
|
||||
- script: rustup component add rust-src
|
||||
displayName: "install rust-src"
|
||||
- script: cargo install xargo
|
||||
displayName: "install xargo"
|
||||
- script: |
|
||||
set -e
|
||||
sed -i 's/python/#python/' examples/raytrace-parallel/build.sh
|
||||
|
@ -1,2 +0,0 @@
|
||||
[dependencies.std]
|
||||
stage = 0
|
@ -2,16 +2,24 @@
|
||||
|
||||
set -ex
|
||||
|
||||
# Two critical steps are required here to get this working:
|
||||
# A few steps are necessary to get this build working which makes it slightly
|
||||
# nonstandard compared to most other builds.
|
||||
#
|
||||
# * First, the Rust standard library needs to be compiled. The default version
|
||||
# is not compatible with atomics so we need to compile a version, with xargo,
|
||||
# that is compatible.
|
||||
# * First, the Rust standard library needs to be recompiled with atomics
|
||||
# enabled. to do that we use Cargo's unstable `-Zbuild-std` feature.
|
||||
#
|
||||
# * Next we need to compile everything with the `atomics` feature enabled,
|
||||
# ensuring that LLVM will generate atomic instructions and such.
|
||||
RUSTFLAGS='-C target-feature=+atomics,+bulk-memory' \
|
||||
xargo build --target wasm32-unknown-unknown --release
|
||||
# * Next we need to compile everything with the `atomics` and `bulk-memory`
|
||||
# features enabled, ensuring that LLVM will generate atomic instructions,
|
||||
# shared memory, passive segments, etc.
|
||||
#
|
||||
# * Finally, `-Zbuild-std` is still in development, and one of its downsides
|
||||
# right now is rust-lang/wg-cargo-std-aware#47 where using `rust-lld` doesn't
|
||||
# work by default, which the wasm target uses. To work around that we find it
|
||||
# and put it in PATH
|
||||
|
||||
PATH=$PATH:$(dirname $(find $(rustc --print sysroot) -name 'rust-lld')) \
|
||||
RUSTFLAGS='-C target-feature=+atomics,+bulk-memory' \
|
||||
cargo build --target wasm32-unknown-unknown --release -Z build-std -Z timings=html
|
||||
|
||||
# Note the usage of `--no-modules` here which is used to create an output which
|
||||
# is usable from Web Workers. We notably can't use `--target bundler` since
|
||||
|
Loading…
x
Reference in New Issue
Block a user