diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index 142d9ef0..fa497977 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -19,21 +19,22 @@ jobs: fail-fast: false matrix: include: - - { o: macos-latest, t: x86_64-apple-darwin, r: true } - - { o: macos-latest, t: aarch64-apple-darwin } - - { o: ubuntu-20.04, t: x86_64-unknown-linux-gnu, r: true } - - { o: ubuntu-20.04, t: armv7-unknown-linux-gnueabihf, c: true } - - { o: ubuntu-20.04, t: aarch64-unknown-linux-gnu, c: true } - - { o: ubuntu-latest, t: x86_64-unknown-linux-musl, r: true, c: true } - - { o: ubuntu-latest, t: armv7-unknown-linux-musleabihf, c: true } - - { o: ubuntu-latest, t: aarch64-unknown-linux-musl, c: true } - - { o: windows-latest, t: x86_64-pc-windows-msvc, r: true } - - { o: windows-latest, t: aarch64-pc-windows-msvc } + - { o: macos-latest, t: x86_64-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 } + - { o: ubuntu-latest, t: aarch64-unknown-linux-gnu, g: 2.17, c: true } + - { o: ubuntu-latest, t: x86_64-unknown-linux-musl, r: true, c: true } + - { o: ubuntu-latest, t: armv7-unknown-linux-musleabihf, c: true } + - { o: ubuntu-latest, t: aarch64-unknown-linux-musl, c: true } + - { o: windows-latest, t: x86_64-pc-windows-msvc, r: true } + - { o: windows-latest, t: aarch64-pc-windows-msvc } name: ${{ matrix.t }} runs-on: ${{ matrix.o }} env: CARGO_BUILD_TARGET: ${{ matrix.t }} + GLIBC_VERSION: ${{ matrix.g }} JUST_USE_CARGO_ZIGBUILD: ${{ matrix.c }} JUST_FOR_RELEASE: true diff --git a/justfile b/justfile index 543d0251..a79cfb15 100644 --- a/justfile +++ b/justfile @@ -7,6 +7,7 @@ extra-build-args := env_var_or_default("JUST_EXTRA_BUILD_ARGS", "") extra-features := env_var_or_default("JUST_EXTRA_FEATURES", "") default-features := env_var_or_default("JUST_DEFAULT_FEATURES", "") override-features := env_var_or_default("JUST_OVERRIDE_FEATURES", "") +glibc-version := env_var_or_default("GLIBC_VERSION", "") export BINSTALL_LOG_LEVEL := if env_var_or_default("RUNNER_DEBUG", "0") == "1" { "debug" } else { "info" } @@ -99,7 +100,17 @@ rust-lld := if target-os != "windows" { " -Z gcc-ld=lld" } else { "" } # rust-lld. rustc-icf := if for-release != "" { " -C link-arg=-Wl,--icf=safe" } else { "" } -cargo-build-args := (if for-release != "" { " --release" } else { "" }) + (if target != target-host { " --target " + target } else if cargo-buildstd != "" { " --target " + target } else { "" }) + (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) +target-glibc-ver-postfix := if glibc-version != "" { + if use-cargo-zigbuild != "" { + "." + glibc-version + } else { + "" + } +} else { + "" +} + +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 " + (rustc-gcclibs) + (rustc-miropt) + (rust-lld) + (rustc-icf)