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

Allow dynamic log path location in .bazelrc #22267

Open
ssarad opened this issue May 7, 2024 · 1 comment
Open

Allow dynamic log path location in .bazelrc #22267

ssarad opened this issue May 7, 2024 · 1 comment
Assignees
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee) team-CLI Console UI team-Configurability Issues for Configurability team type: feature request

Comments

@ssarad
Copy link

ssarad commented May 7, 2024

Description of the feature request:

Allow .bazelrc file to have a variable that points to the root of the project (for example: %workspace). Unfortunately %workspace% does not work when specifying the path to logs as it appends %workspace% as a string, not a variable.

build:trace --execution_log_json_file=%workspace%/Bazel/tmp/logs/execution.json

A currently work around is to edit tools/bazel, grab the current path to root of the project and echo the following to a Bazel/tmp/local.bazelrc file

echo "build:trace --execution_log_json_file=$script_root/../Bazel/tmp/logs/execution.json" > Bazel/tmp/local.bazelrc

Then, import local.bazelrcin the project's .bazelrc using try-import

try-import %workspace%/Bazel/tmp/xcode.bazelrc

Which category does this issue belong to?

CLI, Configurability

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

Currently, if we want to specify a location to the logs, we can add the following in the .bazelrc file

build:trace --execution_log_json_file=Bazel/tmp/logs/execution_logs.json

This works fine if a Bazel command is executed from the root of the project but if we run a Bazel command from a subdirectory inside the project, Bazel attempts to search for the path in such manner:

pwd + Bazel/tmp/logs/execution_logs.json

This makes the path mention to dump the logs in the .bazelrc file as an invalid path

Which operating system are you running Bazel on?

MacOS Sonoma 14.4.1

What is the output of bazel info release?

INFO: Invocation ID: c18d31dc-3cbd-4cc0-864b-aff070099dee release 6.4.0

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

@meisterT
Copy link
Member

meisterT commented May 7, 2024

@michajlo it seems to me discussed this before?

@oquenchil oquenchil added P3 We're not considering working on this, but happy to review a PR. (No assignee) and removed untriaged labels May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee) team-CLI Console UI team-Configurability Issues for Configurability team type: feature request
Projects
None yet
Development

No branches or pull requests

6 participants