The symlink to exec root seems to be named incorrectly
- Dominant language
- Java
- Stars
- 25.8k
- Forks
- 4.6k
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 72
Description
### Description of the problem / feature request:
According to this documentation: https://docs.bazel.build/versions/master/output_directories.html, the symlink to exec root should be named `bazel-`, but in practice it's named `bazel-`, which may be different.
For example, if I have a `WORKSPACE` file with this:
```
workspace(name = "foo")
```
contained in directory named `bar`, then inside `bar` Bazel creates `bazel-bar`, not `bazel-foo` as it should.
This is inconvenient sometimes because I don't see how to get the name of containing directory (`bar`), while workspace name (`foo`) is available from `ctx`.
### What operating system are you running Bazel on?
NixOS:
- system: `"x86_64-linux"`
- host os: `Linux 4.14.48, NixOS, 18.09pre142796.4b649a99d84 (Jellyfish)`
- multi-user?: `yes`
- sandbox: `no`
- version: `nix-env (Nix) 2.1pre6148_a4aac7f`
- channels(root): `"nixos-18.09pre142796.4b649a99d84"`
warning: Nix search path entry '/home/mark/.nix-defexpr/channels' does not exist, ignoring
- nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
### What's the output of `bazel info release`?
```
release 0.12.0- (@non-git)
```
### If `bazel info release` returns "development version" or "(@non-git)", tell us how you built Bazel.
Got it from `nix`.
### Have you found anything relevant by searching the web?
No.
### Any other information, logs, or outputs that you want to share?
No.
Contributor guide
Research direction
Reproduce the behavior using a WORKSPACE file with workspace(name = "foo") inside a directory named bar, and compare the generated symlink with the output-directories documentation. Trace Bazel's symlink creation entry point and determine whether completion means naming it bazel-foo; review the 23-comment discussion for unresolved edge cases before making changes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100