Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for custom targets in the style of xargo/cargo-xbuild #1538

Open
WildCryptoFox opened this issue Nov 9, 2018 · 1 comment
Open

Comments

@WildCryptoFox
Copy link

WildCryptoFox commented Nov 9, 2018

Hello.

I've been using xargo for a while and recently checked out cargo-xbuild. Curious as to how these work, I realised all that you need to do is build the libcore-etc for the target and put these in the sysroot directory. Rustup manages its own sysroot for common targets.

It would be really nice if we could instead do rustup target add x86_64-sel4-robigalia.json to ask rustup to track the target file and rebuild the libcore-etc when either rustc updates or when the user attempts to build something using the target with a newer rustc or when the target file changes.

As a bonus feature it might be faster (or bandwidth-cheaper or just more convenient such as when offline) for some people to build any simple targets using only rust-src and a collection of target.json files.

I'm currently just using unmodified and unwrapped cargo with only these two environment variables set after having used xargo/xbuild at least once after calling rustup update.

export RUSTFLAGS="--sysroot $HOME/my_project/target/sysroot"
export RUSTDOCFLAGS=$RUSTFLAGS
@ketsuban
Copy link

ketsuban commented Dec 8, 2018

As I understand it the developers intend to fold cargo-xbuild's functionality into Cargo itself (rust-lang/cargo#4959) but progress stalled for the duration of Rust 2018's impl period because the embedded WG ended up only needing a small number of new targets rather than a general solution for compiling the standard library for arbitrary targets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants