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

--sandbox_add_mount_pair ignored on OSX #4150

Open
greggdonovan opened this issue Nov 22, 2017 · 14 comments
Open

--sandbox_add_mount_pair ignored on OSX #4150

greggdonovan opened this issue Nov 22, 2017 · 14 comments
Labels
not stale Issues or PRs that are inactive but not considered stale P2 We'll consider working on this in future. (Assignee optional) team-Local-Exec Issues and PRs for the Execution (Local) team type: feature request

Comments

@greggdonovan
Copy link
Member

Please provide the following information. The more we know about your system and use case, the more easily and likely we can help.

Description of the problem / feature request / question:

I would like to use --sandbox_add_mount_pair to mount specific directories into the sandbox filesystem on both OSX and Linux, but this support was only added on Linux.

If possible, provide a minimal example to reproduce the problem:

DarwinSandboxedSpawnRunner is missing sandboxAdditionalMounts, but LinuxSandboxedSpawnRunner has them.

Environment info

  • Operating System:

macOS Sierra 10.12.6

  • Bazel version (output of bazel info release):

release 0.7.0-homebrew

@meteorcloudy
Copy link
Member

//cc @xingao267 @philwo
Can we provide the same support for OS X?

@meteorcloudy meteorcloudy added category: sandboxing P2 We'll consider working on this in future. (Assignee optional) type: feature request labels Nov 22, 2017
@mboes
Copy link
Contributor

mboes commented Dec 16, 2018

I would likewise be very interested in this feature. It would allow using rules_nixpkgs without requiring any globally installed tool (which can only be installed locally if extra directories are mapped into the sandbox).

@jin jin added z-team-Apple Deprecated. Send to rules_apple, or label team-Rules-CPP + platform:apple team-Local-Exec Issues and PRs for the Execution (Local) team untriaged and removed category: sandboxing z-team-Apple Deprecated. Send to rules_apple, or label team-Rules-CPP + platform:apple P2 We'll consider working on this in future. (Assignee optional) labels Sep 3, 2019
@jin
Copy link
Member

jin commented Sep 3, 2019

Moving to the local exec team and back into the untriaged pool.

@jmmv
Copy link
Contributor

jmmv commented Sep 11, 2019

Bind mounts don't exist on macOS (unless you use FUSE, which we don't rely on by default at this point), so I think the only way we could offer this right now is by replicating the tree into the sandbox using symlinks. Would that be sufficient? Are you still interested in this feature?

@jmmv jmmv added more data needed P2 We'll consider working on this in future. (Assignee optional) and removed untriaged labels Sep 11, 2019
@jmmv
Copy link
Contributor

jmmv commented Oct 14, 2019

If the flag exists on macOS, and it does, then we should make it work. Given what I said in the last reply, we cannot make it work as "mounts" (unless we use sandboxfs), but the symlinking approach may be a good compromise.

@greggdonovan
Copy link
Member Author

@jmmv Thanks! I'm not actively using macOS, but we most of our Bazel users are. Combined with platform specific bazelrc this would be a nice way to make our builds more hermetic.

@github-actions
Copy link

Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 3 years. It will be closed in the next 14 days unless any other activity occurs or one of the following labels is added: "not stale", "awaiting-bazeler". Please reach out to the triage team (@bazelbuild/triage) if you think this issue is still relevant or you are interested in getting the issue resolved.

@github-actions github-actions bot added the stale Issues or PRs that are stale (no activity for 30 days) label Feb 28, 2023
@github-actions
Copy link

This issue has been automatically closed due to inactivity. If you're still interested in pursuing this, please reach out to the triage team (@bazelbuild/triage). Thanks!

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 15, 2023
@honnix
Copy link
Contributor

honnix commented Nov 24, 2023

This feature request seems to be still valid. I don't exactly know how sandbox-exec works, but it seems to be possible to add more here

out.println("(allow file-write*");
for (Path path : writableDirs) {
out.println(" (subpath \"" + path.getPathString() + "\")");
}
out.println(")");
. Is that right?

@tjgq tjgq added not stale Issues or PRs that are inactive but not considered stale and removed stale Issues or PRs that are stale (no activity for 30 days) labels Nov 24, 2023
@tjgq tjgq reopened this Nov 24, 2023
@tjgq
Copy link
Contributor

tjgq commented Nov 24, 2023

Yes, I think this FR still makes sense, although we might not be able to prioritize it. cc @oquenchil

@honnix
Copy link
Contributor

honnix commented Nov 27, 2023

I tried something in #20336 . Not sure whether it is a sane approach. Can someone help me understand whether it is a good way to go forward? Thanks.

@honnix
Copy link
Contributor

honnix commented Nov 30, 2023

I tried something in #20336 . Not sure whether it is a sane approach. Can someone help me understand whether it is a good way to go forward? Thanks.

Can I get some help on this? I'm a first-time contributor and I literally don't know whether I'm doing something totally wrong 😄. Thanks. @tjgq or @oquenchil maybe?

@honnix
Copy link
Contributor

honnix commented Dec 12, 2023

Trying this again. Can some one help review the PR? Thanks.

@oquenchil
Copy link
Contributor

Commented on the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not stale Issues or PRs that are inactive but not considered stale P2 We'll consider working on this in future. (Assignee optional) team-Local-Exec Issues and PRs for the Execution (Local) team type: feature request
Projects
None yet
Development

No branches or pull requests

8 participants