Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add workaround for macOS archive xattrs (#2504)
This commit introduces a workaround for an issue with .tar archives created with libarchive on Darwin/macOS. When encountering a file that has extended attributes, such as the com.apple.provenance attribute, it will add a corresponding AppleDouble file with the prefix "._" in the same directory. Because these files have the same filename otherwise, the buf tool will see these when they correspond to proto files and subsequently fail to parse them as protobuf IDL. Due to the fact that libarchive is used by default with the version of tar that ships with macOS, and the provenance extended attribute is set by macOS under many conditions when SIP is enabled, archives with these files are likely to occur on macOS. .zip archives created by libarchive do not seem to have this issue. However, .zip archives created by Archive Utility.app have a very similar behavior when encountering extended attributes: it will place AppleDouble files in a separate directory tree under the MACOSX directory, but also with the "._" prefix. Since this can be handled by the same logic, this behavior is extended to ZIP files as well. Closes #2387.
- Loading branch information