Skip to content

Commit

Permalink
Skylark: Make 'cfg = "data"' a noop.
Browse files Browse the repository at this point in the history
This is no longer meaningful with the turndown of
(C++) LIPO.

PiperOrigin-RevId: 198092974
  • Loading branch information
gregestren authored and Copybara-Service committed May 25, 2018
1 parent c6cf1b9 commit 10a6130
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
import com.google.devtools.build.lib.analysis.config.HostTransition;
import com.google.devtools.build.lib.analysis.config.transitions.PatchTransition;
import com.google.devtools.build.lib.analysis.config.transitions.SplitTransition;
import com.google.devtools.build.lib.events.Location;
import com.google.devtools.build.lib.packages.Attribute;
Expand All @@ -45,7 +44,6 @@
import com.google.devtools.build.lib.syntax.SkylarkDict;
import com.google.devtools.build.lib.syntax.SkylarkList;
import com.google.devtools.build.lib.syntax.SkylarkType;
import com.google.devtools.build.lib.syntax.SkylarkUtils;
import com.google.devtools.build.lib.syntax.Type;
import com.google.devtools.build.lib.syntax.Type.ConversionException;
import com.google.devtools.build.lib.syntax.Type.LabelClass;
Expand Down Expand Up @@ -226,7 +224,9 @@ && containsNonNoneKey(arguments, ALLOW_SINGLE_FILE_ARG)) {
if (containsNonNoneKey(arguments, CONFIGURATION_ARG)) {
Object trans = arguments.get(CONFIGURATION_ARG);
if (trans.equals("data")) {
builder.cfg((PatchTransition) SkylarkUtils.getLipoDataTransition(env));
// This used to apply the "disable LIPO" (a.k.a. "data") transition. But now that LIPO is
// turned down this is a noop. Still, there are cfg = "data"' references in the depot. So
// we have to remove them via b/28688645 before we can remove this path.
} else if (trans.equals("host")) {
builder.cfg(HostTransition.INSTANCE);
} else if (trans instanceof SplitTransition) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
import com.google.devtools.build.lib.packages.SkylarkProvider;
import com.google.devtools.build.lib.packages.SkylarkProviderIdentifier;
import com.google.devtools.build.lib.packages.StructProvider;
import com.google.devtools.build.lib.rules.cpp.transitions.DisableLipoTransition;
import com.google.devtools.build.lib.skyframe.SkylarkImportLookupFunction;
import com.google.devtools.build.lib.skylark.util.SkylarkTestCase;
import com.google.devtools.build.lib.syntax.BuildFileAST;
Expand Down Expand Up @@ -542,12 +541,6 @@ public void testAttrCfg() throws Exception {
assertThat(attr.getConfigurationTransition().isHostTransition()).isTrue();
}

@Test
public void testAttrCfgData() throws Exception {
Attribute attr = buildAttribute("a1", "attr.label(cfg = 'data', allow_files = True)");
assertThat(attr.getConfigurationTransition()).isEqualTo(DisableLipoTransition.INSTANCE);
}

@Test
public void testAttrCfgTarget() throws Exception {
Attribute attr = buildAttribute("a1", "attr.label(cfg = 'target', allow_files = True)");
Expand Down

0 comments on commit 10a6130

Please sign in to comment.