bazel query for cross-compiled targets?

149 views
Skip to first unread message

rober...@verbsurgical.com

unread,
Feb 28, 2017, 11:10:28 AM2/28/17
to bazel-discuss
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

Austin Schuh

unread,
Feb 28, 2017, 1:06:23 PM2/28/17
to rober...@verbsurgical.com, bazel-discuss

We have been using tags to maintain the set of targets for each platform, and that has been working pretty well.  We then use bazel query to filter the list.

Austin


--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/19acd238-fb3c-4d09-bf3f-41c5e477e44f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages