diff options
author | Fabian Meumertzheim <fabian@meumertzhe.im> | 2021-06-17 12:53:13 +0200 |
---|---|---|
committer | Fabian Meumertzheim <fabian@meumertzhe.im> | 2021-06-17 13:04:05 +0200 |
commit | 316da57a8688470fcfd5521673239b5fa66512ba (patch) | |
tree | 93f92fbdf53f9993c4ac93229cc83b581dadd817 /bazel | |
parent | 3ad5e1ef00fb64829d0b2b16f356435edc61aa4a (diff) | |
download | jazzer-api-316da57a8688470fcfd5521673239b5fa66512ba.tar.gz |
Fix runfiles handling with jazzer_wrapper.sh
The wrapper needs to load the Bazel Bash runfiles library to pass the
runfiles directory to jazzer_driver.
Diffstat (limited to 'bazel')
-rwxr-xr-x | bazel/jazzer_wrapper.sh | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/bazel/jazzer_wrapper.sh b/bazel/jazzer_wrapper.sh index eb53f750..d12e1571 100755 --- a/bazel/jazzer_wrapper.sh +++ b/bazel/jazzer_wrapper.sh @@ -13,6 +13,17 @@ # See the License for the specific language governing permissions and # limitations under the License. +# --- begin runfiles.bash initialization v2 --- +# Copy-pasted from the Bazel Bash runfiles library v2. +set -uo pipefail; f=bazel_tools/tools/bash/runfiles/runfiles.bash +source "${RUNFILES_DIR:-/dev/null}/$f" 2>/dev/null || \ +source "$(grep -sm1 "^$f " "${RUNFILES_MANIFEST_FILE:-/dev/null}" | cut -f2- -d' ')" 2>/dev/null || \ +source "$0.runfiles/$f" 2>/dev/null || \ +source "$(grep -sm1 "^$f " "$0.runfiles_manifest" | cut -f2- -d' ')" 2>/dev/null || \ +source "$(grep -sm1 "^$f " "$0.exe.runfiles_manifest" | cut -f2- -d' ')" 2>/dev/null || \ +{ echo>&2 "ERROR: cannot find $f"; exit 1; }; f=; set -e +# --- end runfiles.bash initialization v2 -- + DEFAULT_CRASH_PREFIX="/tmp/jazzer" mkdir -p $DEFAULT_CRASH_PREFIX eval "$1" -artifact_prefix="$DEFAULT_CRASH_PREFIX/" --reproducer_path="$DEFAULT_CRASH_PREFIX" "${@:2}" |