-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Allow using workspace name in labels #1248
Comments
I would very much like to see this implemented... I'm working on a modular project, with each 3rd-party module in its own workspace (i.e. Is self-referencing local repository an acceptable workaround for now? i.e.
I've built Also, when using the self-referencing solution, |
Yeah, self-referencing local repo is the recommended workaround for now. Just some notes about implementing this: there are two changes needed for this.
|
Hey Kristina, thanks for the notes... Hopefully workspace-aware labels in the "main" repository are only needed in the meantime, before this is properly fixed? |
Right now labels either include a workspace name (e.g., when you say |
This is done for a long time, no? @kchodorow? |
*** Reason for rollback *** Breaks rules_go Found by bisecting (bazel build src:bazel && cd ../rules_go && ../bazel/bazel-bin/src/bazel query 'tests(//...)') See http://ci.bazel.io/job/rules_go/BAZEL_VERSION=HEAD,PLATFORM_NAME=linux-x86_64/370/console *** Original change description *** Allow repositories to refer to the local repository by repo name For example, if the main repository is named @foo, other repositories can refer to targets in it as @foo//path/to:target (instead of @//path/to:target). Fixes #1248. -- MOS_MIGRATED_REVID=135471434
The local_repository() workaround doesn't work (AFAICT) if you have targets that produce generated files, because there seems to be confusion over which genfiles paths are permitted (e.g., "bazel-out/local-fastbuild/genfiles/Halide.h" vs "bazel-genfiles/external/halide/Halide.h"). |
Reopening, since I just noticed that this was rolled back. @steven-johnson, can you elaborate/give a more complete example? Using it on genrule output works for me. |
@kchodorow, I'm trying to track it down right now -- it may be a case of user error (mixing prefixed and non-prefixed paths), but I'm not sure yet. Stay tuned. |
What seems to be happening is: my internal target is depending on this via the second syntax (fake-external-repo hack); however, the include paths passed to the C++ compiler search bazel-out/local-fastbuild/genfiles first, so it finds the "other" Halide.h... which it shouldn't see. why the extra include paths are present is not clear to me. again, I'm assuming I'm doing something wrong, but it could also be just that this is a weird hack that I've found the broken edges of... UPDATE: this seems to be a bit weird in repeatability; I think I've gotten my local repo into a state that sorta-kinda-works, but getting there felt pretty flaky. Ordinarily that wouldn't be acceptable, but given that this is very temporary (since I'm assuming the rollback can be unrolled soon) I may just live with it rather than trying to debug it. |
Any update after the rollback? |
I presume this is still unfixed in 0.4.0? |
Still unfixed. The go rules have updated the change that caused the rollback, though, so I should be able to roll forward when I get a chance. |
Looks like this is still going to be unfixed in 0.4.1? |
Ugh, yes, sorry. |
Once this is fixed, I would recommend deprecating |
So is this closed-fixed or closed-unfixed? (I tried building Bazel from tip and trying this out in a local repo and either it's still broken or I'm doing something wrong...) |
Update: as of ce7c4de, whether this works or not depends on how I invoke Say I have a test with a dep like this:
If I invoke via If, however, I am in the toplevel directory, and am lazy, and omit the
|
Argh obviously because the labels are not equivalent. I would call for fixing it by actually making both label equivalent instead of a creating a local repo pointing to the main one. Keeping the release blocker tag so we will include it in the release, not really blocking though. |
Can someone update the status of this? AFAICT it's still broken; whether it's intended to be fixed for 0.5 or not is not clear. |
@kchodorow: do you have the bandwidth to do it? |
Sorry, missed the update from @steven-johnson. I'm taking a guess that |
Correct: it's restricted to
:-( That's unfortunate. I hope it will be improved at some point. |
Hello Kristina, is this still expected to be fixed in 0.5? Is this a release blocker? |
It is not a release blocker. The remaining issues will not be fixed in time for 0.5. |
Hi Kristina, thanks for the info and the move to 0.6! |
Cycling back to this after many months: I'm assuming this isn't gonna be fixed anytime soon? |
Duplicate of #7130 |
Right now, to refer to a label "in this repository," you refer to it as //foo:bar. If the WORKSPACE defines
workspace(name = 'repo')
, perhaps we should also allow referring to it as@repo//foo:bar
.This came up in bazelbuild/rules_rust#7.
The text was updated successfully, but these errors were encountered: