|
1 |
| -#!/usr/bin/env sh |
| 1 | +#!/usr/bin/env bash |
2 | 2 | # Copyright 2022 Code Intelligence GmbH
|
3 | 3 | #
|
4 | 4 | # Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -33,6 +33,24 @@ JAZZER_COORDINATES=$1
|
33 | 33 | [ ! -f "${JAZZER_JAR_PATH}" ] && \
|
34 | 34 | fail "JAZZER_JAR_PATH does not exist at '$JAZZER_JAR_PATH'"
|
35 | 35 |
|
| 36 | +# --- begin runfiles.bash initialization v3 --- |
| 37 | +# Copy-pasted from the Bazel Bash runfiles library v3. |
| 38 | +set -uo pipefail; set +e; f=bazel_tools/tools/bash/runfiles/runfiles.bash |
| 39 | +source "${RUNFILES_DIR:-/dev/null}/$f" 2>/dev/null || \ |
| 40 | + source "$(grep -sm1 "^$f " "${RUNFILES_MANIFEST_FILE:-/dev/null}" | cut -f2- -d' ')" 2>/dev/null || \ |
| 41 | + source "$0.runfiles/$f" 2>/dev/null || \ |
| 42 | + source "$(grep -sm1 "^$f " "$0.runfiles_manifest" | cut -f2- -d' ')" 2>/dev/null || \ |
| 43 | + source "$(grep -sm1 "^$f " "$0.exe.runfiles_manifest" | cut -f2- -d' ')" 2>/dev/null || \ |
| 44 | + { echo>&2 "ERROR: cannot find $f"; exit 1; }; f=; set -e |
| 45 | +# --- end runfiles.bash initialization v3 --- |
| 46 | + |
| 47 | +# JAZZER_EXECPATH is a path of the form "external/remotejdk_17/bin/java". We need to strip of the |
| 48 | +# leading external to get a path we can pass to rlocation. |
| 49 | +java_rlocationpath=$(echo "$JAVA_EXECPATH" | cut -d/ -f2-) |
| 50 | +java=$(rlocation "$java_rlocationpath") |
| 51 | +"$java" -jar "${JAZZER_JAR_PATH}" --version 2>&1 | grep '^Jazzer v' || \ |
| 52 | + fail "JAZZER_JAR_PATH is not a valid jazzer.jar" |
| 53 | + |
36 | 54 | MAVEN_REPO=https://oss.sonatype.org/service/local/staging/deploy/maven2
|
37 | 55 |
|
38 | 56 | # The Jazzer jar itself bundles native libraries for multiple architectures and thus can't be built
|
|
0 commit comments