mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-04-25 06:02: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:
|
steps:
|
||||||
- template: ci/azure-install-rust.yml
|
- template: ci/azure-install-rust.yml
|
||||||
parameters:
|
parameters:
|
||||||
toolchain: nightly-2019-08-27
|
toolchain: nightly-2019-09-26
|
||||||
# Temporarily disable sccache because it is failing on CI.
|
# Temporarily disable sccache because it is failing on CI.
|
||||||
# - template: ci/azure-install-sccache.yml
|
# - template: ci/azure-install-sccache.yml
|
||||||
- script: rustup component add rust-src
|
- script: rustup component add rust-src
|
||||||
displayName: "install rust-src"
|
displayName: "install rust-src"
|
||||||
- script: cargo install xargo
|
|
||||||
displayName: "install xargo"
|
|
||||||
- script: |
|
- script: |
|
||||||
set -e
|
set -e
|
||||||
sed -i 's/python/#python/' examples/raytrace-parallel/build.sh
|
sed -i 's/python/#python/' examples/raytrace-parallel/build.sh
|
||||||
|
@ -1,2 +0,0 @@
|
|||||||
[dependencies.std]
|
|
||||||
stage = 0
|
|
@ -2,16 +2,24 @@
|
|||||||
|
|
||||||
set -ex
|
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
|
# * First, the Rust standard library needs to be recompiled with atomics
|
||||||
# is not compatible with atomics so we need to compile a version, with xargo,
|
# enabled. to do that we use Cargo's unstable `-Zbuild-std` feature.
|
||||||
# that is compatible.
|
|
||||||
#
|
#
|
||||||
# * Next we need to compile everything with the `atomics` feature enabled,
|
# * Next we need to compile everything with the `atomics` and `bulk-memory`
|
||||||
# ensuring that LLVM will generate atomic instructions and such.
|
# 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' \
|
RUSTFLAGS='-C target-feature=+atomics,+bulk-memory' \
|
||||||
xargo build --target wasm32-unknown-unknown --release
|
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
|
# 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
|
# is usable from Web Workers. We notably can't use `--target bundler` since
|
||||||
|
Loading…
x
Reference in New Issue
Block a user