Local builds too slow with sandboxing

588 views
Skip to first unread message

jerry...@pinterest.com

unread,
Jun 12, 2017, 5:46:35 PM6/12/17
to bazel-discuss

Hello,


First off, I wanted to thank you all for the wonderful build system, Bazel!

I’m compiling an iOS app with several thousands of files ( mix of ObjC, ObjC++, C, C++ ) with Bazel. I’d like to build on consumer grade laptops: i.e. invoking a clean build on a mid range 2013 MacBook air.

My baseline build is an Xcode debug build and when I try to compile my entire app under bazel, it is significantly slower than Xcode ( i.e. 2.5x slower ).

Running builds with --spawn_strategy=standalone  brings the build time down to something acceptable: similar build time compared to Xcode.

Is safe to turn off sandboxing as a sensible default for local builds? Will this degraded safety or stability for the local builds?

Cheers!
Jerry Marino

jerry...@pinterest.com

unread,
Jun 12, 2017, 5:51:23 PM6/12/17
to bazel-discuss
PS: I'm running:
| release 0.5.0rc8

Marc-Antoine Courteau

unread,
Jun 12, 2017, 9:03:37 PM6/12/17
to bazel-discuss
FWIW, I've run into massive slowdowns as well with sandboxing, with a custom CROSSTOOL toolchain for ARM development. Builds that complete within one second with sandboxing disabled easily take over 90 seconds (!) with sandboxing enabled. I'm guessing this has to do with the sandbox setup/teardown...

Tom Payne

unread,
Jun 13, 2017, 3:04:56 AM6/13/17
to Marc-Antoine Courteau, bazel-discuss
The discussion in https://github.com/bazelbuild/bazel/issues/2424 ("macOS sandboxing doubles build time") might be of interest.

--
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/9afd1294-77f4-48b3-bda2-912211304062%40googlegroups.com.

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



--
Centralway Numbrs AG | Tom Payne, Software Engineer, Backend

This message is for the attention of the intended recipient(s) only. It may contain confidential, proprietary and/or legally privileged information. Use, disclosure and/or retransmission of information contained in this email may be prohibited. If you are not an intended recipient, you are kindly asked to notify the sender immediately (by reply e-mail) and to permanently delete this message. Thank you.

Jerry Marino

unread,
Jun 13, 2017, 8:08:55 PM6/13/17
to Tom Payne, Marc-Antoine Courteau, bazel-discuss
Cool, thanks for the heads up and pointer to the thread. I posted up a response over there as well.

Marc, are so have you ran into any issues with running without sandboxing?

It seems like if the build is already sandboxed ( and correct ) then turning it off for local builds is a sensible default for me.

Cheers!
Jerry

--
You received this message because you are subscribed to a topic in the Google Groups "bazel-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/bazel-discuss/ChAS756qaDE/unsubscribe.
To unsubscribe from this group and all its topics, 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/CAF08gXGuFc9BJ%2B_t6G3tBMGfrfMRj3wRmAD9o%3DWuoK9%2B%3DBpSEQ%40mail.gmail.com.

Marc-Antoine Courteau

unread,
Jun 13, 2017, 10:18:25 PM6/13/17
to Jerry Marino, Tom Payne, bazel-discuss
On Tue, Jun 13, 2017 at 8:08 PM, Jerry Marino <jerry...@pinterest.com> wrote:
Cool, thanks for the heads up and pointer to the thread. I posted up a response over there as well.

Marc, are so have you ran into any issues with running without sandboxing?

It seems like if the build is already sandboxed ( and correct ) then turning it off for local builds is a sensible default for me.

My build is correct when sandboxed, so I've added this in my tools/bazel.rc file to disable sandboxing:
build --spawn_strategy=standalone --genrule_strategy=standalone

I really wish I didn't have to though, and will revert to sandboxed mode when there's no longer too much of a performance hit.



--
Marc-Antoine Courteau, ing.
macou...@gmail.com
Reply all
Reply to author
Forward
0 new messages