-
-
Notifications
You must be signed in to change notification settings - Fork 13.2k
cargo-outdated 0.15.0 #166955
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cargo-outdated 0.15.0 #166955
Conversation
Signed-off-by: Michael Cho <michael@michaelcho.dev>
|
🤖 An automated task has requested bottles to be published to this PR. |
|
|
||
| def install | ||
| ENV["LIBGIT2_SYS_USE_PKG_CONFIG"] = "1" | ||
| system "tar", "--strip-components", "1", "-xzvf", "cargo-outdated-#{version}.crate" if build.stable? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should just add crate handling to brew I think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could create a subclass of Tar and just let Tar handle all the logic. I don't think there is an official spec of .crate, but currently it looks like a renamed .tar.gz file.
Our UnpackStrategy::from_magic sees it this way:
❯ brew ruby -e 'p UnpackStrategy::from_magic(Pathname("cargo-outdated-0.15.0.crate"))'
UnpackStrategy::TarThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EDIT: Actually was trying subclass of Gzip instead of Tar. Should work with something like:
diff --git a/Library/Homebrew/unpack_strategy.rb b/Library/Homebrew/unpack_strategy.rb
index 3ce46060d3..5a09f314a2 100644
--- a/Library/Homebrew/unpack_strategy.rb
+++ b/Library/Homebrew/unpack_strategy.rb
@@ -13,6 +13,7 @@ module UnpackStrategy
def self.strategies
@strategies ||= [
+ Crate, # Needs to be before Tar
Tar, # Needs to be before Bzip2/Gzip/Xz/Lzma/Zstd.
Pax,
Gzip,
@@ -174,6 +175,7 @@ require "unpack_strategy/bazaar"
require "unpack_strategy/bzip2"
require "unpack_strategy/cab"
require "unpack_strategy/compress"
+require "unpack_strategy/crate"
require "unpack_strategy/cvs"
require "unpack_strategy/directory"
require "unpack_strategy/dmg"
diff --git a/Library/Homebrew/unpack_strategy/crate.rb b/Library/Homebrew/unpack_strategy/crate.rb
new file mode 100644
index 0000000000..6b6216c6b4
--- /dev/null
+++ b/Library/Homebrew/unpack_strategy/crate.rb
@@ -0,0 +1,14 @@
+# typed: true
+# frozen_string_literal: true
+
+require_relative "tar"
+
+module UnpackStrategy
+ # Strategy for unpacking crate archives.
+ class Crate < Tar
+ sig { returns(T::Array[String]) }
+ def self.extensions
+ [".crate"]
+ end
+ end
+end
HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>, where<formula>is the name of the formula you're submitting?brew test <formula>, where<formula>is the name of the formula you're submitting?brew audit --strict <formula>(after doingHOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>)? If this is a new formula, does it passbrew audit --new <formula>?New release needed for #166949