Skip to content

Cleanup old shims and cccfg flags#21807

Merged
MikeMcQuaid merged 1 commit intomainfrom
cccfg-cleanup
Mar 23, 2026
Merged

Cleanup old shims and cccfg flags#21807
MikeMcQuaid merged 1 commit intomainfrom
cccfg-cleanup

Conversation

@Bo98
Copy link
Copy Markdown
Member

@Bo98 Bo98 commented Mar 23, 2026

  • Remove apr-1-config shim. It was for system apr-1-config and that was removed from I think macOS 10.12.
  • Remove a cccfg that was for apr-1-config.
  • Replace ant shim with one that only tries non-system executables as /usr/bin/ant was removed in OS X 10.9. Maybe we can remove it entirely or move it to be cross-OS but I took the cautious approach in this PR.
  • Remove o cccfg as it is now unconditionally set on macOS and we only read it in ldflags_mac in the shim anyway. The effect it activated remains always activated on macOS.
  • Move some append_to_cccfg to determine_cccfg to be more consistent and a bit clearer
  • Deprecate ENV.no_fixup_chains
    • For the superenv, it has been set by default for some time so having an API to set it is pointless. It also was a confusing API as it wouldn't actually add anything to LDFLAGS most of the time.
      • The underlying effect remains activated by default as before.
    • For the stdenv, it behaved inconsistently with how the superenv equivalent worked.
  • Deprecate ENV.no_weak_imports
    • Nothing seems to use it anymore and it doesn't make sense to special-case given you could just add it to LDFLAGS if you need it.
    • Deprecating the above two ENV functions means that there will be no longer be any macOS-specific public ENV API extensions. Everything else is available on both macOS and Linux.
  • Move ENV.[...]_support? methods to be private. Hopefully nothing used these as I don't think they were intended to be public API?
  • Fix a few comments.

Copilot AI review requested due to automatic review settings March 23, 2026 06:48
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR cleans up legacy macOS superenv shims/cccfg behavior and refactors macOS ENV configuration to remove obsolete flags and tighten API surface.

Changes:

  • Remove the apr-1-config shim and the associated a cccfg flag.
  • Make -oso_prefix behavior unconditional (subject to existing configure/debug-symbol guards) and replace the ant shim to avoid relying on /usr/bin/ant.
  • Move macOS superenv cccfg setup into determine_cccfg, and make ENV.*_support? helpers private; add deprecation notes for macOS-specific ENV APIs.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
Library/Homebrew/shims/super/cc Makes -oso_prefix application independent of the o cccfg flag.
Library/Homebrew/shims/mac/super/apr-1-config Removes the legacy apr-1-config shim entirely.
Library/Homebrew/shims/mac/super/ant Updates shim to exec only non-system ant binaries via shared shim utilities.
Library/Homebrew/extend/os/mac/extend/ENV/super.rb Refactors cccfg determination and broadens Sonoma iconv configure workaround.
Library/Homebrew/extend/os/mac/extend/ENV/std.rb Adds notes about deprecating macOS-specific ENV helpers in stdenv.
Library/Homebrew/extend/os/mac/extend/ENV/shared.rb Makes *_support? helper methods private.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@carlocab carlocab requested a review from cho-m March 23, 2026 06:57
Copy link
Copy Markdown
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lovely cleanup, thanks @Bo98!

@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Mar 23, 2026
Merged via the queue into main with commit 787eb62 Mar 23, 2026
44 checks passed
@MikeMcQuaid MikeMcQuaid deleted the cccfg-cleanup branch March 23, 2026 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants