Mac OS X sandbox is coming

318 views
Skip to first unread message

Yue Gan

unread,
Aug 30, 2016, 8:11:36 AM8/30/16
to bazel-discuss
Hi All,

If you don't use bazel on Mac OS X, you can stop reading now.

Mac sandbox is already default in HEAD, and will be default in the next release. If you're using bazel on Mac, this might break you, so it would be better if you try it in HEAD now.
The most probable reason is missing dependency in your BUILD file. If not or you have any problem with sandbox, please feel free to report to us on Github. In the meanwhile, you can use `--spawn_strategy=standalone --genrule_strategy=standalone` as a workaround.

If you are interested, the sandbox change is here. It works similarly with Linux sandbox 2.0, but it use Apple's `sandbox-exec` instead. Nested `sandbox-exec` is not allowed, so if you also use it, you have to disable sandbox for the target.

Have fun with the new sandbox!

Best regards,
Yue

Paul Johnston

unread,
Aug 30, 2016, 10:18:39 AM8/30/16
to bazel-discuss
Note: if you don't want to build from source, one can install HEAD version via:

$ wget -O install.sh $URL
$ curl -o install.sh $URL
$ chmod +x install.sh
$ ./install.sh --user
$ rm -f install.sh
$ bazel version

Build label: 0.3.1

Build target: bazel-out/local-fastbuild/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar

Build time: Fri Jul 29 09:05:18 2016 (1469783118)

Build timestamp: 1469783118

Build timestamp as int: 1469783118


Confirm you have an updated Build time.  Return to 0.3.1 with 

Brian Edmonds

unread,
Sep 2, 2016, 4:33:36 PM9/2/16
to bazel-discuss
Does the OSX sandbox support @//foo targets? I'm getting errors trying to build my external modules that are pulling in prebuilt config files from @//third_party/... The dependencies are correct, since they mirror ones on Linux, and worked in 0.3.1. (I abandoned getting our build to work on 0.3.1 because of the lack of sandboxing making it difficult for me to get things to work like I expected them from Linux.)

Specifically, a genrule doing a simple cp is failing with "Operation not permitted". There appears to be a symlink in place for the file (zconf.h for zlib 1.2.8, to give a specific example), but it's just a dangling symlink, as the actual file does not seem to be populated in the sandbox.

This is with a bazel I just pulled and built from HEAD this morning.

Brian.

Kristina Chodorow

unread,
Sep 7, 2016, 10:29:15 AM9/7/16
to Brian Edmonds, bazel-discuss
It should be, please file a bug at https://github.com/bazelbuild/bazel/issues if it isn't.

--
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/f469dfd6-44f7-41b7-b773-86661e5b0add%40googlegroups.com.

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

Brian Edmonds

unread,
Sep 7, 2016, 1:35:34 PM9/7/16
to Kristina Chodorow, bazel-discuss
On Wed, Sep 7, 2016 at 7:28 AM, 'Kristina Chodorow' via bazel-discuss
<bazel-...@googlegroups.com> wrote:
> It should be, please file a bug at
> https://github.com/bazelbuild/bazel/issues if it isn't.

I've filed https://github.com/bazelbuild/bazel/issues/1738. Thanks.

Brian.

Kristina Chodorow

unread,
Sep 7, 2016, 2:25:21 PM9/7/16
to Brian Edmonds, bazel-discuss
Thanks for the repro, looking into it.
Reply all
Reply to author
Forward
0 new messages