How to pass custom flags in a `bazel query` command?

233 Views Asked by At

I try to query deps with a custom flags. For example,

bazel query --define=using_cuda=true "deps(@org_tensorflow//tensorflow/core:lib)"

Bazel complained:

ERROR: Unrecognized option: --define=using_cuda=true

How could I pass a custom flag to bazel query command?

1

There are 1 best solutions below

0
Jin On BEST ANSWER

bazel query doesn't support the --define flag because the command doesn't use it. Instead, use bazel cquery instead, which stands for "configurable query".