307 Commits
Author SHA1 Message Date
Mike McQuaid 327a67baf9 Merge pull request #24290 from HaraldNordgren/keep-no-linkage-build-dependencies
Keep outdated `:no_linkage` build dependencies
2026-10-19 14:08:33 +00:00
Bevan KayandSam Ford 655b03d6ac Clarify when to use GithubLatest livecheck
- The "formula/cask uses a release asset" condition read as permission
  to use `GithubLatest` for any GitHub release asset, which wasn't the
  intent; replace it with the cases where `Git` isn't adequate.
- State in both Cookbooks that a `livecheck` block can be omitted when
  a strategy already provides correct versions.
- Replace the `calibre` example's `github_latest` with the cask's
  current `header_match` check so the cookbook doesn't model it.

Co-authored-by: Sam Ford <1584702+samford@users.noreply.github.com>
2026-10-19 18:46:09 +11:00
Harald Nordgren e4bb846a14 Keep outdated :no_linkage build dependencies
- A build dependency that is only run, like `llvm` used as a compiler,
  isn't built against, so its `compatibility_version` doesn't matter.
  Requiring a match makes e.g. `ccache` on Xcode 14 rebuild `llvm` 23
  even though the installed `llvm` 22 can compile it.
- Let formulae tag such build dependencies `:no_linkage`, which
  already means the formula doesn't link against them, and keep them
  when outdated. The dependencies they were built against are still
  checked.
2026-10-18 11:33:45 +02:00
Patrick Linnane a9aa984cb8 Preserve and validate no_linkage metadata
- `Formula#to_hash` dropped `:no_linkage`, so formulae loaded from the
  API lost the linkage expectations `brew linkage` relies on.
- Emit a `no_linkage_dependencies` name list beside the existing string
  arrays and overlay it when loading, keeping older readers working.
- Reject conflicting `:no_linkage` declarations for one dependency
  within a spec and platform at load time, since the overlay is by name.

Signed-off-by: Patrick Linnane <patrick@linnane.io>
2026-10-15 07:38:40 +00:00
Bevan Kay 0e7f70a2bd Unify formula and cask description guidelines
- Move `desc` guidance into a shared `Description-Guidelines` page so
  formulae and casks follow one set of expectations.
- Keep the principle (describe, don't sell) and replace the rigid
  cask-only dos and don'ts with a short list of what to leave out:
  marketing language, feature lists, comparisons with other projects
  and addressing the reader.
- Leave the name and platform rules to `brew style`, which already
  enforces them, so the page only documents what needs judgement.
- Point both cookbooks and the `desc` DSL docs at the new page.
2026-10-14 23:34:49 +11:00
Mike McQuaid 604a7f450c Require test resources in homebrew/core
- Enforce prefetchable test resources during ordinary core style
  checks so fixtures work with test network restrictions.
- Keep this audit scoped to core and land after its resource
  migration; dynamic declarations still need manual changes.
2026-10-08 13:59:40 +01:00
Mike McQuaid 1b0b73c84b Merge pull request #24174 from Homebrew/interactive-fetch-shell
Interactive fetch shell
2026-10-06 15:46:56 +00:00
Mike McQuaid ef89d716f3 Add test-only resources for offline tests
- Fetch test fixtures before sandboxing and stop if any fail so
  dependent tests can run without network access.
- Fetch each tested formula's fixtures alongside its source or bottle
  without fetching fixtures for untested dependencies.
- Offer static resource migration through a strict cop so existing
  taps keep passing ordinary style checks.
- Leave declarations using runtime values for manual migration.
2026-10-06 14:46:58 +01:00
Thierry Moisan c5969ceafb Add interactive fetch phase 2026-10-06 08:55:39 +00:00
Rui Chen 702cc64b18 formula: add std_cargo_fetch_args
Signed-off-by: Rui Chen <rui@chenrui.dev>
2026-09-21 04:23:01 -04:00
AltCode 5ac888db72 Sort fish_completion after zsh_completion 2026-09-20 20:02:03 +02:00
Patrick Linnane fb8809d1ce Reject redundant minimum macOS dependencies
Signed-off-by: Patrick Linnane <patrick@linnane.io>
2026-09-17 07:31:34 -07:00
Noah 1fb37b8d09 Fix typos, grammar and Cachable module name
- Refactor `Cachable` module and filenames to `Cacheable`.
- Fix typos and indefinite articles across docs and tests.
- Update UK English spellings in documentation and descriptions.
- Regenerate shell completions and manpages.
2026-09-13 19:31:21 -05:00
Patrick Linnane 770d206c15 Shorten sandbox temporary directory names
- Nesting build directories under the sandbox directory in #23940 pushed
  gpgme's `gpg-agent` socket path to 112 bytes, beyond libassuan's
  102-byte limit on macOS, so its `make` fails.
- Name sandbox directories `s-` plus eight random characters, which
  brings that path to 93 bytes.

Signed-off-by: Patrick Linnane <patrick@linnane.io>
2026-09-11 23:19:45 -07:00
Mike McQuaid e29632cfe3 Unify sandbox temporary directory handling
- Reuse each sandbox's private directory for temporary files and local
  task-host sockets across fetch, build, test and install operations.
- Share phase environments, cleanup and retention while preserving
  offline restrictions and the existing options for debugging failures.
- Forward retention and debugging options through the Linux wrapper
  so dependency postinstall hooks can start on both platforms.
- Cover private Unix socket communication online and offline and
  private GnuPG agents without requiring a .NET SDK for the tests.
- Keep shared temporary-directory tests independent of platform TTY
  setup and within generic Unix socket path limits.
- Handle absent Java cache options and retain debugging files for
  ordinary errors and interrupts without catching fatal exceptions.
- Preserve parent failures during error-pipe cleanup and synchronise
  the regression check with child readiness.

Fixes #23934
2026-09-11 17:20:35 +01:00
Mike McQuaid a7bb8220a6 Refine macOS sandbox compatibility
- Restore discovery of installed Metal toolchains and process listing
  by allowing the required MobileAsset and sysmond services.
- Check that `brew test` completes without sysmon or pgrep warnings,
  including diagnostics forwarded to stdout during child cleanup.
- Keep local endpoint access explicit while retaining DNS and
  Homebrew's per-run communication channel, including offline runs.
- Prepare each formula's private `testpath` before configuring the
  sandbox so its tests can start and use their own local services.
- Keep cleanup with the parent that creates the test directory while
  preserving retention and leaving borrowed directories intact and
  quiet, including failures before the test starts.
- Use relative socket paths in fixtures to accommodate longer test
  directories, and cover cleanup failures and generated-path retention.
- Cover uncached Metal discovery, child-process discovery, private
  services, HTTP over Unix sockets and install-hook operations.

Fixes #23919
2026-09-10 16:36:51 +01:00
botantony a985c65bbe docs/Formula-Cookbool: fix broken link
Found in
https://github.com/Homebrew/brew/actions/runs/34491581968/job/102919394331

Signed-off-by: botantony <antonsm21@gmail.com>
2026-09-10 16:56:39 +02:00
Mike McQuaid 15069d12a0 Deprecate/disable/remove for major/minor release 2026-09-05 10:38:45 +01:00
Michael Cho 3aca0e970d formula: handle --offline in std_cargo_args 2026-09-03 14:52:20 -04:00
Michael Cho 88e29598fe formula: update cargo fetch example
By default, `cargo fetch` downloads packages for all targets but most
formulae only need native packages so this results in unnecessary
network and file I/O operations.

Arch Linux also runs the same updated command:
- https://wiki.archlinux.org/title/Rust_package_guidelines#Prepare
2026-09-01 11:33:15 -04:00
Patrick Linnane 0fe057e66c docs: document explicit CMake -S/-B arguments
Signed-off-by: Patrick Linnane <patrick@linnane.io>
2026-08-27 22:12:17 -07:00
Mike McQuaid 7dc61504ff Add formula fetch phase run before install
- Cargo, Go, npm and Bundler formulae download dependencies inside
  `install`, so around 2,700 homebrew-core builds need network access
  and cannot be reproduced offline.
- `def fetch` runs first with network access and writable package
  manager caches; when it is defined, `install` then runs offline in
  the same unpacked source with the rest of `HOMEBREW_CACHE` read-only.
- A sandbox cannot be tightened mid-process, so the phases are separate
  `build.rb` runs sharing one staging directory created by the parent.
- `brew fetch --build-from-source` runs `fetch` too so a later
  `brew install` can be fully offline.
2026-08-25 17:35:47 +01:00
Mike McQuaid 8cda0bea67 docs: fix Vale errors
- use `macOS` rather than `Mac` in an `FAQ` heading so it passes
  the sentence-case check
- drop an Oxford comma in `Formula-Cookbook`
2026-08-21 09:36:11 +01:00
Bevan Kay 6af7582df0 install_steps: add must_succeed to run 2026-08-10 11:56:06 +10:00
Mike McQuaid 601472bfda Enforce structured install step authoring
- reject mixing formula install hooks in every tap
- autocorrect legacy step methods and keywords
- retain stable serialised API values for compatibility
- document canonical Formula and Cask step authoring
- remove the resolved Cask sandbox deprecation reminder
2026-08-08 15:06:51 +01:00
Mike McQuaid f38b89391e Use bottled inputs and add RuboCop guard
- Discover CPython wheels already packaged in each keg.
- Expand PyPy bootstrap archives packaged in `libexec`.
- Resolve dependency paths without loading formula source.
- Validate helper executables before attempting to run them.
- Enforce source independence with RuboCop and API-loaded tests.
- Keep the internal JSON API unchanged and minimal.
2026-08-08 08:17:46 +01:00
Mike McQuaid f8fcbd88e0 Sandbox structured cask operations
- Run each complete cask step block in one isolated subprocess and all
  generated completions in another phase-scoped sandbox.
- Share sandbox selection, fork fallback, install-hook rules and child
  error reporting with formula build, post-install and test processes.
- Restrict home, network and filesystem access while preserving `brew`
  and supporting explicit command write paths.
- Keep JSON payloads compact and independent of cask Ruby files.
- Remove the completed official-tap migration plan.
2026-08-07 08:37:09 +01:00
Mike McQuaid 67658c8cf6 Merge pull request #23366 from Homebrew/install-step-26-official-hook-enforcement
Reject official legacy install hooks (26/26)
2026-08-05 11:33:49 +00:00
Andrew Nesbitt fd73448209 Merge branch 'main' into vulns-fix-available-flag 2026-08-05 08:33:53 +01:00
Mike McQuaid 9f3bf077be Reject official legacy install hooks
- block legacy hooks in Homebrew-owned taps
- retain safe autocorrection and third-party compatibility
- reject `brew ruby` steps that enable developer mode
- prepare runtime call sites for next-release deprecation
- verify internal API and runtime DSL coverage
2026-08-04 18:36:46 +01:00
Kyle Marek-Spartz 88746e955d vulns: add --fix-available and --no-fix-available flags 2026-08-01 14:21:14 -05:00
Mike McQuaid dbee8fb6f0 Make formula var bases explicit in docs
- Stop documenting the temporary implicit `var` base for formula steps.
- Update examples to specify their intended path base.
- Record the official-tap migration, RuboCop enforcement and runtime
  default removal as separate follow-up changes.
2026-07-31 20:32:03 +01:00
Mike McQuaid 7e3b7b186f Document canonical install steps
Formula and cask authors need one current reference while released
aliases remain an implementation-only compatibility bridge.

- document shared names, defaults, guards, tokens and command behaviour
- remove compatibility-only methods and values from the cookbooks
- explain ordered coexistence with legacy hooks during tap migration
2026-07-31 17:01:53 +01:00
Mike McQuaid 431a27c15c Add Python bootstrap action
Five CPython and PyPy formulae share packaging bootstrap work that
depends on resources and implementation-specific install layouts.

- rebuild CPython site-packages, pip and wheel links from resources
- safely replace pre-existing Cellar site-packages directories
- preserve writable CPython venv activation templates
- preserve the Python 3.9 compatibility configuration
- stage PyPy resources and links for the required ABI
2026-07-31 09:22:18 +01:00
Mike McQuaid 0e956148e5 Add PHP configuration action
Five PHP formulae share PEAR, PECL and versioned extension configuration
that must be rebuilt after installation.

- preserve PEAR directory traversal and repair stale PECL links
- create the common PECL extension layout from `php-config`
- rewrite versioned opcache paths without changing commented settings
- cover the shared filesystem and command behaviour end to end
2026-07-31 09:22:13 +01:00
Mike McQuaid 04ca847a41 Add explicit dylib ID helpers
- Add a generic Formula helper and serialised install step for changing
  one Mach-O dynamic library ID.
- Require complete source and ID paths while allowing callers to resolve
  a source symlink explicitly.
- Preserve file permissions and codesign modified libraries on Apple
  Silicon.
- Document and audit both public interfaces.
2026-07-30 21:46:43 +01:00
Mike McQuaid 3550b83dee Merge pull request #23347 from Homebrew/document-install-step-interpolation
Document install step interpolation
2026-07-29 17:18:43 +00:00
Mike McQuaid 182da7accd Merge pull request #23190 from Homebrew/install-step-15-clang-system-config
Add Clang system config action (15/24)
2026-07-29 17:04:35 +00:00
Mike McQuaid 095b9cef75 Document install step interpolation
- Distinguish Ruby interpolation from install-time tokens that survive
  JSON serialisation.
- Keep token-producing compatibility helpers valid while rejecting
  arbitrary interpolation.
- Emit explicit install-time tokens from formula autocorrections.
2026-07-29 17:59:20 +01:00
Mike McQuaid 5a2627ba02 Merge pull request #23201 from Homebrew/install-step-14-glibc-runtime
Add glibc runtime action (14/24)
2026-07-29 16:37:47 +00:00
Mike McQuaid b312752fc0 Add Clang system config action
Four LLVM and Clang formulae share macOS target configuration generation
for the active SDK and kernel versions.

- skip non-macOS installs and generated native configurations
- select the current or versioned Command Line Tools SDK
- emit compatible arm64, aarch64 and x86_64 target files
2026-07-27 08:09:53 +01:00
Mike McQuaid 48f5f3f30e Merge pull request #23200 from Homebrew/install-step-13-gzipped-executables
Add gzipped executable action (13/24)
2026-07-27 01:00:20 +00:00
Douglas Eichelberger 29cb5e338a Document service block methods as public API
Annotate every method in the Formula Cookbook's "Service block methods"
table as `@api public` in `Service`, with documentation matching the
cookbook's descriptions, and add the missing `stop_timeout` row to the table.

Enforce a 1:1 correspondence between the table and the `service.rb`
annotations in the `Homebrew/PublicApiCookbook` cop, backed by a new
`SERVICE_COOKBOOK_METHODS` list, so the two cannot drift.

Claude-Session: https://claude.ai/code/session_011BgWRBydtdkvt8ocqH4nj9
2026-07-26 12:16:42 -07:00
Mike McQuaid d39b823008 Add glibc runtime action
Three glibc-family formulae share locale generation and timezone-link
setup with different rules for the legacy variants.

- derive requested locales while always providing the UTF-8 default
- invoke the installed `localedef` with normalised charmaps
- preserve host timezone links when their sources exist
2026-07-26 18:13:19 +01:00
Mike McQuaid a959228644 Add gzipped executable action
Several binary formulae ship a gzipped executable that needs the same
guarded post-install expansion and mode handling.

- resolve serialised source and destination path bases
- skip absent payloads and replace stale expanded sources
- install each executable with an explicit literal permission mode
2026-07-26 18:13:04 +01:00
Mike McQuaid f7c846c323 Merge pull request #23186 from Homebrew/install-step-09-commands
Add constrained install commands (9/24)
2026-07-26 16:05:44 +00:00
Mike McQuaid 40801e75de Merge pull request #23185 from Homebrew/install-step-08-formula-permissions
Allow formula permission steps (8/24)
2026-07-26 15:31:37 +00:00
Mike McQuaid 6ae6def23a Add GCC runtime install action
Eight GCC formulae share the same Linux runtime-link and specs
generation algorithm after installation.

- probe the active GCC and glibc runtime locations
- generate family-appropriate library, linker and header search paths
- keep the repeated algorithm behind one literal formula step
2026-07-26 15:33:29 +01:00
Mike McQuaid 46b43d57d0 Add scoped install step warnings
Some formula hooks only warn when a persistent path needs user attention
and do not need arbitrary post-install code.

- add a literal warning step shared with cask flight phases
- compose warnings with path guards instead of embedded conditions
- expand fixed context tokens in warning messages
2026-07-26 14:24:32 +01:00
Mike McQuaid 2c2089fc74 Add process termination steps
Flight hooks repeatedly stop applications or helpers before mutating
their installed state.

- select processes by exact name or full command line
- serialise attempts, privilege and required-success policies
- preserve fixed user notices and final failure warnings
2026-07-26 14:24:22 +01:00