diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2018-03-29 14:59:13 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2018-04-13 07:03:00 -0700 |
| commit | c3a5d6b130e27d7d7587f56581247d5b08c38594 (patch) | |
| tree | d9ebfea2bd391be55bb43eb732114c0d46286a8d /src/ci | |
| parent | 99d4886ead646da864cff7963f540a44acd4af05 (diff) | |
| download | rust-c3a5d6b130e27d7d7587f56581247d5b08c38594.tar.gz rust-c3a5d6b130e27d7d7587f56581247d5b08c38594.zip | |
std: Minimize size of panicking on wasm
This commit applies a few code size optimizations for the wasm target to the standard library, namely around panics. We notably know that in most configurations it's impossible for us to print anything in wasm32-unknown-unknown so we can skip larger portions of panicking that are otherwise simply informative. This allows us to get quite a nice size reduction. Finally we can also tweak where the allocation happens for the `Box<Any>` that we panic with. By only allocating once unwinding starts we can reduce the size of a panicking wasm module from 44k to 350 bytes.
Diffstat (limited to 'src/ci')
| -rw-r--r-- | src/ci/docker/wasm32-unknown/Dockerfile | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ci/docker/wasm32-unknown/Dockerfile b/src/ci/docker/wasm32-unknown/Dockerfile index 853923ad947..56eda548071 100644 --- a/src/ci/docker/wasm32-unknown/Dockerfile +++ b/src/ci/docker/wasm32-unknown/Dockerfile @@ -25,6 +25,12 @@ ENV RUST_CONFIGURE_ARGS \ --set build.nodejs=/node-v9.2.0-linux-x64/bin/node \ --set rust.lld +# Some run-make tests have assertions about code size, and enabling debug +# assertions in libstd causes the binary to be much bigger than it would +# otherwise normally be. We already test libstd with debug assertions in lots of +# other contexts as well +ENV NO_DEBUG_ASSERTIONS=1 + ENV SCRIPT python2.7 /checkout/x.py test --target $TARGETS \ src/test/run-make \ src/test/ui \ |
