Hi--
We are set up to cross-compile to different targets using --config and --define.
Some of our libraries are not cross-compiled, but we want to be able to just type "bazel build //foo/..." and not get caught up in an "invalid" build. To do this we have some macros like "linux_cc_library" that uses select({}). If the selector indicates Linux, then it just passes through to native.cc_library. If the selector indicates a different target, the macro rewrites things like "srcs", "deps", etc. to be empty lists and whatnot to try to make the build as minimal as possible.
This works for "bazel build" and "bazel test".
However, this does not work for "bazel query":
bazel query --config=other_target 'rdeps(//build/..., //third_party/mfontanini/libtins/..., 5)'
INFO: Options provided by the client:
Inherited 'common' options: --isatty=1 --terminal_columns=223
INFO: Reading options for 'query' from .bazelrc:
'query' options: --config=other_target --cpu=x86
Unrecognized option: --cpu=x86
Removing --cpu from bazelrc then causes a complaint about --define, etc.
Is this a bug, or why shouldn't this work?
Or is the desire to make human-typed "bazel build //foo/..." "just work" wrong?
We are using bazel-0.4.3
We would like to use "bazel query" to help automatically maintain our Jenkins gerrit trigger configuration.
Thanks,
--Rob