From e7c0e59a3290da42b94c167b0b08a470f50dfe3c Mon Sep 17 00:00:00 2001 From: Nathaniel Brough Date: Mon, 30 Jan 2023 17:49:17 -0800 Subject: [PATCH] gitoxide: initial integration (#9529) Signed-off-by: Nathaniel Brough --------- Signed-off-by: Nathaniel Brough Co-authored-by: jonathanmetzman <31354670+jonathanmetzman@users.noreply.github.com> --- projects/gitoxide/Dockerfile | 20 ++++++++++++++++ projects/gitoxide/build.sh | 42 ++++++++++++++++++++++++++++++++++ projects/gitoxide/project.yaml | 9 ++++++++ 3 files changed, 71 insertions(+) create mode 100644 projects/gitoxide/Dockerfile create mode 100755 projects/gitoxide/build.sh create mode 100644 projects/gitoxide/project.yaml diff --git a/projects/gitoxide/Dockerfile b/projects/gitoxide/Dockerfile new file mode 100644 index 000000000..4fecba5f5 --- /dev/null +++ b/projects/gitoxide/Dockerfile @@ -0,0 +1,20 @@ +# 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 git clone --depth 1 https://github.com/Byron/gitoxide.git gitoxide +WORKDIR gitoxide +COPY build.sh $SRC/ diff --git a/projects/gitoxide/build.sh b/projects/gitoxide/build.sh new file mode 100755 index 000000000..5794b072f --- /dev/null +++ b/projects/gitoxide/build.sh @@ -0,0 +1,42 @@ +#!/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. +# +################################################################################ + +set -eox pipefail + +# TODO: Switch back to this method for fuzzer discovery once all the fuzzers +# build successfully. +# FUZZ_CRATES=$(find . -type d -name fuzz -exec readlink -f {} \;) + +FUZZ_CRATE_DIRS=("$(pwd)/git-config"\ + "$(pwd)/git-pathspec"\ + "$(pwd)/git-refspec"\ + "$(pwd)/git-revision") + + +for CRATE_DIR in ${FUZZ_CRATE_DIRS[@]}; +do + echo "Building crate: $CRATE_DIR" + cd $CRATE_DIR + cargo +nightly fuzz build -O --debug-assertions + FUZZ_TARGET_OUTPUT_DIR=fuzz/target/x86_64-unknown-linux-gnu/release + for f in fuzz/fuzz_targets/*.rs + do + FUZZ_TARGET_NAME=$(basename ${f%.*}) + CRATE_NAME=$(basename $CRATE_DIR) + cp $FUZZ_TARGET_OUTPUT_DIR/$FUZZ_TARGET_NAME $OUT/$CRATE_NAME-$FUZZ_TARGET_NAME + done +done \ No newline at end of file diff --git a/projects/gitoxide/project.yaml b/projects/gitoxide/project.yaml new file mode 100644 index 000000000..b65dccc90 --- /dev/null +++ b/projects/gitoxide/project.yaml @@ -0,0 +1,9 @@ +homepage: "https://crates.io/crates/gitoxide" +language: rust +primary_contact: "byronimo@gmail.com" +main_repo: "https://github.com/Byron/gitoxide" +file_github_issue: true +sanitizers: + - address +fuzzing_engines: + - libfuzzer