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

--test_tmpdir cannot be unset once set #22209

Open
clintharrison opened this issue May 1, 2024 · 0 comments
Open

--test_tmpdir cannot be unset once set #22209

clintharrison opened this issue May 1, 2024 · 0 comments
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee) team-Core Skyframe, bazel query, BEP, options parsing, bazelrc untriaged

Comments

@clintharrison
Copy link
Contributor

Description of the bug:

We set --test_tmpdir in a system bazelrc, but in some cases want to use the default value.

Using --test_tmpdir= subsequently sets it to the empty string which is treated differently from null.

(Our workspace directory is not always writeable.)

Which category does this issue belong to?

No response

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

https://github.com/clintharrison/bazel-test-tmpdir-bug

$ bazel test //:repro --test_output=all
...
==================== Test output for //:repro:
TEST_TMPDIR=/private/var/tmp/_bazel/e5bcaefbbb545dce47a13350093f458e/sandbox/darwin-sandbox/33/execroot/__main__/_tmp/31551aaf1b9f4a30fe23103fb3d2e5a6

$ bazel test //:repro --test_output=all --test_tmpdir=
...
==================== Test output for //:repro:
TEST_TMPDIR=/Users/clint/code/bazel-test-tmpdir-bug/_tmp/31551aaf1b9f4a30fe23103fb3d2e5a6

Which operating system are you running Bazel on?

macOS

What is the output of bazel info release?

release 7.1.1

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

Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.

No response

Have you found anything relevant by searching the web?

No response

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

Here we determine whether to use the default (in the execroot) or a relative path within the workspace:
https://cs.opensource.google/bazel/bazel/+/master:src/main/java/com/google/devtools/build/lib/analysis/test/TestStrategy.java;l=405-416;drc=114c0c641d128429df32999012f7a1207c3bee02

I think this could be a EmptyToNullPathFragmentConverter instead: https://cs.opensource.google/bazel/bazel/+/master:src/main/java/com/google/devtools/build/lib/exec/ExecutionOptions.java;l=240;drc=114c0c641d128429df32999012f7a1207c3bee02

If it's truly desired to use $workspace/_tmp/... I think --test_tmpdir=. can still be used.

@satyanandak satyanandak added the team-Local-Exec Issues and PRs for the Execution (Local) team label May 2, 2024
@coeuvre coeuvre added team-Core Skyframe, bazel query, BEP, options parsing, bazelrc and removed team-Local-Exec Issues and PRs for the Execution (Local) team labels May 7, 2024
@haxorz haxorz added P3 We're not considering working on this, but happy to review a PR. (No assignee) and removed type: bug labels May 15, 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-Core Skyframe, bazel query, BEP, options parsing, bazelrc untriaged
Projects
None yet
Development

No branches or pull requests

6 participants