-
Notifications
You must be signed in to change notification settings - Fork 365
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
allow cross-util install
#1216
base: main
Are you sure you want to change the base?
allow cross-util install
#1216
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does work, but I'm not happy with the code-reuse.
I want to make Install::run
not be a rewrite of cross::run
&engine, | ||
cross::CargoMetadata { | ||
workspace_root: cwd.clone(), | ||
target_directory: cross::file::absolute_path(self.root)?, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is misleading
cargo install
creates a temporary directory where it builds, we don't use this path as the normal target-dir, rather as the target directory for the cargo install
output
.args(["-e", "CARGO_TARGET_DIR=/target"]) | ||
.args(["-e", &cross_runner]); | ||
|
||
if !options.skip_target_dir { | ||
self.args(["-e", "CARGO_TARGET_DIR=/target"]); | ||
} | ||
if options.cargo_variant.uses_zig() { | ||
// otherwise, zig has a permission error trying to create the cache | ||
self.args(["-e", "XDG_CACHE_HOME=/target/.zig-cache"]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this comment about zig a problem?
if let Some((version, channel, _)) = toolchain.rustc_version()? { | ||
is_nightly = channel == rustc_version::Channel::Nightly; | ||
rustc_version = Some(version); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this doesn't emit warning on mismatch like normal cross does
/// Path to crate | ||
#[clap(long)] | ||
pub path: Option<String>, | ||
/// Path to Cross.toml | ||
#[clap(long)] | ||
pub config: Option<std::path::PathBuf>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not implemented
resolves #1215
enables
cross-util install <thing> <args...> --root output