-
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
No way to determine runfiles tree including the workspace name #1124
Comments
I don't think we should, that will encourage bad rule creation. The plan is to have the runfiles tree like:
So if you're running in main-repo, you can get another-file via ../another-repo/another-file. If you're working on another-repo, you can still get another-file via ../another-repo/another-file. |
Indeed, but right now the path is undecided, do you have a better idea for the transition? |
Well, I'm hoping to get a cl out this week, so no. |
Ok let's close this one and just accept the breakage at HEAD for now |
How will that work with runfiles found via |
And, more generally, for data dependencies specified via |
Do you mean targets that you've used
This is a bit awkward at the moment. $(location ) will be different than runfiles, and should return the execution-root-relative path, which will still be exec-root/external/repo/path/to/target. However, we're planning to make this match runfiles soon (so it will also be ../repo/path/to/target). Unfortunately, changing this is blocked on an internal change that I'm hoping to get rolled out soon. |
That's what we are doing now and it's not ideal. |
Unfortunately, there isn't really a way to avoid that if you want your repo to have usable as runfiles by another repository. |
That's a pretty huge portability problem for us. We can't easily adjust all of the TEST_SRCDIR relative paths when importing into google3. Based on the discussion in #1116 it seems like PWD should be $TEST_SRCDIR/{workspace_name} (which would be fine) but is, instead, just TEST_SRCDIR. |
At least, if we want to actually specify a workspace name. |
Sigh; actually while it is a hurdle, we're already doing some shenanigans to work around it. Having to include the workspace name in those shouldn't be too additionally onerous. |
I think the TEST_SRCDIR thing is actually a bug, it should be TEST_SRCDIR/{workspace_name}. |
Actually, no, just checked it out and it and TEST_SRCDIR does not include the workspace name internally, so bazel shouldn't either. Sorry :-/ |
Assuming "google3" is the internal workspace name (which it appears to be), PWD is documented as being "TEST_SRCDIR/google3". And my experiment shows that the documentation is correct. |
Actually, sorry for the confusion, there appears to be something else going on as a quick test in #1126 demonstrates that this is consistent with internal blaze and I'm not sure how our PWD is getting changed. |
…directory This also sets the Bazel workspace name to io_bazel_source. Fixes #848. Relevant to #1116, #1124, RELNOTES[INC]: All repositories are now directly under the x.runfiles directory in the runfiles tree (previously, external repositories were at x.runfiles/main-repo/external/other-repo. This simplifies handling remote repository runfiles considerably, but will break existing references to external repository runfiles. --- Furthermore, if a Bazel project does not provide a workspace name in the WORKSPACE file, Bazel will now default to using __main__ as the workspace name (instead of "", as previously). The repository's runfiles will appear under x.runfiles/__main__/. -- MOS_MIGRATED_REVID=120224534
*** Reason for rollback *** Broke non-Bazel projects on ci.bazel.io Fixes #1168 *** Original change description *** Move the runfiles for external repositories to under the x.runfiles/ directory This also sets the Bazel workspace name to io_bazel_source. Fixes #848. Relevant to #1116, #1124, RELNOTES[INC]: All repositories are now directly under the x.runfiles directory in the runfiles tree (previously, external repositories were at x.runfiles/main-repo/external/other-repo. This simplifies handling remote repository runfiles considerably, but will break existing references to external repository runfiles.... *** -- MOS_MIGRATED_REVID=120535721
See #1116 for context. we should expose that information as an env variable
The text was updated successfully, but these errors were encountered: