3 ms·
Gotcha, interesting. Maybe there's a missing DAG library where you could define your build steps as functions and then express the dependencies &c in a neighbor
by maxbond 4y ago
Gotcha, interesting. Maybe there's a missing DAG library where you could define your build steps as functions and then express the dependencies &c in a neighboring TOML or YAML file, and it solves your DAG and executes the right functions in the right order. Sprinkle some rayon on there to parallelize tasks that are independent.
- SAI_Peregrinus 4y agoThe usual way to do that is just to use a more general build system to call Cargo (or to call rustc directly) and whatever other language(s) compilers you need. Cargo is a Rust-specific build system, it's not really designed to build other language's code easily (and doing so isn't a priority).
- glandium 4y ago> it's not really designed to build other language's code easily That's quite funny to read, when the most low level crates rely on the cc crate to build C code (dependent of cc with the most downloads is backtrace, used by libstd, following that, openssl-sys, ring, libz-sys, you'll see those close to everywhere). But I see what you mean.
- SAI_Peregrinus 4y agoI guess the clearer way to state my point is that possibility and convenience are different things. `build.rs` scripts are Turing complete, and you can make syscalls, so you can call arbitrary other build systems. The difference in difficulty varies from language to language: C usually has few dependencies (because dependency management is fragmented and thus difficult) and so is often straightforward to compile, but other languages aren't always as easy. With a tangled mess of FFI dependencies Cargo stops being the best tool for the job.