Skip to content

Load legacy formula DSL in history walks - #24131

Merged
p-linnane merged 1 commit into
mainfrom
advisory-historical-loader-compatibility-v2
Sep 30, 2026
Merged

p-linnane merged 1 commit into
mainfrom
advisory-historical-loader-compatibility-v2

Conversation

@p-linnane

Copy link
Copy Markdown
Contributor

Advisory history reconciliation needs every revision of a formula to load on all four simulated platforms. Obsolete DSL made many older revisions unloadable, and on macOS the Linux legs only loaded revisions using MacOS by reading the host.

In advisory walks, MacOS.version and retired on_system releases now answer from the simulated target, with Linux getting the historical NULL answers. Other callers keep the host MacOS API. Undated deprecate!/disable!, build.include?, bottle prefix, cxxstdlib_check, ScriptFileFormula and StrictSubversionDownloadStrategy also load. Anything else still fails closed.

107 of 112 previously unloadable core revisions now load on all four platforms, on macOS and Linux.


  • Have you followed our Contributing guidelines?
  • Have you checked for other open Pull Requests for the same change?
  • Have you explained what your changes do? Performance claims (e.g. "this is faster") must include brew benchmark results.
  • Have you explained why you'd like these changes included, not just what they do?
  • For bug fixes, have you given step-by-step brew commands to reproduce the bug?
  • Have you written new tests (excluding integration tests)? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) locally?

  • I did not use AI/LLM to create this PR, or I disclosed the tool/model below and reviewed its output; I did not attribute commits to AI and will answer maintainer questions and review comments myself without AI/LLM.

Claude Code (Opus 5.5) drafted the implementation and tests; I reviewed the diff, verified the new tests fail without the change and pass with it, and ran brew lgtm --online plus targeted specs on macOS and Linux.


Signed-off-by: Patrick Linnane <patrick@linnane.io>
Copilot AI lite review requested due to automatic review settings September 30, 2026 01:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🔵 Needs a closer look

The changes require final human review because they are too complex or risky for automated approval.

Review effort: Lite
Findings: None

What changed in this PR

Updates advisory history loading so legacy formula DSL evaluates against simulated platforms while preserving host behaviour elsewhere.

Changes:

  • Adds simulated macOS/Linux historical API handling.
  • Supports additional obsolete DSL constructs.
  • Updates history and formula-version tests.
File Description
Library/​Homebrew/​vulns/​history.rb Updated as part of this pull request.
Library/​Homebrew/​test/​vulns/​history_spec.rb Updated as part of this pull request.
Library/​Homebrew/​test/​formula_versions_spec.rb Updated as part of this pull request.
Library/​Homebrew/​test/​dev-cmd/​generate-vulns-advisories_spec.rb Updated as part of this pull request.
Library/​Homebrew/​formula_versions.rb Updated as part of this pull request.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@p-linnane
p-linnane added this pull request to the merge queue Sep 30, 2026
Merged via the queue into main with commit 7cce6ea Sep 30, 2026
83 of 84 checks passed
@p-linnane
p-linnane deleted the advisory-historical-loader-compatibility-v2 branch September 30, 2026 02:08
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

⌂ 换网址