Hello,
I have been messing around with the prospect of running external tools over the kernel xml,
during the kernel build, with the external tools being written in other languages, and generating bindinfs for other language and the like.
No one is relying on this in production, it is merely one experiment towards external tools.
I’ve set up a manifest which contains a small patch to the kernels build system,
It is currently just a prototype and doesn’t actually generate any useful code, or compile that code using the correct toolchains etc…
The basic premise of this is it sets up a directory kernel/external
,
and the kernel build basically assumes if this contains a CMakeLists.txt
it adds it it via add_subdirectory
.
There is currently nothing more to it than that.
The manifest
then links the appropriate repositories into kernel/external
,
The tools external tools
repo then builds a bunch of rust code for the host system,
the generated sources
repo then runs the tools previously compiled for the host system.
This needs both a rust compiler, and a mechanism for translating between cmake and building rust code. For that I ignored the rust support in the kernel as they depend on xargo
which is in maintenance mode. The repositories which I link into kernel/external
use GitHub - corrosion-rs/corrosion: Marrying Rust and CMake - Easy Rust and C/C++ Integration!
git clone https://github.com/corrosion-rs/corrosion/
cmake -Scorrosion -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~/.local
cmake --build build --config Release
cmake --install build --config Release
export CMAKE_PREFIX_PATH=$HOME/.local/lib64/cmake
repo init -u https://github.com/ratmice/sel4test-manifest.git -m external_tools.xml -b external_tools
repo sync
mkdir build
cd build
../init-build.sh
This should build and run some tools along side building the (patched) kernel.
I wanted to post an RFC here, because even though the patch is relatively tiny, I could see it being objectionable.
All bets are basically off when it comes to verification and how this could affect the kernel itself.
I haven’t investigate on what the minimum cmake required for my tools is, or managed to fix all the rust/cmake warnings produced by this rust tooling…
However there shouldn’t be any impact in that regard when building the kernel without linking in the external tools.
Anyhow, appreciate your time and consideration in regards to whether anyone thinks this might be an acceptable path forwards.