Skip to content

[9.0.0] Flip incompatible_strict_action_env#27670

Merged
iancha1992 merged 1 commit intobazelbuild:release-9.0.0from
bazel-io:cp26587-9.0.0
Nov 17, 2025
Merged

[9.0.0] Flip incompatible_strict_action_env#27670
iancha1992 merged 1 commit intobazelbuild:release-9.0.0from
bazel-io:cp26587-9.0.0

Conversation

@bazel-io
Copy link
Copy Markdown
Member

Work towards bazel-contrib/SIG-rules-authors#42.

Fixes #7026

Closes #26587.

PiperOrigin-RevId: 831944371
Change-Id: I397faa463a709b2367d5a6eebc678077c4029bbb

Commit e697ff7

Work towards bazel-contrib/SIG-rules-authors#42.

Fixes bazelbuild#7026

Closes bazelbuild#26587.

PiperOrigin-RevId: 831944371
Change-Id: I397faa463a709b2367d5a6eebc678077c4029bbb
@bazel-io bazel-io added team-Remote-Exec Issues and PRs for the Execution (Remote) team awaiting-review PR is awaiting review from an assigned reviewer labels Nov 13, 2025
@bazel-io bazel-io requested a review from a team as a code owner November 13, 2025 19:44
@bazel-io bazel-io added team-Remote-Exec Issues and PRs for the Execution (Remote) team awaiting-review PR is awaiting review from an assigned reviewer labels Nov 13, 2025
@meteorcloudy meteorcloudy added this pull request to the merge queue Nov 17, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 17, 2025
@meteorcloudy meteorcloudy added this pull request to the merge queue Nov 17, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 17, 2025
@meteorcloudy meteorcloudy added this pull request to the merge queue Nov 17, 2025
github-merge-queue bot pushed a commit that referenced this pull request Nov 17, 2025
Work towards
bazel-contrib/SIG-rules-authors#42.

Fixes #7026

Closes #26587.

PiperOrigin-RevId: 831944371
Change-Id: I397faa463a709b2367d5a6eebc678077c4029bbb

Commit
e697ff7

Co-authored-by: Markus Hofbauer <[email protected]>
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 17, 2025
@meteorcloudy meteorcloudy added this pull request to the merge queue Nov 17, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 17, 2025
@iancha1992 iancha1992 added this pull request to the merge queue Nov 17, 2025
Merged via the queue into bazelbuild:release-9.0.0 with commit 60c5a03 Nov 17, 2025
46 checks passed
@github-actions github-actions bot removed the awaiting-review PR is awaiting review from an assigned reviewer label Nov 17, 2025
rdesgroppes added a commit to rdesgroppes/rules_pkg that referenced this pull request Jan 21, 2026
Bazel 9 flipped `--incompatible_strict_action_env` to `true` by default
(bazelbuild/bazel#27670), which means tests no longer inherit `PATH`
from the host environment. This breaks subprocess calls that rely on
`PATH` lookup:
```
==================== Test output for //distro:packaging_test:
E.
======================================================================
ERROR: testBuild (__main__.PackagingTest.testBuild)
----------------------------------------------------------------------
Traceback (most recent call last):
[...]
    build_result = subprocess.check_output(['bazel', 'build', '--enable_workspace', ':dummy_tar'])
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[...]
FileNotFoundError: [Errno 2] No such file or directory: 'bazel'
```

This change therefore adds `env_inherit = ["PATH"]` to that very test,
which matches the behavior of earlier Bazel versions and is consistent
with the presence of a "noci" tag.

Additionally, Bazel 9 removed `WORKSPACE` support entirely
(bazelbuild/bazel#26131), requiring `bzlmod` with `MODULE.bazel`:
```
==================== Test output for //distro:packaging_test:
[...]
WARNING: --enable_bzlmod is set, but no MODULE.bazel file was found at the workspace root. Bazel will create an empty MODULE.bazel file. Please consider migrating your external dependencies from WORKSPACE to MODULE.bazel. For more details, please refer to bazelbuild/bazel#18958.
[...]
ERROR: error loading package '': Unable to find package for @@[unknown repo 'not_named_rules_pkg' requested from @@]//pkg:tar.bzl: The repository '@@[unknown repo 'not_named_rules_pkg' requested from @@]' could not be resolved: No repository visible as '@not_named_rules_pkg' from main repository.
[...]
ERROR: Build did NOT complete successfully
E.
======================================================================
ERROR: testBuild (__main__.PackagingTest.testBuild)
----------------------------------------------------------------------
[...]
    build_result = subprocess.check_output(['bazel', 'build'] + bazel_flags + [':dummy_tar'])
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[...]
subprocess.CalledProcessError: Command '['bazel', 'build', '--enable_workspace', ':dummy_tar']' returned non-zero exit status 1.
```

The test now detects the Bazel version at runtime and generates the
appropriate setup:
- Bazel 9+: `MODULE.bazel`, with `bazel_dep` and `archive_override`,
- earlier versions, as before: `WORKSPACE`, with `http_archive` and
  `--enable_workspace` flag.

For good measure, the change also addresses a leftover TODO by replacing
the `tar` subprocess invocation with pure Python code.
rdesgroppes added a commit to rdesgroppes/rules_pkg that referenced this pull request Jan 22, 2026
Bazel 9 flipped `--incompatible_strict_action_env` to `true` by default
(bazelbuild/bazel#27670), which means tests no longer inherit `PATH`
from the host environment. This breaks subprocess calls that rely on
`PATH` lookup:
```
==================== Test output for //distro:packaging_test:
E.
======================================================================
ERROR: testBuild (__main__.PackagingTest.testBuild)
----------------------------------------------------------------------
Traceback (most recent call last):
[...]
    build_result = subprocess.check_output(['bazel', 'build', '--enable_workspace', ':dummy_tar'])
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[...]
FileNotFoundError: [Errno 2] No such file or directory: 'bazel'
```

This change therefore adds `env_inherit = ["PATH"]` to that very test,
which matches the behavior of earlier Bazel versions and is consistent
with the presence of a "noci" tag.

Additionally, Bazel 9 removed `WORKSPACE` support entirely
(bazelbuild/bazel#26131), requiring `bzlmod` with `MODULE.bazel`:
```
==================== Test output for //distro:packaging_test:
[...]
WARNING: --enable_bzlmod is set, but no MODULE.bazel file was found at the workspace root. Bazel will create an empty MODULE.bazel file. Please consider migrating your external dependencies from WORKSPACE to MODULE.bazel. For more details, please refer to bazelbuild/bazel#18958.
[...]
ERROR: error loading package '': Unable to find package for @@[unknown repo 'not_named_rules_pkg' requested from @@]//pkg:tar.bzl: The repository '@@[unknown repo 'not_named_rules_pkg' requested from @@]' could not be resolved: No repository visible as '@not_named_rules_pkg' from main repository.
[...]
ERROR: Build did NOT complete successfully
E.
======================================================================
ERROR: testBuild (__main__.PackagingTest.testBuild)
----------------------------------------------------------------------
[...]
    build_result = subprocess.check_output(['bazel', 'build'] + bazel_flags + [':dummy_tar'])
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[...]
subprocess.CalledProcessError: Command '['bazel', 'build', '--enable_workspace', ':dummy_tar']' returned non-zero exit status 1.
```

The test now detects the Bazel version at runtime and generates the
appropriate setup:
- Bazel 9+: `MODULE.bazel`, with `bazel_dep` and `archive_override`,
- earlier versions, as before: `WORKSPACE`, with `http_archive` and
  `--enable_workspace` flag.

For good measure, the change also addresses a leftover TODO by replacing
the `tar` subprocess invocation with pure Python code.
rdesgroppes added a commit to rdesgroppes/rules_pkg that referenced this pull request Jan 22, 2026
Bazel 9 flipped `--incompatible_strict_action_env` to `true` by default
(bazelbuild/bazel#27670), which means tests no longer inherit `PATH`
from the host environment. This breaks subprocess calls that rely on
`PATH` lookup:
```
==================== Test output for //distro:packaging_test:
E.
======================================================================
ERROR: testBuild (__main__.PackagingTest.testBuild)
----------------------------------------------------------------------
Traceback (most recent call last):
[...]
    build_result = subprocess.check_output(['bazel', 'build', '--enable_workspace', ':dummy_tar'])
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[...]
FileNotFoundError: [Errno 2] No such file or directory: 'bazel'
```

This change therefore adds `env_inherit = ["PATH"]` to that very test,
which matches the behavior of earlier Bazel versions and is consistent
with the presence of a "noci" tag.

Additionally, Bazel 9 removed `WORKSPACE` support entirely
(bazelbuild/bazel#26131), requiring `bzlmod` with `MODULE.bazel`:
```
==================== Test output for //distro:packaging_test:
[...]
WARNING: --enable_bzlmod is set, but no MODULE.bazel file was found at the workspace root. Bazel will create an empty MODULE.bazel file. Please consider migrating your external dependencies from WORKSPACE to MODULE.bazel. For more details, please refer to bazelbuild/bazel#18958.
[...]
ERROR: error loading package '': Unable to find package for @@[unknown repo 'not_named_rules_pkg' requested from @@]//pkg:tar.bzl: The repository '@@[unknown repo 'not_named_rules_pkg' requested from @@]' could not be resolved: No repository visible as '@not_named_rules_pkg' from main repository.
[...]
ERROR: Build did NOT complete successfully
E.
======================================================================
ERROR: testBuild (__main__.PackagingTest.testBuild)
----------------------------------------------------------------------
[...]
    build_result = subprocess.check_output(['bazel', 'build'] + bazel_flags + [':dummy_tar'])
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[...]
subprocess.CalledProcessError: Command '['bazel', 'build', '--enable_workspace', ':dummy_tar']' returned non-zero exit status 1.
```

The test now detects the Bazel version at runtime and generates the
appropriate setup:
- Bazel 9+: `MODULE.bazel`, with `bazel_dep` and `archive_override`,
- earlier versions, as before: `WORKSPACE`, with `http_archive` and
  `--enable_workspace` flag.

For good measure, the change also addresses a leftover TODO by replacing
the `tar` subprocess invocation with pure Python code.
rdesgroppes added a commit to rdesgroppes/rules_pkg that referenced this pull request Jan 22, 2026
Bazel 9 flipped `--incompatible_strict_action_env` to `true` by default
(bazelbuild/bazel#27670), which means tests no longer inherit `PATH`
from the host environment. This breaks subprocess calls that rely on
`PATH` lookup:
```
==================== Test output for //distro:packaging_test:
E.
======================================================================
ERROR: testBuild (__main__.PackagingTest.testBuild)
----------------------------------------------------------------------
Traceback (most recent call last):
[...]
    build_result = subprocess.check_output(['bazel', 'build', '--enable_workspace', ':dummy_tar'])
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[...]
FileNotFoundError: [Errno 2] No such file or directory: 'bazel'
```

This change therefore adds `env_inherit = ["PATH"]` to that very test,
which matches the behavior of earlier Bazel versions and is consistent
with the presence of a "noci" tag.

Additionally, Bazel 9 removed `WORKSPACE` support entirely
(bazelbuild/bazel#26131), requiring `bzlmod` with `MODULE.bazel`:
```
==================== Test output for //distro:packaging_test:
[...]
WARNING: --enable_bzlmod is set, but no MODULE.bazel file was found at the workspace root. Bazel will create an empty MODULE.bazel file. Please consider migrating your external dependencies from WORKSPACE to MODULE.bazel. For more details, please refer to bazelbuild/bazel#18958.
[...]
ERROR: error loading package '': Unable to find package for @@[unknown repo 'not_named_rules_pkg' requested from @@]//pkg:tar.bzl: The repository '@@[unknown repo 'not_named_rules_pkg' requested from @@]' could not be resolved: No repository visible as '@not_named_rules_pkg' from main repository.
[...]
ERROR: Build did NOT complete successfully
E.
======================================================================
ERROR: testBuild (__main__.PackagingTest.testBuild)
----------------------------------------------------------------------
[...]
    build_result = subprocess.check_output(['bazel', 'build'] + bazel_flags + [':dummy_tar'])
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[...]
subprocess.CalledProcessError: Command '['bazel', 'build', '--enable_workspace', ':dummy_tar']' returned non-zero exit status 1.
```

The test now detects the Bazel version at runtime and generates the
appropriate setup:
- Bazel 9+: `MODULE.bazel`, with `bazel_dep` and `archive_override`,
- earlier versions, as before: `WORKSPACE`, with `http_archive` and
  `--enable_workspace` flag.

For good measure, the change also addresses a leftover TODO by replacing
the `tar` subprocess invocation with pure Python code.
rdesgroppes added a commit to rdesgroppes/rules_pkg that referenced this pull request Jan 22, 2026
Bazel 9 flipped `--incompatible_strict_action_env` to `true` by default
(bazelbuild/bazel#27670), which means tests no longer inherit `PATH`
from the host environment. This breaks subprocess calls that rely on
`PATH` lookup:
```
==================== Test output for //distro:packaging_test:
E.
======================================================================
ERROR: testBuild (__main__.PackagingTest.testBuild)
----------------------------------------------------------------------
Traceback (most recent call last):
[...]
    build_result = subprocess.check_output(['bazel', 'build', '--enable_workspace', ':dummy_tar'])
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[...]
FileNotFoundError: [Errno 2] No such file or directory: 'bazel'
```

This change therefore adds `env_inherit = ["PATH"]` to that very test,
which matches the behavior of earlier Bazel versions and is consistent
with the presence of a "noci" tag.

Additionally, Bazel 9 removed `WORKSPACE` support entirely
(bazelbuild/bazel#26131), requiring `bzlmod` with `MODULE.bazel`:
```
==================== Test output for //distro:packaging_test:
[...]
WARNING: --enable_bzlmod is set, but no MODULE.bazel file was found at the workspace root. Bazel will create an empty MODULE.bazel file. Please consider migrating your external dependencies from WORKSPACE to MODULE.bazel. For more details, please refer to bazelbuild/bazel#18958.
[...]
ERROR: error loading package '': Unable to find package for @@[unknown repo 'not_named_rules_pkg' requested from @@]//pkg:tar.bzl: The repository '@@[unknown repo 'not_named_rules_pkg' requested from @@]' could not be resolved: No repository visible as '@not_named_rules_pkg' from main repository.
[...]
ERROR: Build did NOT complete successfully
E.
======================================================================
ERROR: testBuild (__main__.PackagingTest.testBuild)
----------------------------------------------------------------------
[...]
    build_result = subprocess.check_output(['bazel', 'build'] + bazel_flags + [':dummy_tar'])
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[...]
subprocess.CalledProcessError: Command '['bazel', 'build', '--enable_workspace', ':dummy_tar']' returned non-zero exit status 1.
```

The test now detects the Bazel version at runtime and generates the
appropriate setup:
- Bazel 9+: `MODULE.bazel`, with `bazel_dep` and `archive_override`,
- earlier versions, as before: `WORKSPACE`, with `http_archive` and
  `--enable_workspace` flag.

For good measure, the change also addresses a leftover TODO by replacing
the `tar` subprocess invocation with pure Python code (as otherwise done
in the repo).
rdesgroppes added a commit to rdesgroppes/rules_pkg that referenced this pull request Jan 24, 2026
Bazel 9 flipped `--incompatible_strict_action_env` to `true` by default
(bazelbuild/bazel#27670), which means tests no longer inherit `PATH`
from the host environment. This breaks subprocess calls that rely on
`PATH` lookup:
```
==================== Test output for //distro:packaging_test:
E.
======================================================================
ERROR: testBuild (__main__.PackagingTest.testBuild)
----------------------------------------------------------------------
Traceback (most recent call last):
[...]
    build_result = subprocess.check_output(['bazel', 'build', '--enable_workspace', ':dummy_tar'])
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[...]
FileNotFoundError: [Errno 2] No such file or directory: 'bazel'
```

This change therefore adds `env_inherit = ["PATH"]` to that very test,
which matches the behavior of earlier Bazel versions and is consistent
with the presence of a "noci" tag.

Additionally, Bazel 9 removed `WORKSPACE` support entirely
(bazelbuild/bazel#26131), requiring `bzlmod` with `MODULE.bazel`:
```
==================== Test output for //distro:packaging_test:
[...]
WARNING: --enable_bzlmod is set, but no MODULE.bazel file was found at the workspace root. Bazel will create an empty MODULE.bazel file. Please consider migrating your external dependencies from WORKSPACE to MODULE.bazel. For more details, please refer to bazelbuild/bazel#18958.
[...]
ERROR: error loading package '': Unable to find package for @@[unknown repo 'not_named_rules_pkg' requested from @@]//pkg:tar.bzl: The repository '@@[unknown repo 'not_named_rules_pkg' requested from @@]' could not be resolved: No repository visible as '@not_named_rules_pkg' from main repository.
[...]
ERROR: Build did NOT complete successfully
E.
======================================================================
ERROR: testBuild (__main__.PackagingTest.testBuild)
----------------------------------------------------------------------
[...]
    build_result = subprocess.check_output(['bazel', 'build'] + bazel_flags + [':dummy_tar'])
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[...]
subprocess.CalledProcessError: Command '['bazel', 'build', '--enable_workspace', ':dummy_tar']' returned non-zero exit status 1.
```

The test now detects the Bazel version at runtime and generates the
appropriate setup:
- Bazel 9+: `MODULE.bazel`, with `bazel_dep` and `archive_override`,
- earlier versions, as before: `WORKSPACE`, with `http_archive` and
  `--enable_workspace` flag.

For good measure, the change also addresses a leftover TODO by replacing
the `tar` subprocess invocation with pure Python code (as otherwise done
in the repo).
aiuto pushed a commit to bazelbuild/rules_pkg that referenced this pull request Jan 29, 2026
Bazel 9 flipped `--incompatible_strict_action_env` to `true` by default
(bazelbuild/bazel#27670), which means tests no longer inherit `PATH`
from the host environment. This breaks subprocess calls that rely on
`PATH` lookup:
```
==================== Test output for //distro:packaging_test:
E.
======================================================================
ERROR: testBuild (__main__.PackagingTest.testBuild)
----------------------------------------------------------------------
Traceback (most recent call last):
[...]
    build_result = subprocess.check_output(['bazel', 'build', '--enable_workspace', ':dummy_tar'])
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[...]
FileNotFoundError: [Errno 2] No such file or directory: 'bazel'
```

This change therefore adds `env_inherit = ["PATH"]` to that very test,
which matches the behavior of earlier Bazel versions and is consistent
with the presence of a "noci" tag.

Additionally, Bazel 9 removed `WORKSPACE` support entirely
(bazelbuild/bazel#26131), requiring `bzlmod` with `MODULE.bazel`:
```
==================== Test output for //distro:packaging_test:
[...]
WARNING: --enable_bzlmod is set, but no MODULE.bazel file was found at the workspace root. Bazel will create an empty MODULE.bazel file. Please consider migrating your external dependencies from WORKSPACE to MODULE.bazel. For more details, please refer to bazelbuild/bazel#18958.
[...]
ERROR: error loading package '': Unable to find package for @@[unknown repo 'not_named_rules_pkg' requested from @@]//pkg:tar.bzl: The repository '@@[unknown repo 'not_named_rules_pkg' requested from @@]' could not be resolved: No repository visible as '@not_named_rules_pkg' from main repository.
[...]
ERROR: Build did NOT complete successfully
E.
======================================================================
ERROR: testBuild (__main__.PackagingTest.testBuild)
----------------------------------------------------------------------
[...]
    build_result = subprocess.check_output(['bazel', 'build'] + bazel_flags + [':dummy_tar'])
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[...]
subprocess.CalledProcessError: Command '['bazel', 'build', '--enable_workspace', ':dummy_tar']' returned non-zero exit status 1.
```

The test now detects the Bazel version at runtime and generates the
appropriate setup:
- Bazel 9+: `MODULE.bazel`, with `bazel_dep` and `archive_override`,
- earlier versions, as before: `WORKSPACE`, with `http_archive` and
  `--enable_workspace` flag.

For good measure, the change also addresses a leftover TODO by replacing
the `tar` subprocess invocation with pure Python code (as otherwise done
in the repo).
aiuto pushed a commit to aiuto/rules_pkg that referenced this pull request Feb 22, 2026
Bazel 9 flipped `--incompatible_strict_action_env` to `true` by default
(bazelbuild/bazel#27670), which means tests no longer inherit `PATH`
from the host environment. This breaks subprocess calls that rely on
`PATH` lookup:
```
==================== Test output for //distro:packaging_test:
E.
======================================================================
ERROR: testBuild (__main__.PackagingTest.testBuild)
----------------------------------------------------------------------
Traceback (most recent call last):
[...]
    build_result = subprocess.check_output(['bazel', 'build', '--enable_workspace', ':dummy_tar'])
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[...]
FileNotFoundError: [Errno 2] No such file or directory: 'bazel'
```

This change therefore adds `env_inherit = ["PATH"]` to that very test,
which matches the behavior of earlier Bazel versions and is consistent
with the presence of a "noci" tag.

Additionally, Bazel 9 removed `WORKSPACE` support entirely
(bazelbuild/bazel#26131), requiring `bzlmod` with `MODULE.bazel`:
```
==================== Test output for //distro:packaging_test:
[...]
WARNING: --enable_bzlmod is set, but no MODULE.bazel file was found at the workspace root. Bazel will create an empty MODULE.bazel file. Please consider migrating your external dependencies from WORKSPACE to MODULE.bazel. For more details, please refer to bazelbuild/bazel#18958.
[...]
ERROR: error loading package '': Unable to find package for @@[unknown repo 'not_named_rules_pkg' requested from @@]//pkg:tar.bzl: The repository '@@[unknown repo 'not_named_rules_pkg' requested from @@]' could not be resolved: No repository visible as '@not_named_rules_pkg' from main repository.
[...]
ERROR: Build did NOT complete successfully
E.
======================================================================
ERROR: testBuild (__main__.PackagingTest.testBuild)
----------------------------------------------------------------------
[...]
    build_result = subprocess.check_output(['bazel', 'build'] + bazel_flags + [':dummy_tar'])
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[...]
subprocess.CalledProcessError: Command '['bazel', 'build', '--enable_workspace', ':dummy_tar']' returned non-zero exit status 1.
```

The test now detects the Bazel version at runtime and generates the
appropriate setup:
- Bazel 9+: `MODULE.bazel`, with `bazel_dep` and `archive_override`,
- earlier versions, as before: `WORKSPACE`, with `http_archive` and
  `--enable_workspace` flag.

For good measure, the change also addresses a leftover TODO by replacing
the `tar` subprocess invocation with pure Python code (as otherwise done
in the repo).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team-Remote-Exec Issues and PRs for the Execution (Remote) team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants