buildtools icon indicating copy to clipboard operation
buildtools copied to clipboard

ERROR: --noenable_bzlmod :: Unrecognized option: --noenable_bzlmod

Open Lingbo-Huang opened this issue 1 year ago • 3 comments

~/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)

Lingbo-Huang avatar Dec 13 '23 07:12 Lingbo-Huang

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)

ssssaf avatar Mar 30 '24 04:03 ssssaf

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.

huidong-chen avatar May 10 '24 02:05 huidong-chen

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.

simonwu-os avatar Jun 04 '24 07:06 simonwu-os

I assume the error is no longer reproducible with updated Bazel, if it is please feel free to reopen the bug.

vladmos avatar Jul 30 '24 22:07 vladmos