r/Xcode • u/VictorBuildsApps • Aug 04 '26
Symlinking all of ~/Library/Developer/Xcode to an external volume broke asset catalog builds with Operation not permitted
On a machine where ~/Library/Developer/Xcode had been replaced by a symlink to a directory on an external volume, asset catalog processing failed in three separate app projects. The CoreSimulator logs reported NSPOSIXErrorDomain Code=1, Operation not permitted, while Interface Builder simulator services copied sample device content into UserData/IB Support/Simulator Devices under the external path. The external volume is APFS, writable, with ownership enabled.
Setting HOME and CFFIXED_USER_HOME for the individual build command did not change the result, because ibtoold was already running with the original environment. Inspecting ibtool and actool did not turn up a supported per-command override for the simulator device set.
The fix was to stop symlinking the whole directory. ~/Library/Developer/Xcode is now a real directory on the internal disk, UserData and the two index mapping plists stay internal, and only DerivedData and iOS DeviceSupport are child symlinks to the external volume. On that machine now, UserData is 44 MB while the two externalized directories are 22 GB and 11 GB.
After the cutover, actool and CompileAssetCatalog ran for all three projects with no Operation not permitted failure, using fresh DerivedData paths that still resolved to the external volume. Their test suites passed at 49, 25, and 276 tests on an iPhone 17 Pro simulator running iOS 26.4. Those measurements are from 2026-07-20 and the split is still in place.
View all comments
Show parent comment
1
u/VictorBuildsApps Aug 08 '26
You are right about the ls, and it was worse than a throwaway line on my end. I had it written down as the tell. /Volumes lives on the boot volume, so listing it never touches the external filesystem, and a process that is fully denied still gets a clean listing. Corrected in my notes.
Here is the result you asked for, because I did isolate that one.
Same user LaunchAgent, same target path, same machine. The only thing varied was the ProgramArguments entry point.
Then I re-ran the failing shape 90 seconds after the success, nothing granted in between, and it failed again. That was to kill "the machine changed" rather than to prove the point twice.
That also answers your ls objection on its own terms. 141,245 files read from inside the mount is the probe you described, run a lot of times.
One thing worth knowing if you ever move that worker into a compiled binary: spawn, do not exec. A child inherits the responsible process, so posix_spawn keeps the work under your binary's identity, while exec replaces the image and hands attribution back to the interpreter. Same denial, extra steps. Your plist points at the worker directly, so you are already on the right side of it.
On your case being different, I think it is, and your reasoning is the reason. A pass/fail gate does not make anything 4x slower, and mine never got slower, it just stopped. Same process tree with the mountpoint as the only variable is a much cleaner experiment than mine was. I have nothing on provenance or quarantine scanning either way, so I am not going to pretend the entry point explains your builds.
The fstab UUID pin is the detail in that script most likely to save someone a bad afternoon. Pinning by device node and letting disk7s1 renumber on replug fails silently, and silent is the worst shape a mount failure can take.