Skip to content

Commit

Permalink
Merge pull request #2015 from wasmerio/fix/headless-wasmer-build-step
Browse files Browse the repository at this point in the history
Debug headless wasmer build step
  • Loading branch information
MarkMcCaskey committed Jan 13, 2021
2 parents 0e20bdf + 90b69ad commit fd84bbe
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,17 @@ jobs:
- name: Build Minimal Wasmer Headless
run: |
cargo install xargo
echo "\n[profile.release]\nopt-level = 'z'\ndebug = false\ndebug-assertions = false\noverflow-checks = false\nlto = true\npanic = 'abort'\nincremental = false\ncodegen-units = 1\nrpath = false" >> Cargo.toml
echo "" >> Cargo.toml
echo "[profile.release]" >> Cargo.toml
echo "opt-level = 'z'" >> Cargo.toml
echo "debug = false" >> Cargo.toml
echo "debug-assertions = false" >> Cargo.toml
echo "overflow-checks = false" >> Cargo.toml
echo "lto = true" >> Cargo.toml
echo "panic = 'abort'" >> Cargo.toml
echo "incremental = false" >> Cargo.toml
echo "codegen-units = 1" >> Cargo.toml
echo "rpath = false" >> Cargo.toml
make build-wasmer-headless-minimal
if: needs.setup.outputs.DOING_RELEASE == '1'
- name: Copy target binaries
Expand Down
14 changes: 12 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,15 @@ build-wasmer-debug:
# codegen-units = 1
# rpath = false
build-wasmer-headless-minimal:
RUSTFLAGS="-C panic=abort" xargo build -v --target $(HOST_TARGET) --release --manifest-path=lib/cli/Cargo.toml --no-default-features --features headless-minimal --bin wasmer-headless
RUSTFLAGS="-C panic=abort" xargo build --target $(HOST_TARGET) --release --manifest-path=lib/cli/Cargo.toml --no-default-features --features headless-minimal --bin wasmer-headless
ifeq ($(UNAME_S), Darwin)
strip -u target/$(HOST_TARGET)/release/wasmer-headless
else
strip --strip-unneeded target/$(HOST_TARGET)/release/wasmer-headless
ifeq ($(OS), Windows_NT)
strip --strip-unneeded target/$(HOST_TARGET)/release/wasmer-headless.exe
else
strip --strip-unneeded target/$(HOST_TARGET)/release/wasmer-headless
endif
endif

WAPM_VERSION = master # v0.5.0
Expand Down Expand Up @@ -332,9 +336,15 @@ endif
endif

package-minimal-headless-wasmer:
ifeq ($(OS), Windows_NT)
if [ -f "target/$(HOST_TARGET)/release/wasmer-headless.exe" ]; then \
cp target/$(HOST_TARGET)/release/wasmer-headless.exe package/bin ;\
fi
else
if [ -f "target/$(HOST_TARGET)/release/wasmer-headless" ]; then \
cp target/$(HOST_TARGET)/release/wasmer-headless package/bin ;\
fi
endif

package-wasmer:
mkdir -p "package/bin"
Expand Down

0 comments on commit fd84bbe

Please sign in to comment.