From 1bb710980415b66d7a530b0106cf7dcb7c47ea50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Gonz=C3=A1lez?= Date: Wed, 7 Aug 2024 20:50:56 +0200 Subject: [PATCH] Another AArch64 Linux musl build fix attempt After testing more thoroughly on my box, it turned out that the libgcc linking workaround should indeed fix our build errors, but on CI that did not happen because the `RUSTFLAGS` environment variable is set, which takes precedence over any configuration at `.cargo/config.toml`. Therefore, let's also add the workaround to `RUSTFLAGS` on the CI workflow definition. This should be a satisfactory enough stopgap solution that does not require ourselves to be pinned to a specific nightly or drop these builds until https://github.com/rust-lang/rust/issues/128401 is sorted out. --- .cargo/config.toml | 5 +++++ .github/workflows/oxipng.yml | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index aea7314b..516338ce 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -16,4 +16,9 @@ linker = "aarch64-linux-musl-gcc" # user-visible impacts on the final executables. See: # https://github.com/rust-lang/rust/issues/46651 # https://github.com/rust-lang/compiler-builtins/issues/201 +# https://github.com/rust-lang/rust/issues/128401 (the issue most relevant to +# our observed failures) +# Note that these flags are not enforced on CI because CI overrides them through +# the RUSTFLAG environment variable. Check out the CI workflow definition file at +# .github/workflows/oxipng.yml for more info rustflags = ["-Clink-args=-lgcc"] diff --git a/.github/workflows/oxipng.yml b/.github/workflows/oxipng.yml index 72626c99..1f7a9664 100644 --- a/.github/workflows/oxipng.yml +++ b/.github/workflows/oxipng.yml @@ -55,7 +55,9 @@ jobs: env: CARGO_BUILD_TARGET: ${{ matrix.target }} - RUSTFLAGS: -Zlocation-detail=none + # Hopefully temporary workaround for https://github.com/rust-lang/rust/issues/128401 + # See the comments for similar rustflag settings at .cargo/config.toml for more context + RUSTFLAGS: ${{ matrix.target == 'aarch64-unknown-linux-musl' && '-Zlocation-detail=none -Clink-args=-lgcc' || '-Zlocation-detail=none' }} steps: - name: Checkout source