-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Expose workspace names through bazel info #2317
Comments
@dinowernli @aehlig @mhlopko @buchgr Can you provide an example of the above situtation? |
I'm actually working on a change right now that will make the execution root basename be the workspace name (so |
Yes, that would be great. Thanks. |
Marking as a dup of #1681, then. Hopefully should be fixed in a couple of days (won't make it into 0.4.5, though). |
I have made a hacky workaround for people with Bazel <=0.4.5 (myself included): Slow, but it appears to work. |
Hi. I'd like to get the workspace name from a Python script that I
You may wonder why I need to Would love any guidance. |
Nevermind; if I run the script from the root, ala |
This seems to be broken with bzlmod. I tried (without success):
However, the information in execution root is always The documentation in the migration guide says:
The documentation for module function says:
My goal is detecting the workspace name. I have been following guidance given in the issue here but seems to be no longer applicable. There are three possibilities:
|
@guw The term "workspace name" is extremely overloaded at this point. Which name do you really need and what do you need it for? |
The immediate need is to allow a human to identify a workspace in an IDE (this is my "foo"). I am currently also using it to customize classpath resolution within IDEs in case of So let's define workspace name as per the initial ask, which I assume is |
As a human-readable identifier, I would recommend either the name of the containing directory (which Bazel uses to name the |
Thanks a lot @fmeum. Would |
It always returns the |
It would be really nice to have
bazel info
expose the name of the workspace in a similar way thatbazel info workspace
exposes the path to the root of the workspace. Perhaps as additional output tobazel info workspace
, or maybe abazel info workspace-name
?The text was updated successfully, but these errors were encountered: