Skip to content

Commit

Permalink
Test using an actual native transition.
Browse files Browse the repository at this point in the history
Part of bazelbuild#22248.

PiperOrigin-RevId: 631416237
Change-Id: I91d40ad30673ee352624a1580a23de3855a28bd0
  • Loading branch information
katre authored and Kila2 committed May 13, 2024
1 parent 1c0b8fd commit a15f4cc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/test/java/com/google/devtools/build/lib/analysis/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -441,11 +441,11 @@ java_test(
"//src/main/java/com/google/devtools/build/lib/actions",
"//src/main/java/com/google/devtools/build/lib/actions:artifacts",
"//src/main/java/com/google/devtools/build/lib/analysis:analysis_cluster",
"//src/main/java/com/google/devtools/build/lib/analysis:config/transitions/starlark_exposed_rule_transition_factory",
"//src/main/java/com/google/devtools/build/lib/analysis:configured_target",
"//src/main/java/com/google/devtools/build/lib/analysis/platform",
"//src/main/java/com/google/devtools/build/lib/cmdline",
"//src/main/java/com/google/devtools/build/lib/packages",
"//src/main/java/com/google/devtools/build/lib/rules/android",
"//src/main/java/com/google/devtools/build/lib/rules/java:java-compilation",
"//src/main/java/com/google/devtools/build/lib/skyframe:bzl_load_value",
"//src/main/java/com/google/devtools/build/lib/starlarkbuildapi",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import com.google.devtools.build.lib.analysis.ConfiguredTarget;
import com.google.devtools.build.lib.analysis.FilesToRunProvider;
import com.google.devtools.build.lib.analysis.actions.FileWriteAction;
import com.google.devtools.build.lib.analysis.config.transitions.StarlarkExposedRuleTransitionFactory;
import com.google.devtools.build.lib.analysis.platform.ToolchainInfo;
import com.google.devtools.build.lib.analysis.util.BuildViewTestCase;
import com.google.devtools.build.lib.cmdline.Label;
Expand All @@ -39,6 +38,7 @@
import com.google.devtools.build.lib.packages.StarlarkInfo;
import com.google.devtools.build.lib.packages.StarlarkProvider;
import com.google.devtools.build.lib.packages.StructImpl;
import com.google.devtools.build.lib.rules.android.AndroidPlatformsTransition;
import com.google.devtools.build.lib.rules.java.JavaToolchainProvider;
import com.google.devtools.build.lib.starlark.util.BazelEvaluationTestCase;
import com.google.devtools.build.lib.starlarkbuildapi.StarlarkSubruleApi;
Expand Down Expand Up @@ -700,7 +700,7 @@ public void testSubruleAttrs_cannotHaveStarlarkTransitions() throws Exception {

@Test
public void testSubruleAttrs_cannotHaveNativeTransitions() throws Exception {
ev.update("native_transition", (StarlarkExposedRuleTransitionFactory) data -> null);
ev.update("native_transition", AndroidPlatformsTransition.create());
ev.checkEvalErrorContains(
"bad cfg for attribute '_foo': subrules may only have target/exec attributes.",
"_my_subrule = subrule(",
Expand Down

0 comments on commit a15f4cc

Please sign in to comment.