Skip to content

Commit

Permalink
Make sure the staging dir in OSS-Fuzz packaging rule is cleaned up, t…
Browse files Browse the repository at this point in the history
…o permit non-sandboxed runs. (#134)
  • Loading branch information
stefanbucur authored Apr 1, 2021
1 parent fc0e7d4 commit 152a918
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions fuzzing/private/oss_fuzz/package.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@ def _oss_fuzz_package_impl(ctx):
outputs = [output_archive],
inputs = action_inputs,
command = """
declare -r STAGING_DIR="$(pwd)/{output}.staging"
mkdir "$STAGING_DIR"
declare -r STAGING_DIR="$(mktemp --directory -t oss-fuzz-pkg.XXXXXXXXXX)"
function cleanup() {{
rm -rf "$STAGING_DIR"
}}
trap cleanup EXIT
ln -s "$(pwd)/{binary_path}" "$STAGING_DIR/{base_name}"
if [[ -n "{corpus_dir}" ]]; then
pushd "{corpus_dir}" >/dev/null
Expand Down

0 comments on commit 152a918

Please sign in to comment.