Branch: refs/heads/main
Revision: 0a06b2f7fa87c21eaa4abec8d7fa27bff5e4b914
Author: jabraham17
Link: Adjust macOS homebrew test job to workaround homebrew change by jabraham17 · Pull Request #27649 · chapel-lang/chapel · GitHub
Log Message:
Adjust macOS homebrew test job to workaround homebrew change (#27649 )
A recent homebrew PR broke out CI by disallowing install a formula from
a local path. This PR adjusts the CI to avoid this by opting into the
behavior with HOMEBREW_DEVELOPER=1
The homebrew PR that broke things was
main ← copilot/fix-18371
opened 12:43PM - 11 Aug 25 UTC
This change prevents users from installing formulae and casks from local file pa… ths (e.g., `brew install ./formula.rb`) unless they have `HOMEBREW_DEVELOPER` set. This addresses confusing behavior where local path installations would succeed but then fail during cleanup due to formula name conflicts.
## Problem
Users could install formulae from local paths like:
```bash
brew install --formula --head ./slang.rb
```
This would often lead to confusing errors during cleanup, as demonstrated in the issue where a local `slang.rb` formula would conflict with the existing `s-lang` formula in homebrew-core, causing cleanup to fail with:
```
Error: /opt/homebrew/Cellar/s-lang/HEAD-6e18236 is not a directory
```
## Solution
Modified the `forbid_packages_from_paths?` method in `env_config.rb` to return `true` when:
- `HOMEBREW_FORBID_PACKAGES_FROM_PATHS` is explicitly set, OR
- `HOMEBREW_DEVELOPER` is NOT set (new default behavior)
This leverages the existing infrastructure in formula and cask loaders without requiring changes to the loader logic itself.
## Behavior Changes
- **Regular users**: Cannot install from local paths - installations are rejected with helpful suggestions for similar formulae from official repos
- **Developers**: Can still install from local paths when `HOMEBREW_DEVELOPER=1` is set
- **Explicit override**: `HOMEBREW_FORBID_PACKAGES_FROM_PATHS=1` takes precedence and forbids path installations even in developer mode
## Testing
Added comprehensive tests covering all scenarios:
- Path installation forbidden by default
- Path installation allowed with `HOMEBREW_DEVELOPER=1`
- Explicit `HOMEBREW_FORBID_PACKAGES_FROM_PATHS=1` overrides developer mode
- Both formula and cask path installations work correctly
All existing tests continue to pass, ensuring no regression in normal Homebrew functionality.
Fixes #18371.
> [!WARNING]
>
> <details>
> <summary>Firewall rules blocked me from connecting to one or more addresses</summary>
>
> #### I tried to connect to the following addresses, but was blocked by firewall rules:
>
> - `eu-central-1-1.aws.cloud2.influxdata.com`
> - Triggering command: `/bin/curl --disable --cookie /dev/null --globoff --user-agent Linuxbrew/4.6.0-61-g1ca2e19 (Linux; x86_64 Ubuntu 24.04.2 LTS) curl/8.5.0 --header Accept-Language: en --fail --progress-bar --retry 3 --max-time 3 --header Authorization: Token iVdsgJ_OjvTYGAA79gOfWlA_fX0QCuj4eYUNdb-qVUTrC3tp3JTWCADVNE9HxV0kp2ZjIK9tuthy_teX4szr9A== --header Content-Type: text/plain; charset=utf-8 --header Accept: application/json --data-binary command_run,command=typecheck,ci=true,devcmdrun=true,developer=false options="" 1754916993 --silent --output /dev/null REDACTED` (dns block)
> - Triggering command: `/bin/curl --disable --cookie /dev/null --globoff --user-agent Linuxbrew/4.6.0-61-g1ca2e19 (Linux; x86_64 Ubuntu 24.04.2 LTS) curl/8.5.0 --header Accept-Language: en --fail --progress-bar --retry 3 --max-time 3 --header Authorization: Token iVdsgJ_OjvTYGAA79gOfWlA_fX0QCuj4eYUNdb-qVUTrC3tp3JTWCADVNE9HxV0kp2ZjIK9tuthy_teX4szr9A== --header Content-Type: text/plain; charset=utf-8 --header Accept: application/json --data-binary command_run,command=style,ci=true,devcmdrun=true,developer=false options="--fix" 1754917006 --silent --output /dev/null REDACTED` (dns block)
> - Triggering command: `/bin/curl --disable --cookie /dev/null --globoff --user-agent Linuxbrew/4.6.0-61-g1ca2e19 (Linux; x86_64 Ubuntu 24.04.2 LTS) curl/8.5.0 --header Accept-Language: en --fail --progress-bar --retry 3 --max-time 3 --header Authorization: Token iVdsgJ_OjvTYGAA79gOfWlA_fX0QCuj4eYUNdb-qVUTrC3tp3JTWCADVNE9HxV0kp2ZjIK9tuthy_teX4szr9A== --header Content-Type: text/plain; charset=utf-8 --header Accept: application/json --data-binary command_run,command=install,ci=true,devcmdrun=true,developer=false options="--formula" 1754917104 --silent --output /dev/null REDACTED` (dns block)
>
> If you need me to access, download, or install something from one of these locations, you can either:
>
> - Configure [Actions setup steps](https://gh.io/copilot/actions-setup-steps) to set up my environment, which run before the firewall is enabled
> - Add the appropriate URLs or hosts to the custom allowlist in this repository's [Copilot coding agent settings](https://github.com/Homebrew/brew/settings/copilot/coding_agent) (admins only)
>
> </details>
---
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click [here](https://survey.alchemer.com/s3/8343779/Copilot-Coding-agent) to start the survey.
[Reviewed by @arifthpe ]
Compare: Comparing fd47fb7d6113f5b7e572242cecb5d33eb96760e6...095786d32d428f2a158cf291ede06ff7268878bb · chapel-lang/chapel · GitHub
Diff:
M util/cron/test-homebrew.bash
https://github.com/chapel-lang/chapel/pull/27649.diff