aboutsummaryrefslogtreecommitdiff
path: root/projects/grpc-swift
diff options
context:
space:
mode:
authorCatena cyber <35799796+catenacyber@users.noreply.github.com>2021-09-02 23:56:01 +0200
committerGitHub <noreply@github.com>2021-09-02 14:56:01 -0700
commitdd8e46c38b11788db8ac42de0d27fc11abfcdbae (patch)
tree84e06bf3168c02be1cef7579d52a11c46c839273 /projects/grpc-swift
parent3ae0d9fe148e18064cd8b361e2a21deb0dbc637f (diff)
downloadoss-fuzz-dd8e46c38b11788db8ac42de0d27fc11abfcdbae.tar.gz
Swift ideal integration (#6312)
* Helper flags for swift compilation * Documentation for swift project integration * Adds swift to the languages with coverage * Only thread sanitizer is supported * Fixes swift coverage target compilation * fixup flags facotring * swift: run on new ubuntu * fixup * swift: right copy for symbolizer
Diffstat (limited to 'projects/grpc-swift')
-rw-r--r--projects/grpc-swift/Dockerfile6
-rwxr-xr-xprojects/grpc-swift/build.sh15
-rw-r--r--projects/grpc-swift/project.yaml1
3 files changed, 5 insertions, 17 deletions
diff --git a/projects/grpc-swift/Dockerfile b/projects/grpc-swift/Dockerfile
index a34d30faf..8c56c0b2d 100644
--- a/projects/grpc-swift/Dockerfile
+++ b/projects/grpc-swift/Dockerfile
@@ -14,11 +14,7 @@
#
################################################################################
-# Using Ubuntu 16.04 because of breakage on Ubuntu 20.04.
-# See https://github.com/google/oss-fuzz/issues/6291 for more details.
-FROM gcr.io/oss-fuzz-base/base-builder-swift:xenial
-# Delete line above and uncomment line below to upgrade to 20.04.
-# FROM gcr.io/oss-fuzz-base/base-builder-swift
+FROM gcr.io/oss-fuzz-base/base-builder-swift
# specific to project
RUN git clone --depth 1 https://github.com/grpc/grpc-swift
diff --git a/projects/grpc-swift/build.sh b/projects/grpc-swift/build.sh
index f9f415062..a27f3719c 100755
--- a/projects/grpc-swift/build.sh
+++ b/projects/grpc-swift/build.sh
@@ -15,25 +15,16 @@
#
################################################################################
+. precompile_swift
# build project
cd FuzzTesting
-# Maybe we should have a helper script to set $SWIFT_FLAGS
-# for instance about -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION in -Xcc
-swift build -c debug -Xswiftc -sanitize=fuzzer,address \
- -Xswiftc -parse-as-library -Xswiftc -static-stdlib \
- -Xswiftc -use-ld=/usr/bin/ld --static-swift-stdlib \
- --sanitize=address -Xcc="-fsanitize=fuzzer-no-link,address" \
- -Xcxx="-fsanitize=fuzzer-no-link,address"
+swift build -c debug $SWIFTFLAGS
(
cd .build/debug/
find . -maxdepth 1 -type f -name "*Fuzzer" -executable | while read i; do cp $i $OUT/"$i"-debug; done
)
-swift build -c release -Xswiftc -sanitize=fuzzer,address \
- -Xswiftc -parse-as-library -Xswiftc -static-stdlib \
- -Xswiftc -use-ld=/usr/bin/ld --static-swift-stdlib \
- --sanitize=address -Xcc="-fsanitize=fuzzer-no-link,address" \
- -Xcxx="-fsanitize=fuzzer-no-link,address"
+swift build -c release $SWIFTFLAGS
(
cd .build/release/
find . -maxdepth 1 -type f -name "*Fuzzer" -executable | while read i; do cp $i $OUT/"$i"-release; done
diff --git a/projects/grpc-swift/project.yaml b/projects/grpc-swift/project.yaml
index 2825267a3..2b5c23049 100644
--- a/projects/grpc-swift/project.yaml
+++ b/projects/grpc-swift/project.yaml
@@ -9,4 +9,5 @@ fuzzing_engines:
- libfuzzer
sanitizers:
- address
+- thread
main_repo: 'https://github.com/grpc/grpc-swift'