-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow fallback from runfiles lookup in edge cases
Currently, libjvm_stub exits if the C++ runfiles library detects runfiles but then fails to find the JDK. This was based on the assumption that this situation could only occur if e.g. Bazel rules would improperly forward runfiles. However, this can also happen when the binary using libjvm_stub is itself launched from another, top-level binary that does not set the variables used for runfiles discovery. If the top-level binary uses a runfiles manifest to find the current binary, it will execute it using a path that points into the Bazel cache directory. Since the contents of the cache are not hermetic, an adjacent out-of-date .runfiles directory or MANIFEST may exist as a left-over from a previous direct run of the current binary. Since there is no way to detect this scenario, fall back to a system-provided JDK but print a warning. Also print all Bazel-related warnings to stderr rather than stdout.
- Loading branch information
Showing
2 changed files
with
31 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters