diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 5889823d3d..9bac76f14a 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -34,6 +34,7 @@ buildifier: build_flags: - "--keep_going" - "--build_tag_filters=-integration-test" + - "--announce_rc" test_targets: - "--" - "..." @@ -522,6 +523,8 @@ tasks: platform: windows build_targets: ["//tests/integration:local_toolchains_test_bazel_self"] test_targets: ["//tests/integration:local_toolchains_test_bazel_self"] + build_flags: + - "--action_env=PATH" integration_test_compile_pip_requirements_ubuntu: <<: *reusable_build_test_all diff --git a/.bazelrc b/.bazelrc index d7e1771336..076a7005dd 100644 --- a/.bazelrc +++ b/.bazelrc @@ -20,6 +20,8 @@ build --incompatible_default_to_explicit_init_py # Ensure ongoing compatibility with this flag. common --incompatible_disallow_struct_provider_syntax +common --incompatible_strict_action_env + # Windows makes use of runfiles for some rules build --enable_runfiles diff --git a/examples/bzlmod/.bazelrc b/examples/bzlmod/.bazelrc index ca83047ccc..25fc442c81 100644 --- a/examples/bzlmod/.bazelrc +++ b/examples/bzlmod/.bazelrc @@ -7,4 +7,5 @@ test --test_output=errors --enable_runfiles # Windows requires these for multi-python support: build --enable_runfiles +build --incompatible_strict_action_env common:bazel7.x --incompatible_python_disallow_native_rules diff --git a/tests/integration/custom_commands_test.py b/tests/integration/custom_commands_test.py index 2e9cb741b0..e028ebac50 100644 --- a/tests/integration/custom_commands_test.py +++ b/tests/integration/custom_commands_test.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import logging import unittest from tests.integration import runner @@ -21,7 +20,9 @@ class CustomCommandsTest(runner.TestCase): # Regression test for https://github.com/bazel-contrib/rules_python/issues/1840 def test_run_build_python_zip_false(self): - result = self.run_bazel("run", "--build_python_zip=false", "//:bin") + result = self.run_bazel( + "run", "--build_python_zip=false", "--action_env=PATH", "//:bin" + ) self.assert_result_matches(result, "bazel-out") diff --git a/tests/integration/runner.py b/tests/integration/runner.py index 2534ab2d90..7fcf5de1a4 100644 --- a/tests/integration/runner.py +++ b/tests/integration/runner.py @@ -82,6 +82,7 @@ def setUp(self): self.tmp_dir = outer_test_tmpdir / "bit_tmp" self.bazel_env = { "PATH": os.environ["PATH"], + "HOME": os.environ["HOME"], "TEST_TMPDIR": str(self.test_tmp_dir), "TMP": str(self.tmp_dir), # For some reason, this is necessary for Bazel 6.4 to work.