Skip to content

Conversation

@vszakats
Copy link
Member

@vszakats vszakats commented Nov 8, 2024

As discovered earlier, Homebrew gcc is built against a specific Apple
SDK version and doesn't work when matched up with a different version,
e.g. the one advertised as default by the macos runner image.

Before this patch this was resolved with brute force by zapping the
hack-layer gcc component to avoid the bad interference. This worked
for us, but it's fragile, accidental and doesn't translate to
real-world build environments. Thus, impractical.

Avoid this by explicitly selecting the SDK version gcc was built for and
meant to be used with, as shown by gcc --print-sysroot.

It assumes that the gcc binaries preinstalled on the runner images
always ship with the SDK version they reference. It also assumes
this works with and without brew update.

Also:

  • add 4 quick build-only jobs to test all gcc/macos combos.
  • list SDKs offered via CommandLineTools.

Suggested-by: Bo Anderson
Ref: Homebrew/homebrew-core#194778 (comment)

Follow-up to c349bd6 #14097

As discovered earlier, Homebrew gcc is built against a specific Apple
SDK and doesn't work when matched up with a different SDK, e.g. the
one advertised as default by the macos runner image.

Before this patch this was resolved with brute force by zapping the
hack-layer gcc component to avoid the bad interference. This worked
for us, but it's fragile, accidental and doesn't translate to any
real-world build environment. Thus, impractical.

This patch avoids this by explicitly configuring the SDK gcc was built
for and meant to be used with.

It assumes that the gcc binaries preinstalled on the runner images
always ship with the SDK version they reference. It's non-trivial to
guarantee that given the different build/release/update cycles of the
projects involved, but since this is the only officially supported
way to use them, hopefully this is ensured to be kept in sync.
Since we don't do `brew update`, there is emphasis on preinstalled.

In curl-for-win CI jobs we do `brew update` and expect that scenario
to work too.

Follow-up to c349bd6 curl#14097
@vszakats vszakats added build CI Continuous Integration appleOS specific to an Apple operating system labels Nov 8, 2024
@vszakats vszakats changed the title GHA/macos: make gcc dictate the configured SDK GHA/macos: make gcc dictate the configured Apple SDK Nov 8, 2024
@vszakats vszakats changed the title GHA/macos: make gcc dictate the configured Apple SDK GHA/macos: let gcc dictate the configured Apple SDK Nov 8, 2024
@vszakats vszakats force-pushed the gha-mac-gcc-reshuffle branch 2 times, most recently from 9b0e81d to 71c6b87 Compare November 8, 2024 02:12
@vszakats vszakats closed this in 4d8ab1f Nov 8, 2024
@vszakats vszakats deleted the gha-mac-gcc-reshuffle branch November 8, 2024 09:49
pps83 pushed a commit to pps83/curl that referenced this pull request Apr 26, 2025
As discovered earlier, Homebrew gcc is built against a specific Apple
SDK version and doesn't work when matched up with a different version,
e.g. the one advertised as default by the macos runner image.

Before this patch this was resolved with brute force by zapping the
hack-layer gcc component to avoid the bad interference. This worked
for us, but it's fragile, accidental and doesn't translate to
real-world build environments. Thus, impractical.

Avoid this by explicitly selecting the SDK version gcc was built for and
meant to be used with, as shown by `gcc --print-sysroot`.

It assumes that the gcc binaries preinstalled on the runner images
always ship with the SDK version they reference. It also assumes
this works with and without `brew update`.

Also:
- add 4 quick build-only jobs to test all gcc/macos combos.
- list SDKs offered via CommandLineTools.

Suggested-by: Bo Anderson
Ref: Homebrew/homebrew-core#194778 (comment)

Follow-up to c349bd6 curl#14097
Closes curl#15518
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

appleOS specific to an Apple operating system build CI Continuous Integration

Development

Successfully merging this pull request may close these issues.

1 participant