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

Implement cargo install #2026

Merged
merged 2 commits into from
Oct 19, 2015
Merged

Implement cargo install #2026

merged 2 commits into from
Oct 19, 2015

Conversation

alexcrichton
Copy link
Member

This commit is an implementation of RFC 1200 which brings two new
subcommands: cargo install and cargo uninstall. Most of this is a straight
implementation of the RFC, but a few tweaks were made:

  • The -p or --package arguments are no longer needed as you just pass
    crate as a bare argument to the command, this means cargo install foo
    works and downloads from crates.io by default.
  • Some logic around selecting which crate in a multi-crate repo is installed has
    been tweaked slightly, but mostly in the realm of "let's do the thing that
    makes sense" rather than the literal "let's do what's in the RFC".
    Specifically, we don't pick a crate with examples if there are multiple crates
    with binaries (instead an error is generated saying there are multiple binary
    crates).

@rust-highfive
Copy link

r? @wycats

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

@alexcrichton
Copy link
Member Author

r? @wycats + @brson

the installation root's `bin` folder. The installation root is determined, in
order of precedence, by `--root`, `$CARGO_INSTALL_ROOT`, the `install.root`
configuration key, and finally the home directory (which is either
`$CARGO_HOME` if set or `$HOME/.cargo` by default).

Choose a reason for hiding this comment

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

I'd like to note my continuing discomfort with inventing Yet Another Language-Specific Homedir Install Location, rather than using ${HOME}/.local/, which is intended for user-scoped installation.

Copy link
Member

Choose a reason for hiding this comment

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

This isn't inventing a new one, as ~/.cargo is already being used.

Choose a reason for hiding this comment

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

That's why it's continuing discomfort 😛

@florianjacob
Copy link

I'd also love to see cargo following the xdg basedir specification and the systemd file hierarchy, which, as I just learned, even has a section specifically on where to place user packages like in this case.

@steveklabnik
Copy link
Member

"let's do the thing that makes sense" rather than the literal "let's do what's in the RFC".

Can we amend the RFC afterwards, so there's consistency?

@steveklabnik
Copy link
Member

@florianjacob that's covered by #1734

@florianjacob
Copy link

@steveklabnik #1734 only covers the xdg basedir specification regarding where to put cargo's regular config and data files. But cargo install makes the systemd file hierarchy standard relevant, too, as it specifies how user packages should be put in ~/.local/bin, ~/.local/lib/<arch-id>, ~/.local/lib/<package>/ etc.

@steveklabnik
Copy link
Member

@florianjacob regardless, it's off-topic here, as we have an RFC with this design already agreed upon. I'm not saying such a change isn't worth it, but it should be a new issue with its own discussion and everything else.

Though I guess @alexcrichton is already deviating from the RFC... :/

@alexcrichton alexcrichton force-pushed the cargo-install branch 6 times, most recently from 53adb87 to 7abffd8 Compare October 7, 2015 23:20
@brson
Copy link
Contributor

brson commented Oct 16, 2015

@bors r+

@bors
Copy link
Contributor

bors commented Oct 16, 2015

📌 Commit 7abffd8 has been approved by brson

@bors
Copy link
Contributor

bors commented Oct 16, 2015

⌛ Testing commit 7abffd8 with merge d090d38...

@bors
Copy link
Contributor

bors commented Oct 16, 2015

💔 Test failed - cargo-mac-64

steveklabnik and others added 2 commits October 18, 2015 21:38
This commit is an implementation of [RFC 1200][rfc] which brings two new
subcommands: `cargo install` and `cargo uninstall`. Most of this is a straight
implementation of the RFC, but a few tweaks were made:

* The `-p` or `--package` arguments are no longer needed as you just pass
  `crate` as a bare argument to the command, this means `cargo install foo`
  works and downloads from crates.io by default.
* Some logic around selecting which crate in a multi-crate repo is installed has
  been tweaked slightly, but mostly in the realm of "let's do the thing that
  makes sense" rather than the literal "let's do what's in the RFC".
  Specifically, we don't pick a crate with examples if there are multiple crates
  with binaries (instead an error is generated saying there are multiple binary
  crates).

[rfc]: https://github.com/rust-lang/rfcs/blob/master/text/1200-cargo-install.md
@alexcrichton
Copy link
Member Author

@bors: r=brson

@bors
Copy link
Contributor

bors commented Oct 19, 2015

📌 Commit bc60f64 has been approved by brson

@bors
Copy link
Contributor

bors commented Oct 19, 2015

⌛ Testing commit bc60f64 with merge 1206e5e...

bors added a commit that referenced this pull request Oct 19, 2015
This commit is an implementation of [RFC 1200][rfc] which brings two new
subcommands: `cargo install` and `cargo uninstall`. Most of this is a straight
implementation of the RFC, but a few tweaks were made:

* The `-p` or `--package` arguments are no longer needed as you just pass
  `crate` as a bare argument to the command, this means `cargo install foo`
  works and downloads from crates.io by default.
* Some logic around selecting which crate in a multi-crate repo is installed has
  been tweaked slightly, but mostly in the realm of "let's do the thing that
  makes sense" rather than the literal "let's do what's in the RFC".
  Specifically, we don't pick a crate with examples if there are multiple crates
  with binaries (instead an error is generated saying there are multiple binary
  crates).

[rfc]: https://github.com/rust-lang/rfcs/blob/master/text/1200-cargo-install.md
@bors
Copy link
Contributor

bors commented Oct 19, 2015

@bors bors merged commit bc60f64 into rust-lang:master Oct 19, 2015
@alexcrichton alexcrichton deleted the cargo-install branch October 19, 2015 15:48
carols10cents added a commit to carols10cents/rust.tmbundle that referenced this pull request Oct 24, 2015
This way, people don't necessarily have to set `TM_RACER`. Add in the
locations that [cargo
install](rust-lang/cargo#2026) will be using, on the assumption that
racer will likely start recommending cargo install soon.
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.

8 participants