I'm working on some packages that depend on build tools that aren't in OpenWrt, and I'm trying to figure out when such a build tool needs to be packaged itself as well, or when it's appropriate to say it's a dependency for the host system. For example:
-
I have some Rust programs. Do I need to package up the whole Rust toolchain and build it as part of the whole build process? Because it's also possible to just have the build host use Rustup to install Cargo and the appropriate cross-compiling toolchain eg. via
rustup target add mipsel-unknown-linux-musl
. -
I have some code that uses Premake to generate build files (like CMake but with Lua). Do I need to package up Premake for the buildroot or can I just run it on the host?
If I look at other projects, like the Go language packages in the official repo, it seems like the entire toolchain is cross compiled. Premake is an analog of CMake, and CMake is built in the buildroot, so maybe I should do the same for Premake...? But on the other and builthand, various bootstrap-related build tools and dev headers need to be installed on the host system. It's certainly easier to simply document a toolchain as a host dependency and not agonise over some toolchain package makefile.
Is there a rule here? Or some reasoning underlying when and why certain tools are built in the buildroot instead of being run on the host?