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

unpack_strategy: fix unpack Dir.mktmpdir group #18548

Merged
merged 1 commit into from
Oct 14, 2024
Merged

Conversation

cho-m
Copy link
Member

@cho-m cho-m commented Oct 11, 2024

  • 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?

Otherwise the files will be unpacked with group wheel on macOS which gets copied over when running cp -al.

This used to be implicitly "fixed" due to cp -pR usage which would recreate the files.

After #18497, files that are copied via cp -al retain wheel group, which isn't what we want.

Was exploring another alternative in #18518 but this seems like cleaner option.


Probably should move the logic to utils/ or somewhere else that can be shared to avoid code duplication. Perhaps a follow up as would be good to avoid current bottles getting installed as wheel group.

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.

Thanks @cho-m! Good to go once error message improved.

Library/Homebrew/unpack_strategy.rb Outdated Show resolved Hide resolved
Otherwise the files will be unpacked with group wheel on macOS which
gets copied over when running `cp -al`.
@cho-m
Copy link
Member Author

cho-m commented Oct 13, 2024

Also exploring a way to avoid duplication in #18560 by modifying Mktemp. If that goes in, can just run Mktemp.new("homebrew-unpack").run(chdir: false)

@Bo98
Copy link
Member

Bo98 commented Oct 14, 2024

Will merge this for now given it's regression fix.

@Bo98 Bo98 merged commit 7067260 into master Oct 14, 2024
27 checks passed
@Bo98 Bo98 deleted the unpack_strategy-group-fix branch October 14, 2024 06:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants