Skip to content

Commit

Permalink
CI: Add release build for x86h-apple-darwin
Browse files Browse the repository at this point in the history
and re-enable build-std for all release builds which also add back
split-debuginfo.

Signed-off-by: Jiahao XU <[email protected]>
  • Loading branch information
NobodyXu committed Jul 31, 2023
1 parent d5549ce commit 8aa014e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
matrix:
include:
- { o: macos-latest, t: x86_64-apple-darwin, r: true }
- { o: macos-latest, t: x86_64h-apple-darwin, r: true }
- { o: macos-latest, t: aarch64-apple-darwin }
- { o: ubuntu-latest, t: x86_64-unknown-linux-gnu, g: 2.17, r: true, c: true }
- { o: ubuntu-latest, t: armv7-unknown-linux-gnueabihf, g: 2.17, c: true }
Expand All @@ -47,6 +48,7 @@ jobs:
JUST_USE_CARGO_ZIGBUILD: ${{ matrix.c }}
JUST_FOR_RELEASE: true
JUST_USE_AUDITABLE: true
JUST_BUILD_STD: true

steps:
- uses: actions/checkout@v3
Expand Down
22 changes: 15 additions & 7 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ override-features := env_var_or_default("JUST_OVERRIDE_FEATURES", "")
glibc-version := env_var_or_default("GLIBC_VERSION", "")
use-auditable := env_var_or_default("JUST_USE_AUDITABLE", "")
timings := env_var_or_default("JUST_TIMINGS", "")
build-std := env_var_or_default("JUST_BUILD_STD", "")

export BINSTALL_LOG_LEVEL := if env_var_or_default("RUNNER_DEBUG", "0") == "1" { "debug" } else { "info" }
export BINSTALL_RATE_LIMIT := "30/1"
Expand Down Expand Up @@ -55,9 +56,11 @@ 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 build-std != "" {
" -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort"
} else if target == "x86_64h-apple-darwin" {
" -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 @@ -190,10 +193,15 @@ ci-install-deps:
[windows]
ci-install-deps:

toolchain components="":
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 { "" } }}
toolchain-name := if cargo-buildstd != "" { "nightly" } else { "stable" }
# x86_64h-apple-darwin does not contain pre-built libstd, instead we will
# install x86_64-apple-darwin with rust-src and use build-std to build it.
target-name := if target == "x86_64h-apple-darwin" { "x86_64-apple-darwin" } else { target }
default-components := if cargo-buildstd != "" { "rust-src" } else { "" }

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

print-env:
@echo "env RUSTFLAGS='$RUSTFLAGS', CARGO='$CARGO'"
Expand Down

0 comments on commit 8aa014e

Please sign in to comment.