Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bazel CI] Build failed with "error loading package 'external'" when both --enable_bzlmod and --enable_workspace are disabled #2175

Closed
sgowroji opened this issue Sep 2, 2024 · 3 comments · Fixed by #2184

Comments

@sgowroji
Copy link
Member

sgowroji commented Sep 2, 2024

CI: https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/4093#0191abc3-f278-4c75-9d49-f2a4421c05ff

Platform: Ubuntu

Logs:

ERROR: �[0merror loading package 'external': Both --enable_bzlmod and --enable_workspace are disabled, but one of them must be enabled to fetch external dependencies.

Culprit: bazelbuild/bazel@5881c38

Note : This issue is due to bazelbuild/bazel#23023. After --enable_workspace is flipped to false, users have to explicitly specify it where it's needed, or fully migrate to Bzlmod.

CC Greenteam @fweikert

@aignas
Copy link
Collaborator

aignas commented Sep 2, 2024

FYI, the parts of the code that rely on this include (but this is not necessarily the full list) are:

$ git grep -w '/external'
WORKSPACE:# rules_proto expects //external:python_headers to point at the python headers.
WORKSPACE.bzlmod:# rules_proto expects //external:python_headers to point at the python headers.
docs/pypi-dependencies.md:ERROR: .../external/pypi_sphinxcontrib_serializinghtml/BUILD.bazel:44:6: in alias rule @pypi
_sphinxcontrib_serializinghtml//:pkg: cycle in dependency graph:
python/private/pypi/attrs.bzl:  ERROR: .../external/pypi_sphinxcontrib_serializinghtml/BUILD.bazel:44:6: in alias rule
 @pypi_sphinxcontrib_serializinghtml//:pkg: cycle in dependency graph:
python/private/stage2_bootstrap_template.py:                "*/external/*",

$ git grep -w 'external/'
examples/pip_parse/pip_parse_test.py:        # Removes the first two directories (external/<reponame>)
examples/pip_repository_annotations/pip_repository_annotations_test.py:            "pip_repository_annotations_example
/external/{}/generated_file.txt".format(
examples/pip_repository_annotations/pip_repository_annotations_test.py:            "pip_repository_annotations_example
/external/{}/copied_content/file.txt".format(
examples/pip_repository_annotations/pip_repository_annotations_test.py:            "pip_repository_annotations_example
/external/{}/copied_content/executable{}".format(
examples/pip_repository_annotations/pip_repository_annotations_test.py:        dist_info_dir = "pip_repository_annotat
ions_example/external/{}/site-packages/wheel-{}.dist-info".format(
examples/pip_repository_annotations/pip_repository_annotations_test.py:            "pip_repository_annotations_example
/external/{}/generated_file.txt".format(
python/private/stage2_bootstrap_template.py:                "*/external/*",

Wyverald added a commit that referenced this issue Sep 4, 2024
Only do this for latest Bazel (--enable_workspace was only introduced in 7.1.0).

Fixes #2175
github-merge-queue bot pushed a commit that referenced this issue Sep 5, 2024
…2184)

Only do this for latest Bazel (--enable_workspace was only introduced in
7.1.0).

Fixes #2175
@sgowroji
Copy link
Member Author

sgowroji commented Sep 9, 2024

@aignas @Wyverald  CI is stilling failing with same error https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/4111#0191d504-1e6f-4f1c-8047-abf14b31b4eb Can you please take a look. Thanks!

@aignas
Copy link
Collaborator

aignas commented Sep 9, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants