简体   繁体   中英

bazel build - how to get name of temporary directory

I am running bazel build using the environment variable:

TEST_TMPDIR=/tmp/.bazel

(This way it does not use ~/.cache/bazel and instead uses /tmp/.bazel)

After the build completes, I can do:

ls -lah /tmp/.bazel/_bazel_dev/
total 20K
drwxr-xr-x 5 dev root 4.0K Dec 15 13:26 .
drwxr-xr-x 3 dev root 4.0K Dec 15 13:26 ..
drwxr-xr-x 3 dev root 4.0K Dec 15 13:26 cache
drwxr-xr-x 8 dev root 4.0K Dec 15 13:36 f0dfd1906214c4c442535f524f4c9395
drwxr-xr-x 3 dev root 4.0K Dec 15 13:26 install

Now is there a bazel command (or bash commands) I can run to get the temp dir name? f0dfd1906214c4c442535f524f4c9395

If there are multiple such folders from builds of other unrelated projects also, I just want to get the dir name for my bazel build.

(The reason I need this is because I need some files from this directory for another build)

You want the output from bazel info

Most likely you are after the output_base path but you should be able to find all the other paths you need from the output of that command.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM