-
Notifications
You must be signed in to change notification settings - Fork 25
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
More x*? #18
Comments
Sure, I'm happy to merge PRs for additional subcommands. When forking xargo I tried to minimize functionality as much as possible (e.g. remove configurability, support for building std, support for rustdoc, etc) to keep it maintainable for me. In the course of this I also decided to only implement an xbuild command since I didn't want to maintain something that I don't use. However adding back support for rustdoc would be fine with me, I think it it just required an additional environment variable. |
What would |
@IsaacWoods I'm using |
Hmm. Is there any reason why |
Interesting idea. We could extend rustup to support Implementation-wise, we would need to do the following: Currently rustc/cargo make custom targets unique by adding a hash of the canonical path to the JSON file (e.g. x86_64-blog_os-2134893102489). We could change this to generate the hash from the file's content instead. Then any change to our target JSON would cause a target mismatch, which leads to a |
@phil-opp Rustup is already wrapping cargo/rustc to add its |
@james-darkfox You mean automatically compiling the target if it is not part of the sysroot already? |
@phil-opp I mean automatically following the changes of the |
Sounds reasonable. Maybe open a thread on https://internals.rust-lang.org/ or an issue at https://github.com/rust-lang-nursery/rustup.rs to hear what the rust/rustup devs think about your idea? |
@phil-opp If they have an issue with the added complexity, it might be better to just have an xargo/xbuild that does only the libcore-etc without trying to do cargo's job. Just build the target and put the artifacts in the chosen sysroot. Then rustup would only need to decide when to call it. Basically whenever How much more effort would it take to support a custom std, as xargo supports? |
In the meantime... The following skips the unexpected core-rebuilding and sysroot-wide lockfile. I.e. #!/bin/sh
# . update-sysroot [TARGET]
# TARGET defaults to x86_64-sel4-robigalia
unset RUSTFLAGS RUSTDOCFLAGS
TARGET=${1:-x86_64-sel4-robigalia}
which cargo-xrustc && SYSROOT=$(cargo xrustc --target $TARGET -- --print sysroot) \
|| which xargo && SYSROOT=$(xargo rustc --target $TARGET -- --print sysroot)
export RUSTFLAGS="--sysroot $SYSROOT"
export RUSTDOCFLAGS="$RUSTFLAGS"
unset TARGET SYSROOT |
This should be easily possible.
I don't know, I never needed std for my custom targets. But if the std building of xargo still works with current nightlies, it shouldn't be to difficult to just copy the corresponding code from xargo. |
Nice! If using cargo-xbuild, I would configure it to use a global sysroot, otherwise it only works for a single project. Also, do normal non- |
@phil-opp At least my build.rs still works. So I'll take that as a yes. |
At least
xrun
andxdoc
would be nice. Maybe anxdo $command
to run arbitrarycargo-*
with the appropriate environment configured. Is there any reason why xbuild doesn't act like xargo and cover all bases?The text was updated successfully, but these errors were encountered: