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

Use the proper message prefix for errors in libjvm_stub #60

Merged
merged 1 commit into from
Mar 17, 2022
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 jni/tools/libjvm_stub/bazel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#include "rules_jni_internal.h"
#include "tools/cpp/runfiles/runfiles.h"

#define MSG_PREFIX "[rules_jni]: "

using ::bazel::tools::cpp::runfiles::Runfiles;

static const char* rules_jni_arg0 = "";
Expand Down Expand Up @@ -82,7 +84,8 @@ static std::string get_bazel_java_home() {
// way to detect this scenario, fall back to a system-provided JDK but print
// a warning.
fprintf(stderr,
"rules_jni: falling back to system JDK, java executable in "
MSG_PREFIX
"falling back to system JDK, java executable in "
"runfiles not found at:\n%s\n",
java_executable_path.c_str());
return "";
Expand All @@ -98,7 +101,7 @@ static std::string get_bazel_java_home() {
return java_executable_path.substr(0, java_executable_path.size() - 13);
}
fprintf(stderr,
"rules_jni: java executable in runfiles has unexpected suffix:\n%s\n",
MSG_PREFIX "java executable in runfiles has unexpected suffix:\n%s\n",
java_executable_path.c_str());
exit(EXIT_FAILURE);
}
Expand Down