Skip to content

Commit

Permalink
Introduce --incompatible_disable_legacy_cpp_toolchain_skylark_api fla…
Browse files Browse the repository at this point in the history
…g to replace --incompatible_enable_legacy_cpp_toolchain_skylark_api because of backwards compatibility policy.

--all_incompatible_changes triggers flag flips in the false -> true direction, but not the other way around, this is to make --all_incompatible_changes work properly.

RELNOTES: None.
PiperOrigin-RevId: 211332490
  • Loading branch information
scentini authored and Copybara-Service committed Sep 3, 2018
1 parent 310844a commit bc434bc
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1192,7 +1192,8 @@ public boolean enableCcDynamicLibrariesForRuntime() {
}

private void checkForToolchainSkylarkApiAvailability() throws EvalException {
if (!cppOptions.enableLegacyToolchainSkylarkApi) {
if (cppOptions.disableLegacyToolchainSkylarkApi
|| !cppOptions.enableLegacyToolchainSkylarkApi) {
throw new EvalException(null, "Information about the C++ toolchain API is not accessible "
+ "anymore through ctx.fragments.cpp . Use CcToolchainInfo instead.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -756,11 +756,26 @@ public Label getFdoPrefetchHintsLabel() {
documentationCategory = OptionDocumentationCategory.UNDOCUMENTED,
effectTags = {OptionEffectTag.LOADING_AND_ANALYSIS},
metadataTags = {
OptionMetadataTag.INCOMPATIBLE_CHANGE,
OptionMetadataTag.TRIGGERED_BY_ALL_INCOMPATIBLE_CHANGES},
help = "Flag for disabling access to the C++ toolchain API through the ctx.fragments.cpp .")
OptionMetadataTag.INCOMPATIBLE_CHANGE,
OptionMetadataTag.TRIGGERED_BY_ALL_INCOMPATIBLE_CHANGES
},
help =
"Do not use this flag. Use --incompatible_disable_legacy_cpp_toolchain_skylark_api "
+ "instead.")
public boolean enableLegacyToolchainSkylarkApi;

@Option(
name = "incompatible_disable_legacy_cpp_toolchain_skylark_api",
defaultValue = "false",
documentationCategory = OptionDocumentationCategory.UNDOCUMENTED,
effectTags = {OptionEffectTag.LOADING_AND_ANALYSIS},
metadataTags = {
OptionMetadataTag.INCOMPATIBLE_CHANGE,
OptionMetadataTag.TRIGGERED_BY_ALL_INCOMPATIBLE_CHANGES
},
help = "Flag for disabling access to the C++ toolchain API through the ctx.fragments.cpp .")
public boolean disableLegacyToolchainSkylarkApi;

@Option(
name = "experimental_disable_legacy_cc_linking_api",
defaultValue = "false",
Expand Down

0 comments on commit bc434bc

Please sign in to comment.