csantanapr closed pull request #59: implement temporary workaround to issue_3646, swift 4.1 bug with structs URL: https://github.com/apache/incubator-openwhisk-runtime-swift/pull/59
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/core/swift41Action/CHANGELOG.md b/core/swift41Action/CHANGELOG.md index 020373a..d98c082 100644 --- a/core/swift41Action/CHANGELOG.md +++ b/core/swift41Action/CHANGELOG.md @@ -19,6 +19,12 @@ # Apache OpenWhisk Swift 4.1 Runtime Container +## 1.0.5 +Changes: + - update to pass swiftc flags -Xswiftc -Onone to workaround swift optimization problem + +Swift runtime version: [swift-4.1-RELEASE](https://swift.org/builds/swift-4.1-release/ubuntu1404/swift-4.1-RELEASE/swift-4.1-RELEASE-ubuntu14.04.tar.gz) + ## 1.0.4 Changes: - update swift41 runtime to `swift-4.1-RELEASE` diff --git a/core/swift41Action/buildandrecord.py b/core/swift41Action/buildandrecord.py index 9a47163..c45b47d 100755 --- a/core/swift41Action/buildandrecord.py +++ b/core/swift41Action/buildandrecord.py @@ -27,7 +27,7 @@ LINKER_PREFIX = "/usr/bin/swiftc -target x86_64-unknown-linux -sdk / -L /swift4Action/spm-build/.build/x86_64-unknown-linux/release -o /swift4Action/spm-build/.build/x86_64-unknown-linux/release/Action -module-name Action -emit-executable -Xlinker '-rpath=$ORIGIN'" GENERATED_BUILD_SCRIPT = "/swift4Action/spm-build/swiftbuildandlink.sh" SPM_DIRECTORY = "/swift4Action/spm-build" -BUILD_COMMAND = ["swift", "build", "-v", "-c", "release"] +BUILD_COMMAND = ["swift", "build", "-v", "-Xswiftc", "-Onone", "-c", "release"] # Build Swift package and capture step trace print("Building action") diff --git a/tests/src/test/scala/runtime/actionContainers/SwiftActionContainerTests.scala b/tests/src/test/scala/runtime/actionContainers/SwiftActionContainerTests.scala index 1754c83..1ba70b0 100644 --- a/tests/src/test/scala/runtime/actionContainers/SwiftActionContainerTests.scala +++ b/tests/src/test/scala/runtime/actionContainers/SwiftActionContainerTests.scala @@ -152,7 +152,7 @@ abstract class SwiftActionContainerTests extends BasicActionRunnerTests with Wsk checkStreams(out, err, { case (o, e) => if (enforceEmptyOutputStream) o shouldBe empty - e shouldBe empty + if (enforceEmptyOutputStream) e shouldBe empty }) } diff --git a/tools/build/compile.sh b/tools/build/compile.sh index 00783d5..38c2495 100755 --- a/tools/build/compile.sh +++ b/tools/build/compile.sh @@ -30,6 +30,7 @@ fi BASE_PATH="/swift3Action" DEST_SOURCE="$BASE_PATH/spm-build" RUNTIME="openwhisk/action-swift-v3.1.1" +BUILD_FLAGS="" if [ ${2} == "swift:3.1.1" ]; then OUTPUT_DIR="build/swift311" elif [ ${2} == "swift:4.1" ]; then @@ -37,13 +38,15 @@ elif [ ${2} == "swift:4.1" ]; then BASE_PATH="/swift4Action" DEST_SOURCE="/$BASE_PATH/spm-build/Sources/Action" OUTPUT_DIR="build/swift4.1" + # Due to a current bug in the Swift Docker image compile optimization is disabled by default. + # If you need compiler optimization you can override the BUILD_FLAGS to enable it + BUILD_FLAGS="-Xswiftc -Onone" else echo "Error: Kind $2 not recognize" exit 3 fi DEST_PACKAGE_SWIFT="$BASE_PATH/spm-build/Package.swift" -BUILD_FLAGS="" if [ -n "$3" ] ; then BUILD_FLAGS=${3} fi ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
