You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem occurs only when running Bazel in the docker image l.gcr.io/google/bazel. I am trying to set up CI to test, build and run coverage on GitLab CI. I added Python 3.10 toolchain and had to workaround #932
The rule causes the issue:
When the build is run in the docker image, I get an error about a builtin json module: pip_repository.bzl:175:13: name 'json' is not defined
There's the full error output. json() should be a built-in function.
🔬 Minimal Reproduction
Try cloning https://gitlab.com/yin2/language and upload it to your GitLab account. Alternatively, run docker image l.gcr.io/google/bazel:latest with the cloned sources mounted and run bazel build.
🔥 Exception or Error
$ bazel build //...
INFO: Invocation ID: b44126dd-d90f-4cf9-b41a-895b26a590cd
Loading:
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
ERROR: /root/.cache/bazel/_bazel_root/4755c6ea53a31c010470a9916f8665[40](https://gitlab.com/yin2/language/-/jobs/3583021972#L40)/external/rules_python/python/pip_install/pip_repository.bzl:175:13: name 'json' is not defined
ERROR: /root/.cache/bazel/_bazel_root/4755c6ea53a31c010470a9916f866540/external/rules_python/python/pip_install/pip_repository.bzl:184:13: name 'json' is not defined
ERROR: /root/.cache/bazel/_bazel_root/4755c6ea53a31c010470a9916f866540/external/rules_python/python/pip_install/pip_repository.bzl:193:13: name 'json' is not defined
ERROR: /root/.cache/bazel/_bazel_root/4755c6ea53a31c010470a9916f866540/external/rules_python/python/pip_install/pip_repository.bzl:298:29: name 'json' is not defined
ERROR: /root/.cache/bazel/_bazel_root/[47](https://gitlab.com/yin2/language/-/jobs/3583021972#L47)55c6ea53a31c010470a9916f866540/external/rules_python/python/pip_install/pip_repository.bzl:300:33: name 'json' is not defined
ERROR: /root/.cache/bazel/_bazel_root/4755c6ea53a31c010470a9916f866540/external/rules_python/python/pip_install/pip_repository.bzl:608:12: name 'json' is not defined
ERROR: error loading package '': in /root/.cache/bazel/_bazel_root/4755c6ea53a31c010470a9916f866540/external/rules_python/python/pip.bzl: Extension 'python/pip_install/pip_repository.bzl' has errors
INFO: Elapsed time: 3.259s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
FAILED: Build did NOT complete successfully (0 packages loaded)
Cleaning up project directory and file based variables
00:00
ERROR: Job failed: exit code 1
It looks like you are using the following versions:
Python 2.7.12
Bazel 3.5.0
rules_python_version "9bf7c49ea1920e497f857ccc1e9c2d1189c8a1c9" # Latest @ 2021-06-23
All of these are very old versions. Both those python versions and bazel versions have fallen out of LTS support. Regrettably, the maintainers are unlikely to be able to invest time investigating or fixing this issue. I suggest upgrading to supported versions of these tools.
Affected Rule
None, build fails in docker image.
Is this a regression?
N/A - Greenfield project, first time using Bazel.
Description
The problem occurs only when running Bazel in the docker image
l.gcr.io/google/bazel
. I am trying to set up CI to test, build and run coverage on GitLab CI. I added Python 3.10 toolchain and had to workaround #932The rule causes the issue:
When the build is run in the docker image, I get an error about a builtin
json
module:pip_repository.bzl:175:13: name 'json' is not defined
See https://gitlab.com/yin2/language/-/jobs/3583021972
There's the full error output.
json()
should be a built-in function.🔬 Minimal Reproduction
Try cloning https://gitlab.com/yin2/language and upload it to your GitLab account. Alternatively, run docker image l.gcr.io/google/bazel:latest with the cloned sources mounted and run
bazel build
.🔥 Exception or Error
🌍 Your Environment
Output of
bazel version
:See https://gitlab.com/yin2/language/-/jobs/3583021972
Rules_python version:
See https://gitlab.com/yin2/language/-/jobs/3583021972
The text was updated successfully, but these errors were encountered: