This is an automated email from the ASF dual-hosted git repository.

kou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/main by this push:
     new 4a54950b3d GH-42213: [Swift] Use "--warnings-as-errors" only on CI 
(#42214)
4a54950b3d is described below

commit 4a54950b3df34d90380959b40b6f85cb7801892c
Author: abandy <[email protected]>
AuthorDate: Sat Jun 22 19:49:08 2024 -0400

    GH-42213: [Swift] Use "--warnings-as-errors" only on CI (#42214)
    
    ### 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.
    
    * GitHub Issue: #42213
    
    Lead-authored-by: Alva Bandy <[email protected]>
    Co-authored-by: Sutou Kouhei <[email protected]>
    Signed-off-by: Sutou Kouhei <[email protected]>
---
 ci/scripts/swift_test.sh        | 4 ++++
 swift/Arrow/Package.swift       | 7 ++++---
 swift/ArrowFlight/Package.swift | 4 ++--
 3 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/ci/scripts/swift_test.sh b/ci/scripts/swift_test.sh
index b523e3891d..aba90f31e5 100755
--- a/ci/scripts/swift_test.sh
+++ b/ci/scripts/swift_test.sh
@@ -34,10 +34,14 @@ popd
 
 source_dir=${1}/swift/Arrow
 pushd ${source_dir}
+sed 's/\/\/ build://g' Package.swift > Package.swift.build
+mv Package.swift.build Package.swift
 swift test
 popd
 
 source_dir=${1}/swift/ArrowFlight
 pushd ${source_dir}
+sed 's/\/\/ build://g' Package.swift > Package.swift.build
+mv Package.swift.build Package.swift
 swift test
 popd
diff --git a/swift/Arrow/Package.swift b/swift/Arrow/Package.swift
index 6944d7b910..85407ea1b9 100644
--- a/swift/Arrow/Package.swift
+++ b/swift/Arrow/Package.swift
@@ -46,8 +46,9 @@ let package = Package(
             name: "ArrowC",
             path: "Sources/ArrowC",
             swiftSettings: [
-                .unsafeFlags(["-warnings-as-errors"])
+                 // build: .unsafeFlags(["-warnings-as-errors"])
             ]
+
         ),
         .target(
             name: "Arrow",
@@ -56,14 +57,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"])
             ]
         )
     ]
diff --git a/swift/ArrowFlight/Package.swift b/swift/ArrowFlight/Package.swift
index f4d6485d1b..8366ccceb7 100644
--- a/swift/ArrowFlight/Package.swift
+++ b/swift/ArrowFlight/Package.swift
@@ -47,14 +47,14 @@ let package = Package(
                 .product(name: "SwiftProtobuf", package: "swift-protobuf")
             ],
             swiftSettings: [
-                .unsafeFlags(["-warnings-as-errors"])
+                // build: .unsafeFlags(["-warnings-as-errors"])
             ]
         ),
         .testTarget(
             name: "ArrowFlightTests",
             dependencies: ["ArrowFlight"],
             swiftSettings: [
-                .unsafeFlags(["-warnings-as-errors"])
+                // build: .unsafeFlags(["-warnings-as-errors"])
             ]
         )
     ]

Reply via email to