Repositories
Bzl uses the terminology repository to refer to a collection of files rooted at the WORKSPACE
file. This includes the default workspace (e.g., anything under @//...
) as well as the entire set of external workspaces (e.g. @foo/...
).
To view the list of repositories on your workstation visit http://127.0.0.1:8080/local:
Repository Discovery
Bzl discovers bazel repositories on your workstation by inspecting the OS process list. From there it scans the --output_user_root
(s) named by the bazel server process.
If you’d like to hardcode the location of repos on your filesystem, you can put the absolute path to the repository in your ~/.bzlrc
file:
common --repository_dir=/path/to/foo
common --repository_dir=/path/to/bar
common --repository_dir=/path/to/baz
Abandoned Output Bases
If bzl discovers a bazel output base (the place where it stores cached data) that has no corresponding workspace, it labels this as an Abandoned Output Base.
An output base can be abandoned when the filesystem directory where the WORKSPACE
lived is deleted, but a bazel clean --expunge
was not issued first. It can also occur when a WORKSPACE is renamed.
Over time, this can consume significant disk space.
NOTE: in case you were wondering, you can nuke the entire --output_user_root
to reclaim all disk space being used by bazel. For example, the following is completely safe from a data-loss perspective:
$ rm -rf /var/tmp/_bazel_foo/