-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Allow empty build settings arrays #2880
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
Allow empty build settings arrays #2880
Conversation
In this case: ```swift let linkerSettings: [LinkerSetting] if ProcessInfo.processInfo.environment["SOMETHING"] == nil { linkerSettings = [] } else { linkerSettings = [ .unsafeFlags(["something"]), ] } // pass linkerSettings to a .target below ``` It's useful to be able to pass empty lists here.
Submitting for discussion, I haven't thoroughly tested this |
This makes sense to me — @neonichu or @aciidb0mb3r, was there a particular reason to disallow empty lists? If not, we should allow this, but it would be good to also add a unit test to the PR here. |
IIRC the thinking was that there’s no reason to have empty list in a fully declarative manifest but I think it’s fine to relax this requirement since it’s quite useful to be able to write non-declarative manifests in practice. |
Thanks, @aciidb0mb3r, that makes sense. In this case I think that a unit test is all that's needed. Since we're relaxing the requirement we won't be breaking any projects, and I don't think this will need evolution discussion. |
@swift-ci please smoke test |
@swift-ci please smoke test |
Thanks! |
Throwing an error on aesthetic issues like this makes it difficult to conditionally generate these arguments. (This is a followup to swiftlang#2880.)
Throwing an error on aesthetic issues like this makes it difficult to conditionally generate these arguments. (This is a followup to #2880.)
In this case:
It's useful to be able to pass empty lists here.