Repository navigation
shims/super/cc: Keep dependency -L flags ahead of superenv paths - #23821
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused implementation correctly preserves explicit linker ordering and includes regression coverage.
Pull request overview
Preserves formula-defined linker search precedence in the cc shim.
Changes:
- Keeps explicit
-Lflags that overlap with superenv library paths. - Adds regression coverage for linker path ordering.
File summaries
| File | Description |
|---|---|
Library/Homebrew/shims/super/cc |
Adjusts library-path deduplication. |
Library/Homebrew/test/shims/super/cc_spec.rb |
Tests explicit path precedence. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
p-linnane
requested changes
Sep 5, 2026
the `cc` shim canonicalises `-L` arguments before deduplicating them against `HOMEBREW_LIBRARY_PATHS`, so an explicit `-L` for a keg-only dependency now matches the shim's own entry and is dropped. The shim then appends its own `-L` flags in dependency-declaration order, and the formula loses control of which directory the linker searches first.
krehel
force-pushed
the
homebrew-ruby-shims-super-cc-fix
branch
from
September 5, 2026 22:43
828356d to
d7b311f
Compare
This was referenced Sep 6, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
the
ccshim canonicalises-Larguments before deduplicating them againstHOMEBREW_LIBRARY_PATHS, so an explicit-Lfor a keg-only dependency now matches the shim's own entry and is dropped. The shim then appends its own-Lflags in dependency-declaration order, and the formula loses control of which directory the linker searches first.brew benchmarkresults.brewcommands to reproduce the bug?brew lgtm(style, typechecking and tests) locally?Fable 5.1 with manual review and testing.
portable-rubysetsXLDFLAGS=-L<portable-libxcrypt>/libto linklibcrypt.astatically, but
glibc@2.13is declared first and shipslibcrypt.so.1. The4.0.6_1 Linux bottles vendored by #23703 link it dynamically, so
brew updatefails on Linux hosts without
libcrypt.so.1(e.g. Fedora):Reproducing
Shipped bottle, on any host with Docker (or use macOS
container):arm64_linux:
d0f04d327063be7ef72703c0e621eca33bc9bf388025d36671758ebac230364dEnd to end on Fedora 44:
brew install --build-from-source portable-rubywithHOMEBREW_NO_INSTALL_FROM_API=1produces abin/rubywith no libcryptdependency. With the shim reverted,
configurefails atcannot compute sizeof (long long)because its-lcrypt-linked test binary cannot loadlibcrypt.so.1.