bazelbuild / bazelbuild/bazel

`%p` support for `--server_jvm_out` argument

Open
#21,375 4 comments 0 reactions 0 assignees View on GitHub
P4 team-Core type: feature request untriaged
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 20h
Merged PRs (30d)
72

Description

### Description of the feature request:

It will be nice to let user add `%p` to `--server_jvm_out` argument which will be replaced by Bazel with pid of server process. Exactly like it works for `--host_jvm_args=-XX:ErrorFile=` and `--host_jvm_args=-XX:ReplayDataFile=`

### Which category does this issue belong to?

_No response_

### What underlying problem are you trying to solve with this feature?

When server process crashed the new instance overwrites that file. In JS itself it solved by adding `%p` to file names which will be replaced by pid. So once it crash the new file will be created for sure. I really like the idea to have consistent behavior with `--host_jvm_args=-XX:=` so user could be 100% sure which jvm output file corresponds to which `-XX:ErrorFile`

#### Workaround

To work that around I have to try to rename that file in bazel wrapper script before each run. It's renamed just fine on Linux but Windows don't let me rename it while server is up, which is fine but complicates the logic. Only doubt I have is that will work only while Bazel doesn't restart the server by itself within the command call. Which is not the case now, but could be changed one day.

### Which operating system are you running Bazel on?

Windows, Linix

### What is the output of `bazel info release`?

release 6.1.0-12

### If `bazel info release` returns `development version` or `(@non-git)`, tell us how you built Bazel.

_No response_

### What's the output of `git remote get-url origin; git rev-parse HEAD` ?

_No response_

### Have you found anything relevant by searching the web?

_No response_

### Any other information, logs, or outputs that you want to share?

_No response_

Contributor guide

Open the contributing guide

Research direction

The issue names no source files, tests, or entry points. Start by locating the implementation of --server_jvm_out and the existing %p handling for --host_jvm_args; verify that the option substitutes the server PID without overwriting output files on Linux and Windows.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.