Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure the staging dir in OSS-Fuzz packaging rule is cleaned up, to permit non-sandboxed runs. #134

Merged
merged 1 commit into from
Apr 1, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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