ERROR: Expected action_config for 'objc-compile' to be configured

841 views
Skip to first unread message

Paul Johnston

unread,
Oct 25, 2017, 12:37:24 AM10/25/17
to bazel-discuss
Can someone help me interpret this error while attempting to build this objc_library rule?  Could not find any information via search.  Thanks, @pcj

Bazel 0.7.0/linux.

$ bazel build @com_google_protobuf//:objectivec
ERROR: /.../external/com_google_protobuf/BUILD:908:1: in objc_library rule @com_google_protobuf//:objectivec: Expected action_config for 'objc-compile' to be configured
ERROR: Analysis of target '@com_google_protobuf//:objectivec' failed; build aborted: Analysis of target '@com_google_protobuf//:objectivec' failed; build aborted
INFO: Elapsed time: 0.176s

László Csomor

unread,
Oct 25, 2017, 7:49:00 AM10/25/17
to Paul Johnston, bazel-discuss
I can also repro this from https://github.com/google/protobuf/commit/ee8a0911cbaca2a1849a847bbdc523120d003a31 with Bazel 0.7.0 on Linux.


--
László Csomor | Software Engineer | laszlo...@google.com

Google Germany GmbH | Erika-Mann-Str. 33 | 80636 München | Germany
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschäftsführer: Paul Manicle, Halimah DeLaine Prado

--
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/5bcace96-0381-45aa-beef-cb4421ad1bf1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

László Csomor

unread,
Oct 25, 2017, 7:55:03 AM10/25/17
to Paul Johnston, bazel-discuss, Marcel Hlopko, Cal Peyser
+Marcel, +Cal

This looks like a Crosstool-related thing. Does it look familiar to any of you?



--
László Csomor | Software Engineer | laszlo...@google.com

Google Germany GmbH | Erika-Mann-Str. 33 | 80636 München | Germany
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschäftsführer: Paul Manicle, Halimah DeLaine Prado

Cal Peyser

unread,
Oct 25, 2017, 10:05:56 AM10/25/17
to László Csomor, Christopher Parsons, Paul Johnston, bazel-discuss, Marcel Hlopko
This error signals that your build is not using the correct CROSSTOOL (although I'll admit that I would've expected the CROSSTOOL to be set automatically).  You should, I believe, add --crosstool_top=@io_bazel=//tools/osx/crosstool:toolchain --apple_crosstool_top=//tools/osx/crosstool:toolchain, after adding @io_bazel to your project in your WORKSPACE file.

The issue I'm encountering is that //tools/osx/crosstool:toolchain is generated from BUILD.tpl - I can't figure out how to reference it from another repository.  Adding cparsons@ who created the external OSX CROSSTOOL.

Marcel Hlopko

unread,
Oct 25, 2017, 10:17:36 AM10/25/17
to Cal Peyser, László Csomor, Christopher Parsons, Paul Johnston, bazel-discuss
Shooting blind, do you have xcode installed, licence accepted, and launched at least once so all the extensions are downloaded and installed?

To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.



--
-- 
Marcel Hlopko | Software Engineer | hlo...@google.com | 

Google Germany GmbH | Erika-Mann-Str. 33  | 80636 München | Germany | Geschäftsführer: Geschäftsführer: Paul Manicle, Halimah DeLaine Prado | Registergericht und -nummer: Hamburg, HRB 86891

Paul Johnston

unread,
Oct 25, 2017, 10:28:17 AM10/25/17
to bazel-discuss
Nope.  Can I even install xcode on linux?  (I don't think so).  

Maybe it's just not possible to build this target on a linux machine then.

Marcel Hlopko

unread,
Oct 25, 2017, 10:38:51 AM10/25/17
to Paul Johnston, cpar...@google.com, bazel-discuss
Ok it's clear now. Our linux crosstool doesn't support objc, only C++, and our osx crosstool only works with xcode installed. I know next to nothing about objc, so let's wait on +Christopher Parsons to comment on the possibility of linux toolchain targeting osx with support for objc. 


For more options, visit https://groups.google.com/d/optout.

Christopher Parsons

unread,
Oct 25, 2017, 10:58:50 AM10/25/17
to Marcel Hlopko, Cal Peyser, Paul Johnston, bazel-discuss
Re-adding Cal, as he knows more about objc crosstool support than I do.

I don't think we can spend too many resources investigating supporting Objc for linux at this time. 

Unfortunately I somewhat doubt that this would work out-of-the-box, even if we updated the linux CROSSTOOL to support objc. Cal, any idea if this is correct?

To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discuss+unsubscribe@googlegroups.com.

Cal Peyser

unread,
Oct 30, 2017, 9:37:23 AM10/30/17
to Christopher Parsons, Diwas Adhikary, Marcel Hlopko, Paul Johnston, bazel-discuss
I can confirm that you should not be trying to build objc_library targets targeting a Linux machine.

However, a linux toolchain targeting osx is something we're actively working on.  See go/apple-cross-compilation, +diwas who is involved in this work.

ivu...@google.com

unread,
Mar 20, 2018, 1:11:07 PM3/20/18
to bazel-discuss
On Monday, October 30, 2017 at 1:37:23 PM UTC, Cal Peyser wrote:
> I can confirm that you should not be trying to build objc_library targets targeting a Linux machine.
>
>
> However, a linux toolchain targeting osx is something we're actively working on.

FWIW previous Github issue on this subject: https://github.com/bazelbuild/bazel/issues/2420

I'd like to help get some of this in the externally available CROSSTOOL file. I'll update the issue quoted above.

Reply all
Reply to author
Forward
0 new messages