Closed novr closed 4 months ago
Interesting. Are you saying that, with this patch, you no longer need the defaults-write workaround detailed here: https://developer.apple.com/forums/thread/732893?
I'm a bit confused, this codepath is only hit when --diagnostics-output-path
is passed, but I don't think we pass that when invoking the CLI from the plugin. Are you sure this fixes it, @novr?
@czechboy0 Sorry, this method didn't solve the problem.
No problem, thanks for taking the time to investigate @novr! Hopefully the defaults-write workaround detailed in the other issue will allow you to make use of Xcode Cloud, if that's your goal.
Motivation
Modifications
The implementation of swift-openapi-generator is try encoder.encode(container).write(to: url, atomically: true, encoding: .utf8). if atomically is true, the content is written to an intermediate file and then moved to the outputURL. However, XocdeCloud does not seem to allow writing outside of the pluginWorkDirectory, even for temporary files created by the Foundation framework.
The easiest way to get Build to succeed on Xcode Cloud seems to be to change "atomically" to false.
What do you think about this change?
Result
Swift Package Manager's Build Tools plug-in works on XcodeCloud
Test Plan
N/A