buildtools
buildtools copied to clipboard
ERROR: --noenable_bzlmod :: Unrecognized option: --noenable_bzlmod
~/buildtools$ bazel build //buildifier //buildozer //unused_deps
INFO: Reading rc options for 'build' from /home/hlb/buildtools/.bazelrc:
Inherited 'common' options: --noenable_bzlmod
ERROR: --noenable_bzlmod :: Unrecognized option: --noenable_bzlmod
If I comment # common --noenable_bzlmod
, then:
~/buildtools$ bazel build //buildifier //buildozer //unused_deps
ERROR: /home/hlb/.cache/bazel/_bazel_hlb/5a84903b8aa4b1e2fce09ccd833212fb/external/io_bazel_rules_go/go/private/sdk.bzl:563:12: name 'json' is not defined
ERROR: error loading package '': in /home/hlb/.cache/bazel/_bazel_hlb/5a84903b8aa4b1e2fce09ccd833212fb/external/io_bazel_rules_go/go/deps.bzl: Extension 'go/private/sdk.bzl' has errors
INFO: Elapsed time: 0.043s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
I had the same problem, have you solved it yet?
~/buildtools$ bazel build //buildifier //buildozer //unused_deps INFO: Reading rc options for 'build' from /home/hlb/buildtools/.bazelrc: Inherited 'common' options: --noenable_bzlmod ERROR: --noenable_bzlmod :: Unrecognized option: --noenable_bzlmod If I comment
# common --noenable_bzlmod
, then: ~/buildtools$ bazel build //buildifier //buildozer //unused_deps ERROR: /home/hlb/.cache/bazel/_bazel_hlb/5a84903b8aa4b1e2fce09ccd833212fb/external/io_bazel_rules_go/go/private/sdk.bzl:563:12: name 'json' is not defined ERROR: error loading package '': in /home/hlb/.cache/bazel/_bazel_hlb/5a84903b8aa4b1e2fce09ccd833212fb/external/io_bazel_rules_go/go/deps.bzl: Extension 'go/private/sdk.bzl' has errors INFO: Elapsed time: 0.043s INFO: 0 processes. FAILED: Build did NOT complete successfully (0 packages loaded)
Same problem
$ bazel build :protoc :protobuf
Starting local Bazel server and connecting to it...
INFO: Reading rc options for 'build' from /home/huidongc/github/protobuf/.bazelrc:
Inherited 'common' options: --noenable_bzlmod --repo_env=BAZEL_NO_APPLE_CPP_TOOLCHAIN=1
ERROR: --noenable_bzlmod :: Unrecognized option: --noenable_bzlmod
After upgrading Bazel, the issue is gone.
ERROR: --noenable_bzlmod :: Unrecognized option: --noenable_bzlmod. The cause is the version of bazel is too old. vim ~/.bazeliskrc USE_BAZEL_VERSION=7.1.2
using the latest vesion. the error is gone.
I assume the error is no longer reproducible with updated Bazel, if it is please feel free to reopen the bug.