-
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
Respect main repository mapping in platform_mappings
#17133
Conversation
9239013
to
ad0b3d4
Compare
I'm rather clueless about the remaining test failures as these tests don't use non-trivial repository mappings:
|
last time I tried to fix this, I ran into some circular dependency problems in Bazel's test setup code. Don't remember exactly what was in the cycle, but I gave up fairly quickly and thought nobody would be using platform mappings anyway. Guess I was wrong :P |
I do rely on them for macOS cross-compilation. I will take another stab at fixing these failures. |
@katre Do you happen to have an idea what to do about the test failures? |
Not offhand, but I'll try and take a look and see if I can figure anything out. |
Friendly bump on this. |
Okay, I rebased this to the current master and looked at the failures. The core problem is that the expected error (in the case of I don't know why this PR caused a change in error handling: possibly things are being evaluated earlier? The fix is probably to handle the errors properly, but I don't know how. @Wyverald, any ideas? |
ad0b3d4
to
2fb16a0
Compare
2fb16a0
to
76382a2
Compare
Ping 🙏 |
I'll try to carve some time next week to look at this again. AFAIK what was hard about it last time (see above) is still hard today (see test failures...). |
bbb840e
to
c78c5a1
Compare
I got this down to a single type of failure:
@meteorcloudy This looks like something you may know how to solve. |
This is because for the new workspace, it's missing setup from https://cs.opensource.google/bazel/bazel/+/refs/heads/master:src/test/java/com/google/devtools/build/lib/analysis/util/BuildViewTestCase.java;l=405-408 I tired to reuse the WORKSPACE file, it seems working:
|
c78c5a1
to
36d0275
Compare
@meteorcloudy Thanks, that fixed the test. I could of course add that line to bazel/src/test/java/com/google/devtools/build/lib/skyframe/PlatformMappingFunctionTest.java Line 150 in 36d0275
but the whole point of that test seems to be that there is no WORKSPACE file. I am not sure how this can work, but I also don't know anything about --package_path . Can this test be dropped?
|
I believe Could adding a |
I did, that fails with
This happens because |
Oh, I see. That's unfortunate. I don't have any better idea than disabling the test :( If I really wanted to, I'd poke at |
@@ -232,12 +232,19 @@ private static Label convertOptionsLabel(String input, @Nullable Object conversi | |||
return Label.parseCanonical(input); | |||
} | |||
Preconditions.checkArgument( | |||
conversionContext instanceof RepositoryMapping, | |||
conversionContext instanceof RepositoryMapping |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
quick question -- this change shouldn't be necessary, right? everything in the platform mapping file should be anchored to the main repo? (it looks like you're passing around a mainRepoContext
that always has RepositoryName.MAIN
, instead of a mainRepoMapping
; I think the latter would be less cognitive burden.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found it confusing that RepoContext
is not a valid conversionContext
, but RepositoryMapping
is - it doesn't matter that much though and RepoContext
does have redundant information, so I reverted this part.
1aea2de
to
c9d7cb0
Compare
c9d7cb0
to
d4a88cc
Compare
@Wyverald Friendly ping |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for fixing this! and sorry for the long delay.
I'm still not entirely sure how you worked around the nasty dependency cycles in the tests, but for now I'll just be happy that you did and move along :)
Glad that you aren't sure since I have no idea :-D I suspect that something changed on |
@bazel-io flag |
@bazel-io fork 6.4.0 |
@fmeum @brentleyjones @Wyverald @lberki @katre @meteorcloudy We tried to cherry-pick this change to release-6.4.0. However, there were some conflicts. Can you please take a look?
However, we expected the below before the cherry-picking
is missing, but should be present already in the release-6.4.0 branch before cherry-picking
is missing, but should be present already in the release-6.4.0 branch before cherry-picking
But we expected below before the cherry-picking
should already be in the release-6.4.0 branch.
But, expected below before cherry-picking
is currently missing in the release-6.4.0 branch
But we expected below before cherry-picking
cc: @bazelbuild/triage |
Fixes bazelbuild#17127 Closes bazelbuild#17133. PiperOrigin-RevId: 563803704 Change-Id: I0f49fbfce624207b81a6ca4f7e564d9f3b525d54
@iancha1992 I cherry-picked this manually in #19495. |
Fixes #17127