forked from bytecodealliance/wasm-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-release-artifacts.sh
More file actions
executable file
·37 lines (31 loc) · 1.44 KB
/
Copy pathbuild-release-artifacts.sh
File metadata and controls
executable file
·37 lines (31 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
# A script to build the release artifacts of this repository into the `target`
# directory. Note that this script only produces the artifacts through Cargo and
# doesn't package things up. That's intended for the `build-tarballs.sh` script.
set -ex
# If `$DOCKER_IMAGE` is set then run the build inside of that docker container
# instead of on the host machine. In CI this uses `./ci/docker/*/Dockerfile` to
# have precise glibc requirements for Linux platforms for example.
if [ "$DOCKER_IMAGE" != "" ]; then
if [ -f "$DOCKER_IMAGE" ]; then
docker build --tag build-image --file $DOCKER_IMAGE ci/docker
DOCKER_IMAGE=build-image
fi
# Inherit the environment's rustc and env vars related to cargo/rust, and then
# otherwise re-execute ourselves and we'll be missing `$DOCKER_IMAGE` in the
# container so we'll continue below.
exec docker run --interactive \
--volume `pwd`:`pwd` \
--volume `rustc --print sysroot`:/rust:ro \
--workdir `pwd` \
--interactive \
--env-file <(env | grep 'CARGO\|RUST') \
$DOCKER_IMAGE \
bash -c "PATH=\$PATH:/rust/bin RUSTFLAGS=\"\$RUSTFLAGS \$EXTRA_RUSTFLAGS\" `pwd`/$0 $*"
fi
# Default build flags for release artifacts. Leave debugging for
# builds-from-source which have richer information anyway, and additionally the
# CLI won't benefit from catching unwinds.
export CARGO_PROFILE_RELEASE_STRIP=debuginfo
export CARGO_PROFILE_RELEASE_PANIC=abort
exec cargo build --release