-
Notifications
You must be signed in to change notification settings - Fork 441
rewrite swiftSettings to avoid causing SPM build failures #358
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rewrite swiftSettings to avoid causing SPM build failures #358
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing this. For readability, however, I would prefer to use an if
instead the map
, and just change `swiftSyntaxUnsafeSwiftFlags
var swiftSyntaxSwiftSettings: [SwiftSetting] = []
/// If we are in a controlled CI environment, we can use internal compiler flags
/// to speed up the build or improve it.
if ProcessInfo.processInfo.environment["SWIFT_BUILD_SCRIPT_ENVIRONMENT"] != nil {
let groupFile = URL(fileURLWithPath: #file)
.deletingLastPathComponent()
.appendingPathComponent("utils")
.appendingPathComponent("group.json")
swiftSyntaxSwiftSettings.append(.unsafeFlags([
"-Xfrontend", "-group-info-path",
"-Xfrontend", groupFile.path,
// Enforcing exclusivity increases compile time of release builds by 2 minutes.
// Disable it when we're in a controlled CI environment.
"-enforce-exclusivity=unchecked"
]))
}
rewrote it without the if case _? = ProcessInfo.processInfo.environment["SWIFT_BUILD_SCRIPT_ENVIRONMENT"] { fine? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for continuing to drive this. I’ve got two more stylistic comments inline.
Co-authored-by: Alex Hoppen <[email protected]>
Co-authored-by: Alex Hoppen <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Looks good to me now.
@swift-ci Please test |
is this ready to merge? |
Sorry, forgot to hit the merge button. Thanks for the ping. |
Cherry picked from swiftlang#358
Cherry picked from swiftlang#358
fixes the issue described here by kicking the unsafe flags logic up a level, so non-CI builds pass an empty array of
SwiftSetting
s instead of an empty array of unsafe flags.