Skip to content

Commit

Permalink
Add no-op trimming flag.
Browse files Browse the repository at this point in the history
Subsequent safety changes will use this flag before the flag has any effect;
for now, it is a no-op, equivalent to specifying --experimental_dynamic_configs
equal to notrim (the default).

Progress on #6524.

PiperOrigin-RevId: 242741331
  • Loading branch information
mstaib authored and copybara-github committed Apr 9, 2019
1 parent 36f093a commit b4bc40a
Showing 1 changed file with 22 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -828,13 +828,24 @@ public static class Options extends FragmentOptions implements Cloneable {

/** Values for --experimental_dynamic_configs. */
public enum ConfigsMode {
/** Only include the configuration fragments each rule needs. */
/**
* Deprecated mode: Each configured target is evaluated with only the configuration fragments
* it needs by loading the target graph and examining the transitive requirements for each
* target before analysis begins.
*
* <p>To become a no-op soon: b/129289764
*/
ON,
/** Always including all fragments known to Blaze. */
/** Default mode: Each configured target is evaluated with all fragments known to Blaze. */
NOTRIM,
/**
* Experimental mode: Each configured target is evaluated with only the configuration
* fragments it needs by visiting them with a full configuration to begin with and collapsing
* the configuration down to the fragments which were actually used.
*/
RETROACTIVE;
}


/**
* Converter for --experimental_dynamic_configs.
*/
Expand Down Expand Up @@ -1757,6 +1768,14 @@ public boolean trimConfigurations() {
return options.configsMode == Options.ConfigsMode.ON;
}

/**
* Returns whether we should trim configurations to only include the fragments needed to correctly
* analyze a rule.
*/
public boolean trimConfigurationsRetroactively() {
return options.configsMode == Options.ConfigsMode.RETROACTIVE;
}

/**
* Returns compilation mode.
*/
Expand Down

0 comments on commit b4bc40a

Please sign in to comment.