Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run e2e test for release build and fix it by switching back to stable #818

Merged
merged 8 commits into from
Feb 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:

- name: Ensure release binary is runnable
if: "matrix.r"
run: ./target/${{ matrix.t }}/release/cargo-binstall -V
run: just e2e-tests

- if: inputs.publish
name: Upload to release
Expand Down
35 changes: 19 additions & 16 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ output-folder := if target != target-host { "target" / target / output-profile-f
output-path := output-folder / output-filename

# which tool to use for compiling
cargo-bin := if use-cargo-zigbuild != "" { "cargo-zigbuild" } else if use-cross != "" { "cross" } else { "cargo +nightly" }
cargo-bin := if use-cargo-zigbuild != "" { "cargo-zigbuild" } else if use-cross != "" { "cross" } else { "cargo" }

# cargo compile options
cargo-profile := if for-release != "" { "release" } else { "dev" }
Expand All @@ -48,9 +48,9 @@ ci-or-no := if ci != "" { "ci" } else { "noci" }

# In release builds in CI, build the std library ourselves so it uses our
# compile profile, and optimise panic messages out with immediate abort.
cargo-buildstd := if (cargo-profile / ci-or-no) == "release/ci" {
" -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort"
} else { "" }
cargo-buildstd := "" #if (cargo-profile / ci-or-no) == "release/ci" {
#" -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort"
#} else { "" }

# In musl release builds in CI, statically link gcclibs.
rustc-gcclibs := if (cargo-profile / ci-or-no / target-libc) == "release/ci/musl" {
Expand Down Expand Up @@ -82,7 +82,8 @@ cargo-split-debuginfo := if cargo-buildstd != "" { " --config='profile.release.s
win-arm64-ring16 := if target == "aarch64-pc-windows-msvc" { " --config='patch.crates-io.ring.git=\"https://github.com/awakecoding/ring\"' --config='patch.crates-io.ring.branch=\"0.16.20_alpha\"'" } else { "" }

# MIR optimisation level (defaults to 2, bring it up to 4 for release builds)
rustc-miropt := if for-release != "" { " -Z mir-opt-level=4" } else { "" }
# **DISABLED because it's buggy**
rustc-miropt := "" # if for-release != "" { " -Z mir-opt-level=4" } else { "" }

# Use rust-lld that is bundled with rustup to speedup linking
# and support for icf=safe.
Expand All @@ -95,13 +96,13 @@ rustc-miropt := if for-release != "" { " -Z mir-opt-level=4" } else { "" }
#
# If cargo-zigbuild is used, then it will provide the lld linker.
# This option is disabled on windows since it not supported.
rust-lld := if use-cargo-zigbuild != "" {
""
} else if target-os != "windows" {
" -Z gcc-ld=lld"
} else {
""
}
rust-lld := "" #if use-cargo-zigbuild != "" {
#""
#} else if target-os != "windows" {
#" -Z gcc-ld=lld"
#} else {
#""
#}

# ICF: link-time identical code folding
#
Expand Down Expand Up @@ -130,7 +131,7 @@ target-glibc-ver-postfix := if glibc-version != "" {
}

cargo-build-args := (if for-release != "" { " --release" } else { "" }) + (" --target ") + (target) + (target-glibc-ver-postfix) + (cargo-buildstd) + (if extra-build-args != "" { " " + extra-build-args } else { "" }) + (cargo-no-default-features) + (cargo-split-debuginfo) + (if cargo-features != "" { " --features " + cargo-features } else { "" }) + (win-arm64-ring16)
export RUSTFLAGS := "-Z share-generics " + (linker-plugin-lto) + (rustc-gcclibs) + (rustc-miropt) + (rust-lld) + (rustc-icf)
export RUSTFLAGS := (linker-plugin-lto) + (rustc-gcclibs) + (rustc-miropt) + (rust-lld) + (rustc-icf)


# libblocksruntime-dev provides compiler-rt
Expand All @@ -147,15 +148,17 @@ ci-install-deps:
ci-install-deps:

toolchain components="":
rustup toolchain install nightly {{ if components != "" { "--component " + components } else { "" } }} --no-self-update --profile minimal
{{ if ci != "" { "rustup default nightly" } else { "rustup override set nightly" } }}
rustup toolchain install stable {{ if components != "" { "--component " + components } else { "" } }} --no-self-update --profile minimal
{{ if ci != "" { "rustup default stable" } else { "rustup override set stable" } }}
{{ if target != "" { "rustup target add " + target } else { "" } }}


build:
echo "env RUSTFLAGS=$RUSTFLAGS"
{{cargo-bin}} build {{cargo-build-args}}

check:
echo "env RUSTFLAGS=$RUSTFLAGS"
{{cargo-bin}} check {{cargo-build-args}}

get-output file outdir=".":
Expand All @@ -167,7 +170,7 @@ get-binary outdir=".": (get-output output-filename outdir)
-chmod +x {{ outdir / output-filename }}

e2e-test file *arguments: (get-binary "e2e-tests")
cd e2e-tests && bash {{file}}.sh {{output-filename}} {{arguments}}
cd e2e-tests && env -u RUSTFLAGS bash {{file}}.sh {{output-filename}} {{arguments}}

e2e-test-live: (e2e-test "live")
e2e-test-manifest-path: (e2e-test "manifest-path")
Expand Down