From fd3bbf58e90dc4cc35b3254737ba3709901c5248 Mon Sep 17 00:00:00 2001 From: John Cater Date: Thu, 21 Dec 2017 13:49:56 -0800 Subject: Fix AliasRule to skip platform and toolchain resolution. This causes a cycle in loading when an alias of a platform or constraint is used. Fixes https://github.com/bazelbuild/rules_go/issues/1161 Change-Id: I8b19ba94bfc52221416a3d99f5e5d4d80ce15bbd PiperOrigin-RevId: 179853665 --- .../java/com/google/devtools/build/lib/rules/Alias.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/main/java/com/google/devtools/build') diff --git a/src/main/java/com/google/devtools/build/lib/rules/Alias.java b/src/main/java/com/google/devtools/build/lib/rules/Alias.java index ad4369a226..364f6744ea 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/Alias.java +++ b/src/main/java/com/google/devtools/build/lib/rules/Alias.java @@ -63,11 +63,16 @@ public class Alias implements RuleConfiguredTargetFactory { */ .removeAttribute("licenses") .removeAttribute("distribs") - .add(attr("actual", LABEL) - .allowedFileTypes(FileTypeSet.ANY_FILE) - .allowedRuleClasses(ANY_RULE) - .mandatory()) + .add( + attr("actual", LABEL) + .allowedFileTypes(FileTypeSet.ANY_FILE) + .allowedRuleClasses(ANY_RULE) + .mandatory()) .canHaveAnyProvider() + // Aliases themselves do not need toolchains or an execution platform, so this is fine. + // The actual target + // will resolve platforms and toolchains with no issues regardless of this setting. + .supportsPlatforms(false) .build(); } -- cgit v1.2.3