Skip to content
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

Merged

Conversation

hyuraku
Copy link
Contributor

@hyuraku hyuraku commented Feb 2, 2023

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

move methods in dev-cmd/bottle to extend/os because of #todo.

@hyuraku hyuraku changed the title move dev-cmd/bottle methods to extend/os move dev-cmd/bottle methods to extend/os Feb 2, 2023
Comment on lines 9 to 15
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)
Copy link
Member

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 = [
Copy link
Member

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

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a 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.

@MikeMcQuaid
Copy link
Member

@hyuraku unfortunately this seems to have broken bottling on Linux: https://github.com/Homebrew/brew/actions/runs/4112820830/jobs/7102214084#step:4:37

@hyuraku
Copy link
Contributor Author

hyuraku commented Feb 7, 2023

@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.

@hyuraku hyuraku force-pushed the apply-extend/os-to-dev-cmd/bottle branch from 9facab0 to 10d4f06 Compare February 7, 2023 14:22
@MikeMcQuaid MikeMcQuaid merged commit e26784f into Homebrew:master Feb 7, 2023
@MikeMcQuaid
Copy link
Member

Thanks again @hyuraku!

@carlocab
Copy link
Member

This broke bottle reproducibility. Homebrew/homebrew-core#122739 (comment)

@MikeMcQuaid
Copy link
Member

@carlocab Thanks for the heads up. For future reference: feel free to just insta-revert.

@github-actions github-actions bot added the outdated PR was locked due to age label Mar 13, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants