Skip to content

Commit 577ad9e

Browse files
Deprecate --incompatible_repo_env_ignores_action_env
1 parent 1224c0b commit 577ad9e

File tree

4 files changed

+11
-25
lines changed

4 files changed

+11
-25
lines changed

src/main/java/com/google/devtools/build/lib/analysis/config/CoreOptions.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -463,9 +463,6 @@ If specified, the value of the cpu constraint (`@platforms//cpu:cpu`) of
463463
`=name`, which unsets the variable of that name. This option can be used
464464
multiple times; for options given for the same variable, the latest wins,
465465
options for different variables accumulate.
466-
467-
Note that unless `--incompatible_repo_env_ignores_action_env` is true, all `name=value`
468-
pairs will be available to repository rules.
469466
""")
470467
public List<Converters.EnvVar> actionEnvironment;
471468

src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRulesModule.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -965,6 +965,16 @@ public static final class AllCommandGraveyardOptions extends OptionsBase {
965965
effectTags = {OptionEffectTag.NO_OP},
966966
help = "No-op.")
967967
public boolean legacyLocalFallback;
968+
969+
@Deprecated
970+
@Option(
971+
name = "incompatible_repo_env_ignores_action_env",
972+
defaultValue = "true",
973+
documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
974+
effectTags = {OptionEffectTag.NO_OP},
975+
metadataTags = {OptionMetadataTag.DEPRECATED},
976+
help = "No-op.")
977+
public boolean repoEnvIgnoresActionEnv;
968978
}
969979

970980
@Override

src/main/java/com/google/devtools/build/lib/runtime/CommandEnvironment.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -345,18 +345,12 @@ public void exit(AbruptExitException exception) {
345345
switch (envVar) {
346346
case Converters.EnvVar.Set(String name, String value) -> {
347347
visibleActionEnv.remove(name);
348-
if (!options.getOptions(CommonCommandOptions.class).repoEnvIgnoresActionEnv) {
349-
repoEnv.put(name, value);
350-
}
351348
}
352349
case Converters.EnvVar.Inherit(String name) -> {
353350
visibleActionEnv.add(name);
354351
}
355352
case Converters.EnvVar.Unset(String name) -> {
356353
visibleActionEnv.remove(name);
357-
if (!options.getOptions(CommonCommandOptions.class).repoEnvIgnoresActionEnv) {
358-
repoEnv.remove(name);
359-
}
360354
}
361355
}
362356
}
@@ -972,9 +966,7 @@ public String determineOutputFileSystem() {
972966
}
973967

974968
/**
975-
* Returns the repository environment created from the client environment, {@code --repo_env}, and
976-
* {@code --action_env=NAME=VALUE} (when {@code
977-
* --incompatible_repo_env_ignores_action_env=false}).
969+
* Returns the repository environment created from the client environment and {@code --repo_env}.
978970
*/
979971
public Map<String, String> getRepoEnv() {
980972
return Collections.unmodifiableMap(repoEnv);

src/main/java/com/google/devtools/build/lib/runtime/CommonCommandOptions.java

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -621,19 +621,6 @@ public String getTypeDescription() {
621621
""")
622622
public List<Converters.EnvVar> repositoryEnvironment;
623623

624-
@Option(
625-
name = "incompatible_repo_env_ignores_action_env",
626-
defaultValue = "true",
627-
documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
628-
effectTags = {OptionEffectTag.LOADING_AND_ANALYSIS},
629-
metadataTags = {OptionMetadataTag.INCOMPATIBLE_CHANGE},
630-
help =
631-
"""
632-
If true, <code>--action_env=NAME=VALUE</code> will no longer affect repository rule \
633-
and module extension environments.
634-
""")
635-
public boolean repoEnvIgnoresActionEnv;
636-
637624
@Option(
638625
name = "heuristically_drop_nodes",
639626
oldName = "experimental_heuristically_drop_nodes",

0 commit comments

Comments
 (0)