Search code examples
buildbazelarm64google-coral

"no such package '@bazel_tools//platforms'" when building with bazel


I'm trying to run some example ml projects on a variscite board (aarch64 cpu). They have libcoral as a requirement, which itself builds with Bazel.

I've successfully built Bazel in this environment, using the build-from-scratch guide here, and am now attempting to build libcoral following the instructions here. However, I'm getting the following error:

make CPU=aarch64
Loading: 0 packages loaded
bazel build --compilation_mode=opt --cpu=aarch64 --copt=-ffp-contract=off //coral:bbox_test //coral:error_reporter_test //coral:inference_repeatability_test //coral:inference_stress_test //coral:model_loading_stress_test //coral:multiple_tpus_inference_stress_test //coral:segmentation_models_test //coral:test_utils_test //coral:tflite_utils_test //coral/classification:adapter_test //coral/classification:classification_models_test //coral/classification:cocompiled_classification_models_test //coral/classification:lstm_mnist_models_test //coral/detection:adapter_test //coral/detection:models_test //coral/dmabuf:dmabuf_devboard_test //coral/dmabuf:model_pipelining_dmabuf_devboard_test //coral/learn:imprinting_engine_test //coral/learn:utils_test //coral/learn/backprop:layers_test //coral/learn/backprop:multi_variate_normal_distribution_test //coral/learn/backprop:softmax_regression_model_test //coral/learn/backprop:test_utils_test //coral/pipeline:detection_models_test //coral/pipeline:models_test //coral/pipeline:pipelined_model_runner_test //coral/pipeline/internal:memory_pool_allocator_test //coral/pipeline/internal:segment_runner_test //coral/pose_estimation:bodypix_test //coral/pose_estimation:movenet_test //coral/pose_estimation:posenet_decoder_test //coral/pose_estimation:posenet_test //coral/tools:automl_model_append_rnn_link_test //coral/tools:tflite_graph_util_test //coral/tools/partitioner:parameter_count_based_partitioner_test //coral/tools/partitioner:profiling_based_partitioner_ondevice_test //coral/tools/partitioner:profiling_based_partitioner_test //coral/tools/partitioner:utils_test
ERROR: no such package '@bazel_tools//platforms': BUILD file not found in directory 'platforms' of external repository @bazel_tools. Add a BUILD file to a directory to mark it as a package.

I took this as meaning that Bazel is not properly installed. However, merely re-compiling it leads to the same issue. I also haven't found anyone having an issue like this online, and double checking compatibility leads me to believe that's not the issue either... Any idea what might be causing this?


Solution

  • The platforms under @bazel_tools//platforms/... are being removed in Bazel 7.0 in favor of a separate platforms repository. See:

    https://github.com/bazelbuild/bazel/issues/8622

    It looks like the example will need to be updated. You might be able to update the example locally using the migration tips in the issue above.