-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
GH-42213: [Swift] Use "--warnings-as-errors" only on CI #42214
Conversation
Thanks for opening a pull request! If this is not a minor PR. Could you open an issue for this pull request on GitHub? https://github.com/apache/arrow/issues/new/choose Opening GitHub issues ahead of time contributes to the Openness of the Apache Arrow project. Then could you also rename the pull request title in the following format?
or
In the case of PARQUET issues on JIRA the title also supports:
See also: |
Does swift not have a way of passing additional flags to the compiler similar to the |
Also fyi: #42212 |
I did a search but didn't see this as an option. CMake does support Swift (https://github.com/apple/swift-cmake-examples) so maybe we can switch to CMake (in a future PR) the CI build and it might provide a more flexible way to handle this issue. |
Oh... How about embedding special marks to diff --git a/ci/scripts/swift_test.sh b/ci/scripts/swift_test.sh
index b523e3891d..60ea7bde43 100755
--- a/ci/scripts/swift_test.sh
+++ b/ci/scripts/swift_test.sh
@@ -34,7 +34,9 @@ popd
source_dir=${1}/swift/Arrow
pushd ${source_dir}
+sed -i.bak -e 's,// build: ,,g' Package.swift
swift test
+mv Package.swift{.bak,}
popd
source_dir=${1}/swift/ArrowFlight
diff --git a/swift/Arrow/Package.swift b/swift/Arrow/Package.swift
index 6944d7b910..80c7d78e44 100644
--- a/swift/Arrow/Package.swift
+++ b/swift/Arrow/Package.swift
@@ -46,7 +46,7 @@ let package = Package(
name: "ArrowC",
path: "Sources/ArrowC",
swiftSettings: [
- .unsafeFlags(["-warnings-as-errors"])
+ // build: .unsafeFlags(["-warnings-as-errors"])
]
),
.target(
@@ -56,14 +56,14 @@ let package = Package(
.product(name: "Atomics", package: "swift-atomics")
],
swiftSettings: [
- .unsafeFlags(["-warnings-as-errors"])
+ // build: .unsafeFlags(["-warnings-as-errors"])
]
),
.testTarget(
name: "ArrowTests",
dependencies: ["Arrow", "ArrowC"],
swiftSettings: [
- .unsafeFlags(["-warnings-as-errors"])
+ // build: .unsafeFlags(["-warnings-as-errors"])
]
)
] |
Or using some environment variable with the "extra flags", I've found this snippet example for what I had in mind: https://gist.github.com/Sorix/21e61347f478ae2e83ef4d8a92d933af |
I looked at the snippet above. Cool idea but it seems that it won't work for Xcode based on the last comment: |
856e891
to
30143dc
Compare
reposting here to make sure it is seen: I can confirm that I fail to build on and with the only change being checking out with the command For those who may find this conversation later make sure to right-click on the package in xcode and select the option "Update Package" to make sure that Xcode picks up the change. Originally posted by @lukedg97 in #42213 (comment) |
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.
+1
After merging your PR, Conbench analyzed the 7 benchmarking runs that have been run so far on merge-commit 4a54950. There were no benchmark performance regressions. 🎉 The full Conbench report has more details. It also includes information about 11 possible false positives for unstable benchmarks that are known to sometimes produce them. |
Rationale for this change
Downstream clients are getting a conflicting options error when building with the "-warnings-as-errors" swift option.
What changes are included in this PR?
This PR disables the "-warnings-as-errors" swift options by default and enables them for CI builds only. The Swift CI script will enable the options in the Package.swift files before running the build.