4 ms·
Is there a reason that access to the filesystem isn't sandboxed aggressively by the compiler? Even having build macros that can access arbitrary parts of the fi
by vlovich123 6y ago
Is there a reason that access to the filesystem isn't sandboxed aggressively by the compiler? Even having build macros that can access arbitrary parts of the filesystem (vs a dedicated scratch directory) seems like a bad idea. Is there any legitimate use-case here?
- tangent128 6y agorust-embed is one: https://docs.rs/rust-embed/5.9.0/rust_embed/trait.RustEmbed.html https://docs.rs/rust-embed/5.9.0/rust_embed/trait.RustEmbed.... This macro lets you embed an entire folder of assets in your binary at compile time, to simplify distribution. Taking the concept further, I could also imagine build macros that compile Typescript or SASS files at build time, or generate data structures from a Protocol Buffers definition file, or in general operations that ingest non-Rust source code and use tools outside the repository.
- vlovich123 6y agoSure. I would expect such a tool to be happy enough with sandboxing to the folder containing the source of the project and the build folder, no?