Skip to content

Commit

Permalink
Make it more obvious that method to check if Skymeld is enabled is pr…
Browse files Browse the repository at this point in the history
…eferred over the flag.

PiperOrigin-RevId: 476868462
Change-Id: I4e0ab2ef1a3dc3fe3f73c56ecca53b88e5ef2879
  • Loading branch information
joeleba authored and copybara-github committed Sep 26, 2022
1 parent 551a9d9 commit c03cb5f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ public List<String> validateOptions() {
// interleave analysis and execution in that case.
// Aquery and Cquery implicitly set --nobuild, so there's no need to have a warning here: it
// makes no different from the users' perspective.
if (getBuildOptions().mergedSkyframeAnalysisExecution
if (getBuildOptions().mergedSkyframeAnalysisExecutionDoNotUseDirectly
&& !getBuildOptions().performExecutionPhase
&& !("aquery".equals(commandName) || "cquery".equals(commandName))) {
warnings.add(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -489,14 +489,15 @@ public boolean useTopLevelTargetsForSymlinks() {
+ "line. It is an error to specify a file here as well as command-line patterns.")
public String targetPatternFile;

/** Do not use directly. Instead use {@link shouldMergeSkyframeAnalysisExecution}. */
@Option(
name = "experimental_merged_skyframe_analysis_execution",
defaultValue = "false",
documentationCategory = OptionDocumentationCategory.UNDOCUMENTED,
metadataTags = OptionMetadataTag.EXPERIMENTAL,
effectTags = {OptionEffectTag.LOADING_AND_ANALYSIS, OptionEffectTag.EXECUTION},
help = "If this flag is set, the analysis and execution phases of Skyframe are merged.")
public boolean mergedSkyframeAnalysisExecution;
public boolean mergedSkyframeAnalysisExecutionDoNotUseDirectly;

/** Converter for filesystem value checker threads. */
public static class ThreadConverter extends ResourceConverter {
Expand Down Expand Up @@ -549,11 +550,12 @@ public ThreadConverter() {
* analysis and execution in that case and --experimental_merged_skyframe_analysis_execution
* should be ignored.
*
* <p>This method should always be preferred over {@link mergedSkyframeAnalysisExecution} to
* determine whether analysis and execution should be merged.
* <p>This method should always be preferred over {@link
* mergedSkyframeAnalysisExecutionDoNotUseDirectly} to determine whether analysis and execution
* should be merged. The only exception to this is in {@link BuildRequest}.
*/
public boolean shouldMergeSkyframeAnalysisExecution() {
return mergedSkyframeAnalysisExecution && performExecutionPhase;
return mergedSkyframeAnalysisExecutionDoNotUseDirectly && performExecutionPhase;
}

/**
Expand Down

0 comments on commit c03cb5f

Please sign in to comment.