Skip to content
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

[7.5.0] Record repo mapping entries for labels in module extension tags #25115

Merged
merged 2 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix tests
  • Loading branch information
Wyverald committed Jan 28, 2025
commit 8e3b41a39641c730ab8a76a6ad97519ee0214676
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,7 @@ public void labels_passedOnToRepoRule() throws Exception {
SkyKey extensionSkyKey =
SingleExtensionValue.key(
ModuleExtensionId.create(
Label.parseCanonicalUnchecked("@@ext+//:defs.bzl"), "ext", Optional.empty()));
Label.parseCanonicalUnchecked("@@ext~//:defs.bzl"), "ext", Optional.empty()));
EvaluationResult<SingleExtensionValue> extensionResult =
evaluator.evaluate(ImmutableList.of(extensionSkyKey), evaluationContext);
if (extensionResult.hasError()) {
Expand All @@ -911,7 +911,7 @@ public void labels_passedOnToRepoRule() throws Exception {
.get()
.moduleExtension()
.getRecordedRepoMappingEntries())
.containsCell(RepositoryName.create("foo+"), "bar", RepositoryName.create("bar+"));
.containsCell(RepositoryName.create("foo~"), "bar", RepositoryName.create("bar~"));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public void basic() throws Exception {
Label.parseCanonical("@@bar~//:pom.xml")));

assertThat(repoMappingRecorder.recordedEntries())
.containsCell(RepositoryName.create("foo+"), "bar", RepositoryName.create("bar+"));
.containsCell(RepositoryName.create("foo~"), "bar", RepositoryName.create("bar~"));
}

@Test
Expand Down
6 changes: 3 additions & 3 deletions src/test/py/bazel/bzlmod/bazel_lockfile_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1925,7 +1925,7 @@ def testExtensionRepoMappingChange_tag(self):
)

_, _, stderr = self.RunBazel(['build', ':lol'])
self.assertIn('STR=@@foo+//:lib_foo', '\n'.join(stderr))
self.assertIn('STR=@@foo~//:lib_foo', '\n'.join(stderr))

# Shutdown bazel to make sure we rely on the lockfile and not skyframe
self.RunBazel(['shutdown'])
Expand All @@ -1950,7 +1950,7 @@ def testExtensionRepoMappingChange_tag(self):
_, _, stderr = self.RunBazel(['build', ':lol'])
stderr = '\n'.join(stderr)
self.assertIn('ran the extension!', stderr)
self.assertIn('STR=@@bar+//:lib_foo', stderr)
self.assertIn('STR=@@bar~//:lib_foo', stderr)

# Shutdown bazel to make sure we rely on the lockfile and not skyframe
self.RunBazel(['shutdown'])
Expand All @@ -1970,7 +1970,7 @@ def testExtensionRepoMappingChange_tag(self):
_, _, stderr = self.RunBazel(['build', ':lol'])
stderr = '\n'.join(stderr)
self.assertNotIn('ran the extension!', stderr)
self.assertIn('STR=@@bar+//:lib_foo', stderr)
self.assertIn('STR=@@bar~//:lib_foo', stderr)

def testExtensionRepoMappingChange_loadsAndRepoRelativeLabels(self):
# Regression test for #20721; same test as above, except that the call to
Expand Down
Loading