rust-lang / rust-project-goals

Rust Project Goals tracker
https://rust-lang.github.io/rust-project-goals/
MIT License
39 stars 40 forks source link

Explore sandboxed build scripts #108

Open nikomatsakis opened 1 month ago

nikomatsakis commented 1 month ago
Metadata
Owner(s) @weihanglo
Team(s) cargo, compiler
Goal document 2024h2/sandboxed-build-script

Summary

Explore different strategies for sandboxing build script executions in Cargo.

Tasks and status

nikomatsakis commented 1 month ago

This issue is intended for status updates only.

For general questions or comments, please contact the owner(s) directly.

weihanglo commented 1 month ago

Key developments:

Have been looking into different sandbox runtime choices. Here is a simple version of the comparison of three potential choices:

There are prior research on cross-over between each of these options. I've been busy these two weeks. Will update a more detail post for prior arts afterward.

The biggest challenge I am seeing now is spawning external processes. Most build script usages invoke some external binaries, like pkg-config for building *-sys crates, or protoc for generating protobuf bindings. If process spawning is that common, we need to find a way to provide a fine-grained permission granting scheme. I don't want it to see an β€œall-or-nothing” mechanism when process spawning is needed.

The other huge headache is setting library search paths. We cannot know every possible path of system libraries ahead of time, but we need to grant access to the runtime.

Blockers:

None.

Help wanted:

None.

weihanglo commented 1 week ago

Having a family urgency. I will be back after RustConf.