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

allow cross-util install #1216

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Conversation

Emilgardis
Copy link
Member

@Emilgardis Emilgardis commented Mar 8, 2023

resolves #1215

enables

cross-util install <thing> <args...> --root output

@Emilgardis Emilgardis changed the title refactor into functions allow cross-util install Mar 8, 2023
Copy link
Member Author

@Emilgardis Emilgardis left a 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)?,
Copy link
Member Author

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

Comment on lines -1037 to 1051
.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"]);
Copy link
Member Author

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?

Comment on lines +79 to +82
if let Some((version, channel, _)) = toolchain.rustc_version()? {
is_nightly = channel == rustc_version::Channel::Nightly;
rustc_version = Some(version);
}
Copy link
Member Author

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

Comment on lines +23 to +28
/// Path to crate
#[clap(long)]
pub path: Option<String>,
/// Path to Cross.toml
#[clap(long)]
pub config: Option<std::path::PathBuf>,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not implemented

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

Successfully merging this pull request may close these issues.

cross install seems to be broken
1 participant