-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
dev_dependency
to register_{execution_platforms,toolchains}
Fixes #18248 Closes #18253. PiperOrigin-RevId: 527858646 Change-Id: I544694bb55f466bd6e14660ae62f2d535c283563
- Loading branch information
1 parent
40cf855
commit f39454f
Showing
3 changed files
with
45 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -341,18 +341,21 @@ public void testRegisteredExecutionPlatforms_bzlmod() throws Exception { | |
scratch.overwriteFile( | ||
"MODULE.bazel", | ||
"register_execution_platforms('//:plat')", | ||
"register_execution_platforms('//:dev_plat',dev_dependency=True)", | ||
"bazel_dep(name='bbb',version='1.0')", | ||
"bazel_dep(name='ccc',version='1.1')"); | ||
registry | ||
.addModule( | ||
createModuleKey("bbb", "1.0"), | ||
"module(name='bbb',version='1.0')", | ||
"register_execution_platforms('//:plat')", | ||
"register_execution_platforms('//:dev_plat',dev_dependency=True)", | ||
"bazel_dep(name='ddd',version='1.0')") | ||
.addModule( | ||
createModuleKey("ccc", "1.1"), | ||
"module(name='ccc',version='1.1')", | ||
"register_execution_platforms('//:plat')", | ||
"register_execution_platforms('//:dev_plat',dev_dependency=True)", | ||
"bazel_dep(name='ddd',version='1.1')") | ||
// [email protected] is not selected | ||
.addModule( | ||
|
@@ -371,7 +374,8 @@ public void testRegisteredExecutionPlatforms_bzlmod() throws Exception { | |
moduleRoot.getRelative(repo).getRelative("BUILD").getPathString(), | ||
"platform(name='plat')"); | ||
} | ||
scratch.overwriteFile("BUILD", "platform(name='plat');platform(name='wsplat')"); | ||
scratch.overwriteFile( | ||
"BUILD", "platform(name='plat')", "platform(name='dev_plat')", "platform(name='wsplat')"); | ||
rewriteWorkspace("register_execution_platforms('//:wsplat')"); | ||
|
||
SkyKey executionPlatformsKey = RegisteredExecutionPlatformsValue.key(targetConfigKey); | ||
|
@@ -387,6 +391,7 @@ public void testRegisteredExecutionPlatforms_bzlmod() throws Exception { | |
assertExecutionPlatformLabels(result.get(executionPlatformsKey)) | ||
.containsExactly( | ||
Label.parseCanonical("//:plat"), | ||
Label.parseCanonical("//:dev_plat"), | ||
Label.parseCanonical("@@bbb~1.0//:plat"), | ||
Label.parseCanonical("@@ccc~1.1//:plat"), | ||
Label.parseCanonical("@@eee~1.0//:plat"), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -307,6 +307,7 @@ public void testRegisteredToolchains_bzlmod() throws Exception { | |
scratch.overwriteFile( | ||
"MODULE.bazel", | ||
"register_toolchains('//:tool')", | ||
"register_toolchains('//:dev_tool',dev_dependency=True)", | ||
"bazel_dep(name='bbb',version='1.0')", | ||
"bazel_dep(name='ccc',version='1.1')", | ||
"bazel_dep(name='toolchain_def',version='1.0')"); | ||
|
@@ -315,24 +316,28 @@ public void testRegisteredToolchains_bzlmod() throws Exception { | |
createModuleKey("bbb", "1.0"), | ||
"module(name='bbb',version='1.0')", | ||
"register_toolchains('//:tool')", | ||
"register_toolchains('//:dev_tool',dev_dependency=True)", | ||
"bazel_dep(name='ddd',version='1.0')", | ||
"bazel_dep(name='toolchain_def',version='1.0')") | ||
.addModule( | ||
createModuleKey("ccc", "1.1"), | ||
"module(name='ccc',version='1.1')", | ||
"register_toolchains('//:tool')", | ||
"register_toolchains('//:dev_tool',dev_dependency=True)", | ||
"bazel_dep(name='ddd',version='1.1')", | ||
"bazel_dep(name='toolchain_def',version='1.0')") | ||
// [email protected] is not selected | ||
.addModule( | ||
createModuleKey("ddd", "1.0"), | ||
"module(name='ddd',version='1.0')", | ||
"register_toolchains('//:tool')", | ||
"register_toolchains('//:dev_tool',dev_dependency=True)", | ||
"bazel_dep(name='toolchain_def',version='1.0')") | ||
.addModule( | ||
createModuleKey("ddd", "1.1"), | ||
"module(name='ddd',version='1.1')", | ||
"register_toolchains('@eee//:tool', '//:tool')", | ||
"register_toolchains('@eee//:dev_tool',dev_dependency=True)", | ||
"bazel_dep(name='eee',version='1.0')", | ||
"bazel_dep(name='toolchain_def',version='1.0')") | ||
.addModule( | ||
|
@@ -369,11 +374,13 @@ public void testRegisteredToolchains_bzlmod() throws Exception { | |
scratch.file( | ||
moduleRoot.getRelative(repo).getRelative("BUILD").getPathString(), | ||
"load('@toolchain_def//:toolchain_def.bzl', 'declare_toolchain')", | ||
"declare_toolchain(name='tool')"); | ||
"declare_toolchain(name='tool')", | ||
"declare_toolchain(name='dev_tool')"); | ||
} | ||
scratch.overwriteFile( | ||
"BUILD", | ||
"load('@toolchain_def//:toolchain_def.bzl', 'declare_toolchain')", | ||
"declare_toolchain(name='dev_tool')", | ||
"declare_toolchain(name='tool')", | ||
"declare_toolchain(name='wstool')"); | ||
rewriteWorkspace("register_toolchains('//:wstool')"); | ||
|
@@ -391,6 +398,7 @@ public void testRegisteredToolchains_bzlmod() throws Exception { | |
assertToolchainLabels(result.get(toolchainsKey)) | ||
.containsAtLeast( | ||
Label.parseCanonical("//:tool_impl"), | ||
Label.parseCanonical("//:dev_tool_impl"), | ||
Label.parseCanonical("@@bbb~1.0//:tool_impl"), | ||
Label.parseCanonical("@@ccc~1.1//:tool_impl"), | ||
Label.parseCanonical("@@eee~1.0//:tool_impl"), | ||
|