Skip to content

Commit 152a918

Browse files
authored
Make sure the staging dir in OSS-Fuzz packaging rule is cleaned up, to permit non-sandboxed runs. (#134)
1 parent fc0e7d4 commit 152a918

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

fuzzing/private/oss_fuzz/package.bzl

+5-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,11 @@ def _oss_fuzz_package_impl(ctx):
2929
outputs = [output_archive],
3030
inputs = action_inputs,
3131
command = """
32-
declare -r STAGING_DIR="$(pwd)/{output}.staging"
33-
mkdir "$STAGING_DIR"
32+
declare -r STAGING_DIR="$(mktemp --directory -t oss-fuzz-pkg.XXXXXXXXXX)"
33+
function cleanup() {{
34+
rm -rf "$STAGING_DIR"
35+
}}
36+
trap cleanup EXIT
3437
ln -s "$(pwd)/{binary_path}" "$STAGING_DIR/{base_name}"
3538
if [[ -n "{corpus_dir}" ]]; then
3639
pushd "{corpus_dir}" >/dev/null

0 commit comments

Comments
 (0)