rust-osdev / cargo-xbuild

Automatically cross-compiles the sysroot crates core, compiler_builtins, and alloc.
Apache License 2.0
258 stars 25 forks source link

Add xb, xt, xc, and xr subcommands #42

Closed Aehmlo closed 5 years ago

Aehmlo commented 5 years ago

I've added these as separate binaries, since it requires the least amount of configuration and retains the ease of adding new subcommands. I had to change the "check if this was invoked as a cargo subcommand" logic a little to make it actually work when invoked as e.g. cargo xc.

Closes #41.

Aehmlo commented 5 years ago

One downside to this implementation is that, if the command is invoked directly (path/to/cargo-xr), the error message will suggest the full subcommand (cargo xrun) instead of the short version (cargo xr). However, I think this is pretty much a nonissue.

phil-opp commented 5 years ago

Thanks for the pull request!

I think we can avoid the issue you mentioned by just calling xargo_lib::main_common("b") etc. and letting cargo do the de-aliasing. This way, the changes in src/cli.rs wouldn't be needed either.

Aehmlo commented 5 years ago

Good idea, I'll rework it to do that instead.

phil-opp commented 5 years ago

Thanks a lot!

phil-opp commented 5 years ago

Published as version 0.5.15.