|
15 | 15 |
|
16 | 16 | import com.google.common.base.Splitter;
|
17 | 17 | import com.google.common.collect.ImmutableSet;
|
18 |
| -import com.google.devtools.build.lib.actions.ActionAnalysisMetadata; |
19 | 18 | import com.google.devtools.build.lib.analysis.config.CompilationMode;
|
20 | 19 | import com.google.devtools.build.lib.analysis.config.CoreOptionConverters.EmptyToNullLabelConverter;
|
21 | 20 | import com.google.devtools.build.lib.analysis.config.CoreOptionConverters.LabelConverter;
|
22 | 21 | import com.google.devtools.build.lib.analysis.config.FragmentOptions;
|
23 | 22 | import com.google.devtools.build.lib.analysis.config.PerLabelOptions;
|
24 | 23 | import com.google.devtools.build.lib.cmdline.Label;
|
25 |
| -import com.google.devtools.build.lib.cmdline.PackageIdentifier; |
26 | 24 | import com.google.devtools.build.lib.rules.cpp.CppConfiguration.DynamicMode;
|
27 | 25 | import com.google.devtools.build.lib.rules.cpp.CppConfiguration.StripMode;
|
28 | 26 | import com.google.devtools.common.options.Converter;
|
@@ -82,10 +80,7 @@ public static class LibcTopLabelConverter implements Converter<Label> {
|
82 | 80 | @Nullable
|
83 | 81 | @Override
|
84 | 82 | public Label convert(String input, Object conversionContext) throws OptionsParsingException {
|
85 |
| - if (input.equals(TARGET_LIBC_TOP_NOT_YET_SET)) { |
86 |
| - return Label.createUnvalidated( |
87 |
| - PackageIdentifier.EMPTY_PACKAGE_ID, TARGET_LIBC_TOP_NOT_YET_SET); |
88 |
| - } else if (input.equals("default")) { |
| 83 | + if (input.equals("default")) { |
89 | 84 | // This is needed for defining config_setting() values, the syntactic form
|
90 | 85 | // of which must be a String, to match absence of a --grte_top option.
|
91 | 86 | // "--grte_top=default" works on the command-line too,
|
@@ -693,42 +688,6 @@ public Label getMemProfProfileLabel() {
|
693 | 688 | + "for the exec configuration.")
|
694 | 689 | public Label hostLibcTopLabel;
|
695 | 690 |
|
696 |
| - /** See {@link #targetLibcTopLabel} documentation. * */ |
697 |
| - private static final String TARGET_LIBC_TOP_NOT_YET_SET = "TARGET LIBC TOP NOT YET SET"; |
698 |
| - |
699 |
| - /** |
700 |
| - * This is a fake option used to pass data from target configuration to the exec configuration. |
701 |
| - * It's a horrible hack that will be removed once toolchain-transitions are implemented. |
702 |
| - * |
703 |
| - * <p>We want to make sure this stays bound to the top-level configuration (as opposed to a |
704 |
| - * configuration that comes out of a transition). Otherwise we risk multiple exec configurations |
705 |
| - * writing to the same path and creating C++ action conflicts (C++ actions can not be shared |
706 |
| - * across configurations: see {@link ActionAnalysisMetadata#isShareable}). |
707 |
| - * |
708 |
| - * <p>To accomplish this, we initialize this to a special value that means "I haven't been set |
709 |
| - * yet" and use {@link #getNormalized} to rewrite it to {@link #libcTopLabel} <b>only</b> from |
710 |
| - * that default. Blaze always evaluates top-level configurations first, so they'll trigger this. |
711 |
| - * But no followup transitions can. |
712 |
| - * |
713 |
| - * <p>It's not sufficient to use null for the default. That wouldn't handle the case of the |
714 |
| - * top-level {@link #libcTopLabel} being null and {@link |
715 |
| - * com.google.devtools.build.lib.rules.android.AndroidConfiguration.Options#androidLibcTopLabel} |
716 |
| - * being non-null. |
717 |
| - */ |
718 |
| - // TODO(b/129045294): Remove once toolchain-transitions are implemented. |
719 |
| - @Option( |
720 |
| - name = "target libcTop label", |
721 |
| - defaultValue = TARGET_LIBC_TOP_NOT_YET_SET, |
722 |
| - documentationCategory = OptionDocumentationCategory.UNDOCUMENTED, |
723 |
| - converter = LibcTopLabelConverter.class, |
724 |
| - effectTags = { |
725 |
| - OptionEffectTag.LOSES_INCREMENTAL_STATE, |
726 |
| - OptionEffectTag.AFFECTS_OUTPUTS, |
727 |
| - OptionEffectTag.LOADING_AND_ANALYSIS |
728 |
| - }, |
729 |
| - metadataTags = {OptionMetadataTag.INTERNAL}) |
730 |
| - public Label targetLibcTopLabel; |
731 |
| - |
732 | 691 | @Option(
|
733 | 692 | name = "experimental_inmemory_dotd_files",
|
734 | 693 | defaultValue = "true",
|
@@ -1041,20 +1000,4 @@ public Label getMemProfProfileLabel() {
|
1041 | 1000 | metadataTags = {OptionMetadataTag.EXPERIMENTAL},
|
1042 | 1001 | help = "If enabled, a Starlark version of compiling is used.")
|
1043 | 1002 | public boolean experimentalStarlarkCompiling;
|
1044 |
| - |
1045 |
| - /** See {@link #targetLibcTopLabel} documentation. * */ |
1046 |
| - @Override |
1047 |
| - public FragmentOptions getNormalized() { |
1048 |
| - CppOptions newOptions = (CppOptions) this.clone(); |
1049 |
| - boolean changed = false; |
1050 |
| - if (targetLibcTopLabel != null |
1051 |
| - && targetLibcTopLabel.getName().equals(TARGET_LIBC_TOP_NOT_YET_SET)) { |
1052 |
| - newOptions.targetLibcTopLabel = libcTopLabel; |
1053 |
| - changed = true; |
1054 |
| - } |
1055 |
| - if (changed) { |
1056 |
| - return newOptions; |
1057 |
| - } |
1058 |
| - return this; |
1059 |
| - } |
1060 | 1003 | }
|
0 commit comments