Unable to build Xcode projects using SwiftPM in MacPorts sandbox

Ryan Schmidt ryandesign at macports.org
Sun Mar 24 04:19:03 UTC 2024

On Mar 23, 2024, at 23:00, Zero King wrote:
> I think it could be base's sandbox that prevented writes to the home directory, where SwiftPM stores its cache.

If disabling sandboxing in macports.conf makes it work, then your suspicion is probably correct. 

MacPorts sets the HOME environment variable to point to a directory within workpath. It looks like it's ignoring that and trying to write to a subdirectory of the macports user's real home directory, /opt/local/var/macports/home. That would be a bug to file with Apple. It has been a long-standing problem that has affected MacPorts in other ways before. 

More information about the macports-dev mailing list