Xcode Cloud + SPM Package Plugin Failure "You don't have permission to save the file..." #5448
Closed
2 tasks done
Labels
integration
Issues related to integration of SwiftLint into toolchains.
New Issue Checklist
Bug
SwiftLint fails to run as a package plugin in Xcode Cloud:
Error: You don’t have permission to save the file “26c6d2....plist” in the folder “4D4FA.....”
.Description
SwiftLint fails to run as a package plugin in Xcode Cloud. Please note as a package plugin, not via the CLI/Homebrew installation/etc. I'm seeing SwiftLint 0.54 attempt to write to the file system despite the fact that the tool is running in Xcode Cloud. This causes an unrecoverable error preventing the rest of the build process. Here's the relevant Xcode Cloud log output:
Environment
.binaryTarget(...)
dependency of an internal Swift packageMyPrivatePackage
. This package is a dependency used across our team's various projects.MyPrivatePackage
's copy of SwiftLint as a build plugin step under a "Run Build Tool Plugins" Xcode build phase.ci_post_checkout.sh
Xcode Cloud script runs the following commands prior to resolving Swift packages or running build plugins, per the SwiftLint README for "unattended" CI usage:The Xcode Cloud environment variables during Xcode Cloud's "Set environment variables" build step are:
Workaround
I am able to get SwiftLint to run successfully in Xcode Cloud if I don't use it as a package plugin but instead use it via a custom build phase run script (installed via homebrew, f.ex.). Unfortunately, this workaround is not available to me, because my team is relying on the package plugin support in order to avoid tooling challenges with programmatic/manual SwiftLint installs.
Given that a run script approach works, I have reason to believe that this bug is specific to running SwiftLint in Xcode Cloud as a package plugin. My guess here is that the option to disable caching is missed in some code path unique to the package plugin use case.
The text was updated successfully, but these errors were encountered: