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

Basic work for cargo install #1967

Closed
wants to merge 1 commit into from

Conversation

steveklabnik
Copy link
Member

As a sort of successor to #1318, and as an implementation of https://github.com/rust-lang/rfcs/blob/master/text/1200-cargo-install.md , here's a starting skeleton for cargo install.

As someone not mega familiar with Cargo's internals, this is the point where stuff started to bog down a bit. As you can see, this is mostly getting the setup going, it doesn't work at all yet. Any pointers on where to look at Cargo to see examples of how to do the rest? I'll be poking around myself, but I figure I'd send a PR anyway.

@rust-highfive
Copy link

r? @huonw

(rust_highfive has picked a reviewer for you, use r? to override)


There are multiple methods of installing a new crate onto the system. The
`cargo install` command with no arguments will install the current crate (as
specifed by the current directory). Otherwise the `-p`, `--package`, `--git`,
Copy link
Member

Choose a reason for hiding this comment

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

specifed

typo

Copy link
Member Author

Choose a reason for hiding this comment

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

hehe, I copied straight from the RFC...

@huonw
Copy link
Member

huonw commented Sep 6, 2015

r? @alexcrichton

@rust-highfive rust-highfive assigned alexcrichton and unassigned huonw Sep 6, 2015
@carols10cents
Copy link
Member

Hi Steve! I just so happen to be working with cargo internals recently too :) I'm not sure exactly what you're looking for examples of, but I have some guesses. Wow, there's a lot of options to this command!! If I were starting on implementing cargo install -p [crate to install from crates.io], I'd probably:

I could also be totally wrong about this! Some other places to look:

  • When cargo is reading a Cargo.toml, there's logic around creating a SourceId from git or from the central repo, but in order to reuse that, you'd have to create TOML from the arguments and that seems like going backwards, so maybe that logic could be extracted somewhere shared?
  • Dependency also has some parse logic, but that feels weird because the thing you're cargo installing isn't a dependency of anything

Hope that helps!!!!

target_rustc_args: None,
};

let root = &Path::new("$HOME/.cargo/bin");
Copy link
Member

Choose a reason for hiding this comment

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

This should actually be accessible through config.home().join("bin")

@alexcrichton
Copy link
Member

@carols10cents is also right on the money :)

@ticki
Copy link

ticki commented Sep 9, 2015

Why store the executables in $HOME rather than in /usr/local/bin? I prefer the latter.

@steveklabnik
Copy link
Member Author

Please read the RFC for the answer to this.

On Sep 9, 2015, at 08:01, Ticki notifications@github.com wrote:

Why store the executables in $HOME rather than in /usr/local/bin? I prefer the latter.


Reply to this email directly or view it on GitHub.

@ticki
Copy link

ticki commented Sep 9, 2015

Oh, sorry!

@bgdncz
Copy link

bgdncz commented Oct 4, 2015

Bump!

@steveklabnik
Copy link
Member Author

Yeah, I haven't had the chance to keep working on this. If someone else
wants to work on it, feel free, I will not be mad.

On Sun, Oct 4, 2015 at 11:17 AM, Bogdan Cuza notifications@github.com
wrote:

Bump!


Reply to this email directly or view it on GitHub
#1967 (comment).

@bgdncz
Copy link

bgdncz commented Oct 4, 2015

I guess I could address the issues pointed out by @alexcrichton

@alexcrichton
Copy link
Member

@boghison oh I'm actually going to be starting work on cargo install pretty soon (this coming week or so), so there should be movement on this quite soon!

@bgdncz
Copy link

bgdncz commented Oct 4, 2015

@alexcrichton Oh, if you want to work on it, then I guess I shouldn't get in the way

@alexcrichton
Copy link
Member

Continued in #2026, thanks @steveklabnik!

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.

None yet

8 participants