I’ve got an existing C codebase for a tool that can be built with
./configure && make. I’d like to use Rust for some parts of the tool, but I’d like to minimize hassle it creates for other people trying to compile the tool.
If I just rely on
cargo being in
PATH, I’ll have to add extra build instructions to the manual. When people don’t RTFM (and I don’t blame them) the build will fail, and I’ll have to display an error along lines of “Please install Rust”. It’s a drag. As awesome Rust is, I don’t expect all users to know about it and want to install it system-wide just to try my one tiny program.
So I have a (potentially terrible) idea to download and install a throw-away version of Rust compiler automatically during build, if it wasn’t available on the system.
Can it be done?
- Is there a reasonably small self-contained Rust package that would work if dropped into some
- Can everything Rust-specific (i.e. not libc) be linked statically, so that it won’t fail because
build/tmp/rustsomelib.sois not found?
- Can I ensure Rust won’t leave any files behind in system directories?