joerg-krause / rust-cross-libs

Cross-compile the Rust standard library for custom targets without a full bootstrap build.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Provide a way to point to non git rust src directory

arpad-m opened this issue · comments

It would be cool if there was a --rust-src param which you could point to the contents of an extracted tarball of the rust source code, which you can obtain via links of the form https://static.rust-lang.org/dist/2016-09-13/rust-src-nightly.tar.gz (in the best case I'd have to walk down the path to rust-src/lib/rustlib/src/rust/ myself, so the script wont take that over for me).

For context: I'm doing a setup where rust-cross-libs is its own buildroot package, and rust src and rust binaries are two host packages; both obtained from tarballs of that form.

I'm doing a setup where rust-cross-libs is its own buildroot package, and rust src and rust binaries are two host packages; both obtained from tarballs of that form.

Sounds promising! I'm a Buildroot contributor, too, but I haven't thought of this, yet!

Why not use --rust-git?

Why not use --rust-git?

Buildroot has this property that the source code for all packages it downloads is downloaded ahead of the actual build steps, and put inside the dl folder. Using that folder you can theoretically build without internet connection, etc. Doing the git clone inside the build steps would violate that rule/property.

While buildroot has support for code from git repositories, the only thing you'll get is a directory with the source checked out, but no full git repository, and you will have to chose the commit beforehand.

I see!

The script ensures, that Rust nightly and Rust git are pointing to the same commit-hash to prevent incompatibilities between the cross compiled standard crates and the rustc version used.

So, if using a non-git source directory this has to be ensured, too!

I guess the script cannot be easily used by Buildroot as it depends on many variables passed through the environment. However, I think it should be possible to port the shell part into a Buildroot Makefile.