-
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
move dev-cmd/bottle
methods to extend/os
#14479
move dev-cmd/bottle
methods to extend/os
#14479
Conversation
dev-cmd/bottle
methods to extend/os
def setup_tar_and_args!(args, mtime) | ||
# Without --only-json-tab bottles are never reproducible | ||
default_tar_args = ["tar", [].freeze].freeze | ||
return default_tar_args unless args.only_json_tab? | ||
|
||
# Ensure tar is set up for reproducibility. | ||
# https://reproducible-builds.org/docs/archives/ | ||
gnutar_args = [ | ||
"--format", "pax", "--owner", "0", "--group", "0", "--sort", "name", "--mtime=#{mtime}", | ||
# Set exthdr names to exclude PID (for GNU tar <1.33). Also don't store atime and ctime. | ||
"--pax-option", "globexthdr.name=/GlobalHead.%n,exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime" | ||
].freeze | ||
|
||
["tar", gnutar_args].freeze | ||
end | ||
|
||
def formula_ignores(f) |
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.
Nice work! I think both these methods would ideally call the existing ones first e.g. with the alias generic_setup_tar_and_args! setup_tar_and_args!
patterns you can see used elsewhere. Shout if you want help with that!
|
||
# Ensure tar is set up for reproducibility. | ||
# https://reproducible-builds.org/docs/archives/ | ||
gnutar_args = [ |
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.
I think it'd be good to share this method too given it's the same? Could add a new gnutar_args
method to bottle.rb
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.
Looks great, nice work @hyuraku! Waiting until 4.0.0 to merge.
@hyuraku unfortunately this seems to have broken bottling on Linux: https://github.com/Homebrew/brew/actions/runs/4112820830/jobs/7102214084#step:4:37 |
I'll look into it. |
9facab0
to
10d4f06
Compare
Thanks again @hyuraku! |
This broke bottle reproducibility. Homebrew/homebrew-core#122739 (comment) |
@carlocab Thanks for the heads up. For future reference: feel free to just insta-revert. |
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?move methods in
dev-cmd/bottle
to extend/os because of#todo
.