Skip to content

Commit

Permalink
Another AArch64 Linux musl build fix attempt
Browse files Browse the repository at this point in the history
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 rust-lang/rust#128401 is sorted
out.
  • Loading branch information
AlexTMjugador committed Aug 7, 2024
1 parent e2d58c1 commit 1bb7109
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
4 changes: 3 additions & 1 deletion .github/workflows/oxipng.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1bb7109

Please sign in to comment.