I have been trying to build the example beginner.cc program, and have been having dependency issues, seemingly related to my version of Bazel (8.2.1).
The first problem comes from the fact that the sample uses a workspace rather than a module. I have "fixed" this by adding the following two lines to the .bazelrc file:
common --enable_bzlmod=false
common --enable_workspace
I, however, still get the following error message when trying to build.
+ set -e
+ bazel build --config=linux_cpp17 --config=linux_avx2 //:beginner_cc
INFO: Options provided by the client:
Inherited 'common' options: --isatty=1 --terminal_columns=155
INFO: Reading rc options for 'build' from /home/username/memory/ydt/.bazelrc:
Inherited 'common' options: --experimental_repo_remote_exec --enable_bzlmod=false --enable_workspace
INFO: Reading rc options for 'build' from /home/username/memory/ydt/.bazelrc:
'build' options: -c opt --spawn_strategy=standalone --announce_rc --noincompatible_strict_action_env --define=use_fast_cpp_protos=true --define=allow_oversize_protos=true --define=grpc_no_ares=true --color=yes
INFO: Found applicable config definition build:linux_cpp17 in file /home/username/memory/ydt/.bazelrc: --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 --config=linux
INFO: Found applicable config definition build:linux in file /home/username/memory/ydt/.bazelrc: --copt=-fdiagnostics-color=always --copt=-w --host_copt=-w
INFO: Found applicable config definition build:linux_avx2 in file /home/username/memory/ydt/.bazelrc: --copt=-mavx2
WARNING: WORKSPACE support will be removed in Bazel 9 (late 2025), please migrate to Bzlmod, see https://bazel.build/external/migration.
ERROR: Error computing the main repository mapping: cannot load '@@rules_java//java:rules_java_deps.bzl': no such file
Computing main repo mapping:
I am assuming that I am missing some dependency, but it is unclear to me if I should be adding something to the workspace or simply downgrading my Bazel to fix this. I am fine with either option, but if I should be downgrading, I am not sure which version to downgrade to.
I have been trying to build the example beginner.cc program, and have been having dependency issues, seemingly related to my version of Bazel (8.2.1).
The first problem comes from the fact that the sample uses a workspace rather than a module. I have "fixed" this by adding the following two lines to the .bazelrc file:
I, however, still get the following error message when trying to build.
I am assuming that I am missing some dependency, but it is unclear to me if I should be adding something to the workspace or simply downgrading my Bazel to fix this. I am fine with either option, but if I should be downgrading, I am not sure which version to downgrade to.