fix(simulator): prevent AppleDouble metadata in cached .app tarballs#28
Open
janodetzel wants to merge 1 commit into
Open
Conversation
macOS BSD tar embeds extended attributes (set by xcodebuild on built artifacts) as AppleDouble "._*" entries inside the tarball unless COPYFILE_DISABLE=1 is set. When consumers extract the cached tarball without macOS BSD tar's AppleDouble self-healing (e.g. node-tar via `rock run:ios`, or any non-Apple tar implementation), `._*` files materialize on disk. `simctl install` then walks PlugIns/ and treats `._WidgetExtension.appex` as a real app extension, failing with: IXErrorDomain code=2: Failed to create app extension placeholder This affects every app with an app extension or widget that uses this action's simulator cache. - Set COPYFILE_DISABLE=1 on the simulator-build `tar -czvf` so newly produced cache artifacts are clean. - Set COPYFILE_DISABLE=1 on the re-sign repack as well.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The simulator-build step packages the built
.appwith macOS BSDtar:https://github.com/callstackincubator/ios/blob/main/action.yml#L377-L385
On a macOS runner, BSD
tarencodes every extended attribute on the input files as a sibling AppleDouble (._*) entry inside the tarball, unlessCOPYFILE_DISABLE=1is set.xcodebuildleaves xattrs (com.apple.*) on practically every artifact it produces, so the cached tarball ends up full of._*files.When a consumer downloads the cached artifact and extracts it with an implementation that does not have BSD
tar's built-in AppleDouble self-healing — e.g. node-tar (used byrock run:ios),bsdtaron Linux, GNUtar, or anything else — those._*files materialize as real files on disk.simctl installthen walksMyApp.app/PlugIns/*and treats every entry as an app extension.For any app that has app extensions or widgets, this fails:
The bug is invisible inside this action's own end-to-end CI because macOS BSD
tar's extract step silently reattaches._*entries as xattrs instead of materializing them as files. It only surfaces when a non-BSD-tar consumer enters the picture.Reproducer: any RN project with a widget/share/notification extension that uses this action to cache simulator builds, then consumes the cache via
rock run:ios --destination simulator.Fix
COPYFILE_DISABLE=1to thetar -czvfin Find Build Artifact (simulator branch) so new caches don't contain._*entries.COPYFILE_DISABLE=1to thetar -czfin Repack APP into tar.gz (re-sign flow) for the same reason.Equivalent alternatives would be
tar --no-xattrs(BSD tar) ortar --no-mac-metadata(libarchive ≥ 3.7), butCOPYFILE_DISABLE=1is the most widely portable and matches Apple's own guidance.No extract-side changes are needed: existing poisoned tarballs in cache are handled correctly by macOS BSD
tar's self-healing on the runner during the re-sign flow, and will age out of cache naturally once this fix lands.Scope
action.yml. No behavior change for caches that were already clean.devicedestination) is untouched —.ipais produced viaxcodebuild -exportArchive, nottar, so this bug doesn't apply there.Test plan
.appcontaining aPlugIns/WidgetExtensionExtension.appexwith this fix applied locally; the resulting tarball contains zero._*entries (verified withtar -tzf | grep '\._').rock run:ios --destination simulator), the app installed and launched successfully.IXErrorDomain code=2failure quoted above.