- Clarify the comment of why we have SimpleCov special logic for
parallel tests
- use a nicer ParallelTests API for checking which process to output
the coverage format on
Up to now, we haven't been accounting for `#url` symbol arguments in
`livecheck` blocks that don't reference a checkable URL. This can
either be an invalid symbol (e.g., using the `:stable` formula symbol
in a cask) or a valid symbol where the referenced URL doesn't exist
(e.g., using `:head` when there's no `head` URL). [Almost all of the
valid symbols are required URLs but `head` is optional.]
Over the years, we've had a handful of slips where we've used `:url`
in formulae (when it's only valid in casks) and `:stable` in casks
(when it's only valid in formulae). In this scenario,
`livecheck_url_string` is `nil`, so livecheck falls back to
`#checkable_urls`. In this scenario, `stable` and `url` are the first
checkable URLs for formulae and casks (respectively), so the checks
ended up working as expected merely by chance. This isn't obvious in
the output and even the debug output looks normal. It only becomes
apparent that livecheck isn't working as expected if it iterates
through more than one checkable URL before reaching one that works
(not the case in those instances).
With that in mind, this adds an error when a `#url` symbol is used
but it doesn't correspond to a checkable URL. This will account for
both of the mentioned scenarios (invalid symbols and valid ones
referencing a non-existent URL) and prevent livecheck from quietly
proceeding in an unexpected manner.
This is to allow migration of existing users of @@HOMEBREW_PREFIX@@ tag in external patches. Once the automatic
replacement of the tag is in stable branch and existing users are fixed (inreplace calls removed), this commit can be
reverted.
`mv` should preserve hardlinks and allow faster unpack on the same
filesystem. A secondary pass is done with `cp` to copy over attributes
onto any existing directories.
We only run this for nested unpacks as most direct Directory strategy
usage is for repositories where moving files breaks existing code.
This uses `cp -pR` for non-move as some potential user reported issues
could be due to Apple's `cp -l` on specific macOS versions. Can
consider re-adding `cp -l` with better handling for older macOS.
The `curl --head --request GET` causes a full download to happen on
`curl` from 8.7.0 to 8.9.1[^1] which causes poor UX due to slow
Cask downloads that can take almost twice as long as they should.
[^1]: https://github.com/Homebrew/brew/issues/18213
Try running `cp -al` to preserve hardlinks on both macOS and Linux.
If that fails, fall back on `cp -a` which can preserve hardlinks on
Linux (but not macOS) assuming target filesystem supports them.
`Livecheck#preprocess_url` only contains logic for rewriting Git URLs,
so it makes more sense for this code to be part of the `Git` strategy
instead. Outside of better code organization, this saves us from
having to maintain the list of strategies to skip processing (which
is sometimes forgotten when a new strategy is added) and makes it
easier to do something similar in other strategies as needed.
One thing to note is that `Livecheck#preprocess_url` was previously
called on the URL before each strategy's `#match?` method was called.
To maintain the existing behavior, this calls `Git#preprocess_url` in
`Git#match?`. However, we need the processed URL when we use the `Git`
strategy, so we have to call `Git#preprocess_url` again. To avoid
duplicating effort, I've added a `@processed_urls` hash to the `Git`
strategy and have set up `Git#preprocess_url` to cache processed
URLs, so we only do the work once. There may be a better way of
handling it but this seems to work as expected.
We've already disabled installing casks/formulae from URLs and we
regularly tell people not to install from paths so let's just deprecate
this behaviour entirely.
Even Homebrew developers do not need to work this way.
The way we handle boolean environment variables is a bit unfortunate.
For example, setting `HOMEBREW_EVAL_ALL=false` actually enables
`HOMEBREW_EVAL_ALL`.
Let's fix this by deprecating setting boolean environment variables to
common false-y values (`false`, `0`, `nil`, `no`, and `off`) so that we
can later ignore these false-y values when reading boolean environment
variables.
If you have `HOMEBREW_TEMP` set to a longer path (e.g. the user's
private temporary directory rather than `/private/tmp`), Sequoia will
error out on some tests when forking because the path is too long
(> 104 bytes).
To improve this situation let's:
- use a shorter path for `HOMEBREW_TEMP` by appending `/brew-tests` to
the existing `HOMEBREW_TEMP` used outside of tests rather than
creating nested temporary directories
- use the minimal amount of randomness to avoid collisions while
allowing parallel tests
- use `squeeze` to remove any double slashes in the temporary path
We will now build on Ventura (macOS 13) to Sequoia (macOS 15).
Runners for macOS 15-x86_64 will not be allocated by default due to a
lack of appropriate hardware.