question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The symlink to exec root seems to be named incorrectly

See original GitHub issue

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-<workspace-name>, but in practice it’s named bazel-<containing-dir-name>, 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.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:22 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
janakdrcommented, Aug 19, 2020

Ok, thanks. Given the issue with bazel clean that I highlighted earlier, I think that our first effort would be to enable bazel clean to aggressively delete all symlinks into the output base that start with bazel-, even if they do not match the expected suffix. That would fix your immediate pain point, I think, and then open up the option for us to change bazel’s behavior to actually match the documentation, although I could see us going either way on that (it’s possible that some users have workflows built around the directory name at this point). I filed #11980 for the behavior change. https://github.com/bazelbuild/bazel/issues/11980I don’t know how quickly we’ll be able to get this done, though. If you think that you or someone else would be interested in contributing to Bazel by fixing this, that would be great. It would also help for you or other people to let us know how big a pain point this is, so we can understand how to prioritize properly.

0reactions
blacklinercommented, Aug 19, 2020

In a perfect world i would want the caching from the host to be reused inside docker, i guess. But yes, leaving out this directory would invalidate the symlinks and thus prevent bazel from going crazy.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why doesn't my symbolic link work? - Super User
Navigate to proper and execute ls -l and you can see that the symlink is looking ... (or you've given the path incorrectly)...
Read more >
Why does my symlink to /usr/local/bin not work? - Ask Ubuntu
The solution is rather simple. Use an absolute symlink here such that the first argument of ln -s is a full path instead....
Read more >
How to resolve symbolic links in a shell script - Stack Overflow
"pwd -P" seems to work if you just want the directory, but if for some reason you want the name of the actual...
Read more >
Change permissions for a symbolic link - Unix Stack Exchange
I just ran into a permission problem with symlinks on a CentOS 6.8 server. The symlinks had owner:group of root:root. When the owner...
Read more >
How to find and remove broken symlinks on Linux
When the file that a symbolic link points to is removed from the system or renamed, the symlink will no longer function as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found