Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sandboxing causes all skylark rules with tools relying on /usr/local/bin/python to fail #576

Closed
msolo-dropbox opened this issue Nov 9, 2015 · 10 comments
Labels
P2 We'll consider working on this in future. (Assignee optional) team-Configurability platforms, toolchains, cquery, select(), config transitions type: bug

Comments

@msolo-dropbox
Copy link

Replacing /usr/bin/python with a custom version is not an option most systems, thus /usr/local/bin/python is a necessity.

What is the escape hatch to make this work again?

Feels like "sandbox" is really just an ad-hoc container. Perhaps it would be better to just configure that as part of the workspace. Specifying if sandbox is generally enabled, and if so, what paths to allow would be much clearer.

Thinking further ahead, it would be even better to just allow the "sandbox enter" command to work with something like a docker container. That would make it much easier to debug and fix issues quickly.

@damienmg damienmg added type: bug P2 We'll consider working on this in future. (Assignee optional) labels Nov 12, 2015
@damienmg
Copy link
Contributor

This is due of /usr/local not being mounted in the sandbox. @philwo : do you have any insight on the good fix for that?

@damienmg
Copy link
Contributor

Should be fixed by using python as an external repository but that's not necessarly convenient right now

@msolo-dropbox
Copy link
Author

That seems pretty arduous. I think some way of configuring what goes in the
sandbox is going to be necessary. The easiest thing might be to allow a
reference to a file_group or a tar package.

On Tue, Nov 17, 2015 at 4:05 AM, Damien Martin-Guillerez <
notifications@github.com> wrote:

Should be fixed by using python as an external repository but that's not
necessarly convenient right now


Reply to this email directly or view it on GitHub
#576 (comment).

@bsilver8192
Copy link
Contributor

The sandbox is separate for every action Bazel runs. It includes only the declared inputs and some standard system folders (/proc, /usr/bin, /usr/lib, etc). If you have a tar file or a filegroup, you can add it as an input to the action and it will then be included in the sandbox when appropriate. Also, as of f96edf7, can use execution_requirements = { 'local': 'local' } to disable the sandbox for individual actions.

@damienmg
Copy link
Contributor

@msolo-dropbox once we get that configuration, we are probably going to do it. It's shouldn't be hard for the users. Configuring the sandbox might not be a great idea (ideally, nothing but declared dependencies should be mounted in it).

@damienmg
Copy link
Contributor

damienmg commented Mar 3, 2016

Closing as duplicate for #544 (note that the mechanism now exists and we should do it)

@damienmg damienmg closed this as completed Mar 3, 2016
@philwo
Copy link
Member

philwo commented Mar 3, 2016

@damienmg What mechanism exists and what should we do? Do you mean adding paths to the sandbox (Yue has a pending CL implementing this), or adding a filegroup for /usr/local (but that doesn't work if there are filenames that are no valid labels)?

@damienmg
Copy link
Contributor

damienmg commented Mar 3, 2016

See "Should be fixed by using python as an external repository but that's not necessarly convenient right now"

@philwo
Copy link
Member

philwo commented Mar 3, 2016

OK, and what do you mean with "we should do it"? What is "it"? Access Python via an external repository in all of Bazel? I don't see how that could work, considering that Python is installed in a different place in each Linux distribution and OS X.

Or should our users define their own external_repository for /usr/local, add a filegroup that matches Python and then depend on that from all their py_* targets?

@damienmg
Copy link
Contributor

damienmg commented Mar 3, 2016

We do auto-detection just like we do for C++.

@aiuto aiuto added team-Configurability platforms, toolchains, cquery, select(), config transitions and removed z-category: extensibility > configurability labels Feb 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 We'll consider working on this in future. (Assignee optional) team-Configurability platforms, toolchains, cquery, select(), config transitions type: bug
Projects
None yet
Development

No branches or pull requests

5 participants