Skip to content

Commit

Permalink
add aptos-core Dockerfile + build.sh (#10757)
Browse files Browse the repository at this point in the history
Add Dockerfile and build.sh for aptos-core
  • Loading branch information
gedigi authored Aug 21, 2023
1 parent 8c049f1 commit 3826059
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
21 changes: 21 additions & 0 deletions projects/aptos-core/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
26 changes: 26 additions & 0 deletions projects/aptos-core/build.sh
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions projects/aptos-core/project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ sanitizers:
- address
fuzzing_engines:
- libfuzzer
coverage_extra_args: -ignore-filename-regex='.*/rustc/.*'

0 comments on commit 3826059

Please sign in to comment.