superenv: filter out /usr/local on ARM if necessary#10198
Conversation
|
Review period will end on 2021-01-05 at 00:00:00 UTC. |
|
I don't have a strong opinion, but: this could potentially impact people not on ARM. So another option is to restrict to |
People not on ARM but in the same situation (Homebrew not in |
I want this feature for Linux too, please! Thank you, Misty! |
|
I think it's desirable for Linux too. There have probably been already some issues with that, but we never had time to investigate further. On CI it's not a big deal but users building from source might be impacted. I am fine to filter this out for Linux. |
|
Review period ended. |
de7b1aa to
2a33de7
Compare
Removed the |
|
Thanks @mistydemeo! |
brew stylewith your changes locally?brew typecheckwith your changes locally?brew testswith your changes locally?brew manlocally and committed any changes?This improves superenv's build handling on systems which have both an Intel and an Apple Silicon installation of Homebrew side-by-side.
Homebrew has a hardcoded list of paths to reject from build flags like
-Iand-L, set to various prefixes which are known to interfere with Homebrew builds (MacPorts, Boxen Homebrew, etc.). On Apple Silicon, we currently recommend two different prefixes:/usr/localfor Intel, and/opt/homebrewfor Apple Silicon. Users who have two Homebrew installations will see interference between them, specifically when building things using their/opt/homebrewinstallation. Many packages' buildsystems throw-I/usr/local/includeand-L/usr/local/libto the compiler willy-nilly, even if it's not strictly necessary, and this can end up instructing them to try to link against Homebrew-installed x86_64 libraries in/usr/localover the ARM-native versions in/opt/homebrew.This PR updates the path filtering logic to add a new case after the hardcoded paths. If the system is a) macOS, and b) running in a non-
/usr/local, it will filter out/usr/localpaths from flags just like with/opt/localand other similar paths. I've left the behaviour on Linux untouched, under the assumption that if this hasn't come up so far, it either doesn't affect Linux users or it's actually seen as desirable.I've tested one package (qemu) and this fixes a build error on Apple Silicon. I expect this to come up a lot, especially in the period where not all packages have bottles yet.
/cc @sjackman for Linuxbrew opinions