Skip to content

Add rust

Valentin David requested to merge valentindavid/rust into master

Some notes:

Compiling Rust takes a lot of memory. I have a suspicion that it is because of ThinLTO. I have disabled it on arm architectures. I have disabled it only for i586.

I have added one patch for rust. I noticed that the LLVM backend is wrongly placed because of multiarch libdir and rust cannot find it which makes it unusable. Maybe we should send the patch to upstream.

cargo.bst needs to be partially generated because it needs to download packages, and we need to translate that into buildstream downloads. Also the cargo repository hashes are generated and merged with the downloaded source. The script is still a bit rough. It will be probably needed if we need to add anything using cargo, and then we can think of making it better.

Rust needs to be in the BaseSdk (or at least I suppose), and since Rust depends on LLVM, LLVM has to be moved to BaseSdk.

It is also possible to compile rust with its own LLVM, but we want to reduce as much as possible the size, we need to make sure we have only one build of LLVM. There are maybe other things Rust compile itself, and we need to check that.

I try to break dependencies because we should not have to recompile everything each time we change something in the base. The idea of having 2 bit stacks for the base and desktop was so that we can easily test the base with the converted .bst from the flatpak-builder to buildsstream converter. But this is not really needed anymore. Instead we should go for stacks for different generic things. For examples: autotools, cmake+ninja, meson+ninja, python+libraries, tar+compressions. And then have better granularity for dependencies.

Fixes #100 (closed)

Edited by Valentin David

Merge request reports