--
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/c417d4c4-1bff-41de-b0fd-29957b58e6ac%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
1. For the toolchains, you can add them to the CROSSTOOL file[1] or create your own CROSSTOOL file and then specify --crosstool_top[2] when you build.
2. Have you seen the configuration machinery[3] bazel has?
You could do something like:cc_binary(name = "a",srcs = select({":platform-a": ["a.cc"],}),)config_setting(name = "platform-a",values = {"cpu": "arm-chip-y-or-something","crosstool_top": "gcc-arm-none-eabi",},)Then you'll only be able to build :a with the for ARM chip Y using the gcc-arm-none-eabi toolchain.
You have to specify the options on the command line, though, e.g.,$ bazel build --crosstool_top=gcc-arm-none-eabi --cpu=arm-chip-y-or-something //my:aYou can't specify the build options in the cc_ rule itself.
On Tue, Jun 16, 2015 at 4:03 PM, Marc-Antoine Courteau <macou...@gmail.com> wrote:Hi,--I do embedded development on multiple platforms (e.g. AVR, ARM, etc.), and would like to:
- add the toolchains (e.g. avr-gcc, gcc-arm-none-eabi) for these platforms to my bazel workspace, and
- be able to specify which toolchains to use when building specific targets (e.g., "this cc_binary should be built for the AVR chip X using the avr-gcc toolchain, and this cc_binary should be built for ARM chip Y using the gcc-arm-none-eabi toolchain").
I also have code that is platform-agnostic that I'd like to reuse for all platforms, and have unit tests for that code that I'd like to run on the host computer.Is that something that can be done with bazel? Any pointers on how to do this?Thanks!
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/c417d4c4-1bff-41de-b0fd-29957b58e6ac%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--On Tue, Jun 16, 2015 at 4:03 PM, Marc-Antoine Courteau <macou...@gmail.com> wrote:Hi,--I do embedded development on multiple platforms (e.g. AVR, ARM, etc.), and would like to:
- add the toolchains (e.g. avr-gcc, gcc-arm-none-eabi) for these platforms to my bazel workspace, and
- be able to specify which toolchains to use when building specific targets (e.g., "this cc_binary should be built for the AVR chip X using the avr-gcc toolchain, and this cc_binary should be built for ARM chip Y using the gcc-arm-none-eabi toolchain").
I also have code that is platform-agnostic that I'd like to reuse for all platforms, and have unit tests for that code that I'd like to run on the host computer.Is that something that can be done with bazel? Any pointers on how to do this?Thanks!
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/c417d4c4-1bff-41de-b0fd-29957b58e6ac%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--Marc-Antoine Courteau, ing.
macou...@gmail.com
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/CAH_sd0VfWtaWDHCv8gEq6LUS2bycTg2WgmgwNrrogFPDfys-5A%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/c376c9be-d8e7-4311-a38c-a7123a7a832b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/c376c9be-d8e7-4311-a38c-a7123a7a832b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/c376c9be-d8e7-4311-a38c-a7123a7a832b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--Lukács T. Berki | Software Engineer | lbe...@google.com |Google Germany GmbH | Erika-Mann-Str. 33 | 80636 München | Germany | Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle | Registergericht und -nummer: Hamburg, HRB 86891
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/c376c9be-d8e7-4311-a38c-a7123a7a832b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--Lukács T. Berki | Software Engineer | lbe...@google.com |Google Germany GmbH | Erika-Mann-Str. 33 | 80636 München | Germany | Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle | Registergericht und -nummer: Hamburg, HRB 86891
--Marc-Antoine Courteau, ing.
macou...@gmail.com
--
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/CAH_sd0WO-kwO3RX69SvAED_KFwivSTVQcGey7%3DYZicifUinB_A%40mail.gmail.com.
Oh, I hadn't forgotten about you, Marc-Antoine. :) Glad to see you're still following this thread.That absolutely makes sense, and is a perfectly reasonable request. I'm asking specifically about "all" vs. building a single executable at a time because that has impact on output path naming, which has efficiency and correctness problems if we're not careful. See here for details (both sections "Corrupted Outputs" and "Cacheable and Distributed Execution").
I think we can support building a single executable with the right toolchain before we'll be able to mix different executables with different toolchains together in the same build. So if even that, limited, scenario, is useful to you, it's something we can consider opening up soon. Especially as the work on platform definitions (which imply crosstool settings) moves along.We could also conceivably open "//foo:all"-style builds sooner if there's a mutual understanding it could have performance consequences. For example, common platform-independent dependencies might get unnecessarily built twice for different executables.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/c376c9be-d8e7-4311-a38c-a7123a7a832b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--Lukács T. Berki | Software Engineer | lbe...@google.com |Google Germany GmbH | Erika-Mann-Str. 33 | 80636 München | Germany | Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle | Registergericht und -nummer: Hamburg, HRB 86891
----Marc-Antoine Courteau, ing.
macou...@gmail.com
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-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/CAH_sd0WO-kwO3RX69SvAED_KFwivSTVQcGey7%3DYZicifUinB_A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
I have a sub-tree of my bazel repository that needs to be built with a different toolchain than the rest. It's ugly keeping track, for my many users, of which crosstools specification they need to use in different subtrees.
In the long term, parts of the tree need to be compiled to multiple target architectures, and tested together on the different systems.
Any ideas how I should address my short term problem?
Thanks,
Paul
Is there a way to create a macro or new rule to specify a compiler (or toolchain) without invoking bazel twice?
I'd like to have something like:
# use the gcc compiler
gcc_cc_binary(
name = "hello-world-arm",
srcs = "hello-world.c",
)
# use the icc compiler
icc_cc_binary(
name = "hello-world-x86",
srcs = "hello-world.c",
)
I'm okay with the duplication of the sources for now. I'd like to do one "bazel build :all" and it would build both.
I've got something similar working with a new CROSSTOOL but I have to run bazel build twice one with the --config=icc.
Are dynamic configurations needed for this?
Thanks,
-Todd
--
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/8a9b1c60-51ad-4342-8760-eaf73c561528%40googlegroups.com.