From 3826059776605ddb807c839f6a25736339ad8a85 Mon Sep 17 00:00:00 2001 From: Gerardo Di Giacomo Date: Mon, 21 Aug 2023 14:53:07 -0700 Subject: [PATCH] add aptos-core Dockerfile + build.sh (#10757) Add Dockerfile and build.sh for aptos-core --- projects/aptos-core/Dockerfile | 21 +++++++++++++++++++++ projects/aptos-core/build.sh | 26 ++++++++++++++++++++++++++ projects/aptos-core/project.yaml | 1 + 3 files changed, 48 insertions(+) create mode 100644 projects/aptos-core/Dockerfile create mode 100755 projects/aptos-core/build.sh diff --git a/projects/aptos-core/Dockerfile b/projects/aptos-core/Dockerfile new file mode 100644 index 000000000000..65f13306ce5a --- /dev/null +++ b/projects/aptos-core/Dockerfile @@ -0,0 +1,21 @@ +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ + +FROM gcr.io/oss-fuzz-base/base-builder-rust +RUN apt-get update && apt-get install -y make autoconf automake libclang-dev libtool pkg-config +RUN git clone --depth=1 https://github.com/aptos-labs/aptos-core.git +WORKDIR aptos-core +COPY build.sh $SRC diff --git a/projects/aptos-core/build.sh b/projects/aptos-core/build.sh new file mode 100755 index 000000000000..07125f6c0300 --- /dev/null +++ b/projects/aptos-core/build.sh @@ -0,0 +1,26 @@ +#!/bin/bash -eu +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ + +NIGHTLY_VERSION="nightly-2023-06-01" + +rustup install $NIGHTLY_VERSION +cd testsuite/fuzzer + +RUSTFLAGS="$RUSTFLAGS --cfg tokio_unstable" cargo +$NIGHTLY_VERSION fuzz build -O -a +for fuzzer in $(cat fuzz/Cargo.toml | grep "name = " | grep -v "fuzzer-fuzz" | cut -d'"' -f2); do + cp ../../target/x86_64-unknown-linux-gnu/release/$fuzzer $OUT/ +done \ No newline at end of file diff --git a/projects/aptos-core/project.yaml b/projects/aptos-core/project.yaml index bdf38dc1857e..138b0a36fe23 100644 --- a/projects/aptos-core/project.yaml +++ b/projects/aptos-core/project.yaml @@ -10,3 +10,4 @@ sanitizers: - address fuzzing_engines: - libfuzzer +coverage_extra_args: -ignore-filename-regex='.*/rustc/.*' \ No newline at end of file