diff options
author | 2016-05-23 08:07:01 +0000 | |
---|---|---|
committer | 2016-05-23 08:26:03 +0000 | |
commit | 5a77623179445f22a3d6daf92669ddcfe0fd4c68 (patch) | |
tree | 3f652c4337010e717caeffa1480d4e5b3e96499e /src/test/java/com | |
parent | d91d047da35511487c4fcce6f5e438ba779a668b (diff) |
Make alias targets keep their own configuration.
This prevents the case of a rule acquiring the null configuration in case the alias points to an input file. Which, in turn, makes "bazel build" work for these targets. The reason it breaks is that TargetCompletionValue instances are created from the associated ConfiguredTarget in SkyframeExecutor#buildArtifacts(), which means that if the configurations do not match, TargetCompletionFunction requests a different ConfiguredTargetValue than it was created from.
Fixes #1297.
--
MOS_MIGRATED_REVID=122973526
Diffstat (limited to 'src/test/java/com')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/rules/AliasTest.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/rules/AliasTest.java b/src/test/java/com/google/devtools/build/lib/rules/AliasTest.java index 34f7336a2a..17d3ea10e8 100644 --- a/src/test/java/com/google/devtools/build/lib/rules/AliasTest.java +++ b/src/test/java/com/google/devtools/build/lib/rules/AliasTest.java @@ -46,6 +46,16 @@ public class AliasTest extends BuildViewTestCase { } @Test + public void aliasToInputFile() throws Exception { + scratch.file("a/BUILD", + "exports_files(['a'])", + "alias(name='b', actual='a')"); + + ConfiguredTarget b = getConfiguredTarget("//a:b"); + assertThat(ActionsTestUtil.baseArtifactNames(getFilesToBuild(b))).containsExactly("a"); + } + + @Test public void visibilityIsOverriddenAndIsOkay() throws Exception { scratch.file("a/BUILD", "filegroup(name='a', visibility=['//b:__pkg__'])"); |