Skip to content

Commit 6b49da8

Browse files
committed
bazel: Use new runfiles library constructors
First step towards compatibility with Bzlmod.
1 parent 907530e commit 6b49da8

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

bazel/tools/java/com/code_intelligence/jazzer/tools/FuzzTargetTestWrapper.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
import static java.util.stream.Collectors.toList;
1717

18+
import com.google.devtools.build.runfiles.AutoBazelRepository;
1819
import com.google.devtools.build.runfiles.Runfiles;
1920
import java.io.BufferedReader;
2021
import java.io.File;
@@ -44,6 +45,7 @@
4445
import javax.tools.StandardJavaFileManager;
4546
import javax.tools.ToolProvider;
4647

48+
@AutoBazelRepository
4749
public class FuzzTargetTestWrapper {
4850
private static final boolean JAZZER_CI = "1".equals(System.getenv("JAZZER_CI"));
4951
private static final String EXCEPTION_PREFIX = "== Java Exception: ";
@@ -66,7 +68,8 @@ public static void main(String[] args) {
6668
Set<String> allowedFindings;
6769
List<String> arguments;
6870
try {
69-
runfiles = Runfiles.create();
71+
runfiles =
72+
Runfiles.preload().withSourceRepository(AutoBazelRepository_FuzzTargetTestWrapper.NAME);
7073
driverActualPath = Paths.get(runfiles.rlocation(args[0]));
7174
apiActualPath = Paths.get(runfiles.rlocation(args[1]));
7275
targetJarActualPath = Paths.get(runfiles.rlocation(args[2]));

launcher/jvm_tooling.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ std::string getInstrumentorAgentPath(const std::string &executable_path) {
6969
{
7070
using bazel::tools::cpp::runfiles::Runfiles;
7171
std::string error;
72-
std::unique_ptr<Runfiles> runfiles(
73-
Runfiles::Create(std::string(executable_path), &error));
72+
std::unique_ptr<Runfiles> runfiles(Runfiles::Create(
73+
std::string(executable_path), BAZEL_CURRENT_REPOSITORY, &error));
7474
if (runfiles != nullptr) {
7575
auto bazel_path = runfiles->Rlocation(kJazzerBazelRunfilesPath);
7676
if (!bazel_path.empty() && std::ifstream(bazel_path).good())

0 commit comments

Comments
 (0)