From 879fa812100e43d4db4a9ee39771e0d15ef779ad Mon Sep 17 00:00:00 2001 From: Markus Hofbauer Date: Mon, 21 Jul 2025 11:22:26 +0200 Subject: [PATCH 1/2] Flip incompatible_strict_action_env --- .../devtools/build/lib/bazel/rules/BazelRuleClassProvider.java | 2 +- .../devtools/build/lib/remote/options/RemoteOptions.java | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRuleClassProvider.java b/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRuleClassProvider.java index 6a544cc9f0b2a3..09bd7420b4e97d 100644 --- a/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRuleClassProvider.java +++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRuleClassProvider.java @@ -75,7 +75,7 @@ public static class StrictActionEnvOptions extends FragmentOptions { @Option( name = "incompatible_strict_action_env", oldName = "experimental_strict_action_env", - defaultValue = "false", + defaultValue = "true", documentationCategory = OptionDocumentationCategory.UNCATEGORIZED, effectTags = {OptionEffectTag.LOADING_AND_ANALYSIS}, metadataTags = {OptionMetadataTag.INCOMPATIBLE_CHANGE}, diff --git a/src/main/java/com/google/devtools/build/lib/remote/options/RemoteOptions.java b/src/main/java/com/google/devtools/build/lib/remote/options/RemoteOptions.java index ca802f0b116f1b..f0971010f3561b 100644 --- a/src/main/java/com/google/devtools/build/lib/remote/options/RemoteOptions.java +++ b/src/main/java/com/google/devtools/build/lib/remote/options/RemoteOptions.java @@ -741,8 +741,7 @@ public RemoteOutputsStrategyConverter() { + " affected actions.\n\n" + "In order to successfully use this feature, you likely want to set a custom" + " --host_platform together with --experimental_platform_in_output_dir (to normalize" - + " output prefixes) and --incompatible_strict_action_env (to normalize environment" - + " variables).") + + " output prefixes).") public Scrubber scrubber; @Option( From fe4238bf730aabc9d3be9e94b463a868ff62305a Mon Sep 17 00:00:00 2001 From: Markus Hofbauer Date: Mon, 21 Jul 2025 11:59:38 +0200 Subject: [PATCH 2/2] Forward path --- src/test/shell/bazel/bazel_test_test.sh | 2 +- src/test/shell/bazel/starlark_repository_test.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/shell/bazel/bazel_test_test.sh b/src/test/shell/bazel/bazel_test_test.sh index 45197bb6774759..8623dacb3172d1 100755 --- a/src/test/shell/bazel/bazel_test_test.sh +++ b/src/test/shell/bazel/bazel_test_test.sh @@ -353,7 +353,7 @@ EOF # With --action_env=PATH, the local PATH is forwarded to the test. PATH=$PATH:$PWD/scripts bazel test //testing:t1 -s --run_under=hello \ - --test_output=all >& $TEST_log || fail "Expected success" + --test_output=all --action_env=PATH >& $TEST_log || fail "Expected success" expect_log 'hello script!!! testing/t1' # We need to forward the PATH to make it work. diff --git a/src/test/shell/bazel/starlark_repository_test.sh b/src/test/shell/bazel/starlark_repository_test.sh index ff1fb9b2ca6916..4d3ce0f40c223f 100755 --- a/src/test/shell/bazel/starlark_repository_test.sh +++ b/src/test/shell/bazel/starlark_repository_test.sh @@ -2843,7 +2843,7 @@ EOF repo_cache_dir=$TEST_TMPDIR/repository_cache trap 'rm -rf ${repo_cache_dir}' EXIT - bazel build --repository_cache="$repo_cache_dir" \ + bazel build --repository_cache="$repo_cache_dir" --action_env=PATH \ //:unique_hashes >& $TEST_log || fail "expected bazel to succeed" assert_equals 1 "$(wc -l < bazel-bin/unique_hashes | tr -d ' ')" assert_equals $sha "$(cat bazel-bin/unique_hashes)"