This currently no longer applies, because we might sometimes need an
older `setuptools` than the one shipped with a Python formula.
This is needed for Homebrew/homebrew-core#93964.
When building Rust packages that provide libraries but no executable
binaries, `cargo install` doesn't do anything; you need to use `cargo
build` and install any libraries manually. See e.g.
rust-lang/cargo#8294.
Unfortunately, Homebrew's Rubocop "use cargo install *std_cargo_args"
rule, as currently written, blocks all invocations of `cargo build`.
This commit changes that rule to exclude invocations of `cargo build`
that use the `--lib` argument (`--lib` specifies to Cargo that a
package's library targets should be built). This will enable library
packages to be built while retaining the "use cargo install
*std_cargo_args" message for the more common case when a Rust package
provides executable binaries.
PyOxidizer downloads pre-built versions of Rust and Python, and embeds
this Python into the binaries it produces.
This goes against a number of our packaging policies, so let's make sure
formulae in Homebrew/core don't do this.
See Homebrew/homebrew-core#90025.
It makes more sense to use the unversioned formulae with `uses_from_macos`
because macOS isn't shipping multiple versions of this.
If you wish to e.g. pin to a specific version you can do that by specifying the
dependency directly in an `os_linux` block.
Recommend the use of `on_macos` and `on_linux` unless we're in
`def install`, `def post_install` or `test do` in which case recommend
`OS.mac?` and `OS.linux?` instead.
Only `.diff` URLs return output comparable to the diffs from
`git diff --full-index`. While the extra metadata from `.patch` is
nice, the instability of the patch contents is undesirable.
Co-Authored-By: Carlo Cabrera <30379873+carlocab@users.noreply.github.com>
- The autocorrections here before were leading to changes like:
```
➜ brew style --fix brewsci/science/beetl
Formula/beetl.rb:15:11: C: [Corrected] GitHub patches should use the full_index parameter: https://github.com/BEETL/BEETL/commit/ba47b6f9.patch?full_index=1
url "https://github.com/BEETL/BEETL/commit/ba47b6f9.patch"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
➜ git diff
diff --git a/Formula/beetl.rb b/Formula/beetl.rb
index bbd049aa..7ec6d7bc 100644
--- a/Formula/beetl.rb
+++ b/Formula/beetl.rb
@@ -12,7 +12,7 @@ class Beetl < Formula
# Fixes "error: 'accumulate' is not a member of 'std'"
# Upstream commit "Little fix for compilation on mac"
patch do
- url "https://github.com/BEETL/BEETL/commit/ba47b6f9.patch"
+ url https://github.com/BEETL/BEETL/commit/ba47b6f9.patch?full_index=1
sha256 "63b67f3282893d1f74c66aa98f3bf2684aaba2fa9ce77858427b519f1f02807d"
end
end
```
- This fixes the URLs generated to have quotes:
```
➜ git diff
diff --git a/Formula/beetl.rb b/Formula/beetl.rb
index bbd049aa..7ec6d7bc 100644
--- a/Formula/beetl.rb
+++ b/Formula/beetl.rb
@@ -12,7 +12,7 @@ class Beetl < Formula
# Fixes "error: 'accumulate' is not a member of 'std'"
# Upstream commit "Little fix for compilation on mac"
patch do
- url "https://github.com/BEETL/BEETL/commit/ba47b6f9.patch"
+ url "https://github.com/BEETL/BEETL/commit/ba47b6f9.patch?full_index=1"
sha256 "63b67f3282893d1f74c66aa98f3bf2684aaba2fa9ce77858427b519f1f02807d"
end
end
```