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
Don't save mac metadata/extended attributes for brew bottle
#15173
Conversation
2c0cfb0
to
f3bcca1
Compare
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.
Thanks for the PR!
Furthermore, with gnu tar, --no-acls and --no-xattrs are default flags.
If they are default: any need to add them here?
4828eda
to
04c73a0
Compare
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.
Great work, almost there!
# Without --only-json-tab bottles are never reproducible | ||
return ["tar", tar_args].freeze unless args.only_json_tab? |
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.
Would be nice to share this with generic if possible. Not sure if it is though 🤔. Feel free to leave it!
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.
It is possible, but I end up with more lines of code and more complicated logic so I guess it is better to leave as is.
This commit includes `--no-mac-metadata` `--no-acls` and `--no-xattrs` in `default_tar_args` for `brew bottle` command. Although `default_tar_args` is only active when `--only-json-tab` is not passed, in which case we don't require reproducible bottles, it is nonetheless beneficial to "regularize" tarball creation. In particular, this resolves a sporadic `brew tests --only=dev-cmd/bottle:20` failure (see https://github.com/orgs/Homebrew/discussions/4376 and Homebrew#14997). Furthermore, with `gnu tar`, `--no-acls` and `--no-xattrs` are default flags. As for "mac metadata", although I couldn't find official documentation, this post (https://superuser.com/a/61188) shares some info: - Resource forks (resource forks have been extended attributes since 10.4) - Custom icons set in Finder and the images of Icon\r files - Metadata in PSD files - Objects stored in scpt files, AppleScript Editor window state, descriptions of scripts - Information about aliases (aliases stop working if extended attributes are removed) - Quarantine status or source URLs of files downloaded from the internet - Spotlight comments - Encoding of files saved with TextEdit - Caret position of files opened with TextMate - Skim notes None of these is supposed to be in the bottle I believe.
04c73a0
to
73a1380
Compare
Thanks again @ywwry66, great work! |
Test failure is irrelevant. |
This commit includes
--no-mac-metadata
--no-acls
and--no-xattrs
indefault_tar_args
forbrew bottle
command.Although
default_tar_args
is only active when--only-json-tab
is not passed, in which case we don't require reproducible bottles, it is nonetheless beneficial to "regularize" tarball creation. In particular, this resolves a sporadicbrew tests --only=dev-cmd/bottle:20
failure (seehttps://github.com/orgs/Homebrew/discussions/4376 and #14997).
Furthermore, with
gnu tar
,--no-acls
and--no-xattrs
are default flags. As for "mac metadata", although I couldn't find official documentation, this post (https://superuser.com/a/61188) shares some info:None of these is supposed to be in the bottle I believe.
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?