Skip to content

cargo has to be installed before buildng rust from source code? #61142

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

Closed
BaoshanPang opened this issue May 25, 2019 · 3 comments
Closed

cargo has to be installed before buildng rust from source code? #61142

BaoshanPang opened this issue May 25, 2019 · 3 comments

Comments

@BaoshanPang
Copy link
Contributor

In README.md, there is:

then run these two commands and then try sudo ./x.py install again:

$ cargo install cargo-vendor
$ cargo vendor

But later it also says:

This install does not include Cargo, Rust's package manager, which you may also want to build.

So for the 'cargo' used above, where it comes from? Do we have to instal cargo before building rust from source code?

@sanxiyn
Copy link
Member

sanxiyn commented May 25, 2019

Rust build system automatically downloads Cargo to be used for build. Exactly what is downloaded is specified in src/stage0.txt.

@BaoshanPang
Copy link
Contributor Author

Hi Danxiyn,

Thanks for your help.
From stage0.txt, I see a beta cargo would be downloaded for build:
date: 2019-03-20
rustc: beta
cargo: beta

Is there a way to tell the system to download a nightly version? I am asking this question because I need to use command "cargo update" in the build source tree, but this function is only supported in nightly version.

Thanks,
Baoshan

@sanxiyn
Copy link
Member

sanxiyn commented May 29, 2019

Rust issue tracker is not a Q&A board. You may have better luck at https://internals.rust-lang.org/.

As for the title of this issue, the answer is no. Cargo does not need to be installed before building Rust, because build itself does installation for you. Closing.

@sanxiyn sanxiyn closed this as completed May 29, 2019
bors added a commit that referenced this issue Jul 11, 2019
Update cargo-vendor usage

This contains a variety of updates to clean up the usage of cargo-vendor.

- Remove the install step for the old cargo-vendor now that it is built-in to cargo and available in the stage0 install.
- Update installation instructions, dealing with vendoring. The current instructions of running `sudo ./x.py install` is broken, it will almost always fail (since the vendor directory doesn't exist). Since the steps for properly handling this are numerous, I'm recommending removing the suggestion to use `sudo` altogether.
- If the sudo-forced-vendoring detects that the vendor directory is not available, abort with instructions on how to fix.
- Now that cargo-vendor is built-in, automatically run it if it looks like it is needed.
- Update instructions on how to install cargo.
- Remove the unused markdown link references in README/CONTRIBUTING. This reverts most of #44935. These references don't do anything if they are unused.

Closes #49269
cc #61142 #48771 #40108
bors added a commit that referenced this issue Jul 12, 2019
Update cargo-vendor usage

This contains a variety of updates to clean up the usage of cargo-vendor.

- Remove the install step for the old cargo-vendor now that it is built-in to cargo and available in the stage0 install.
- Update installation instructions, dealing with vendoring. The current instructions of running `sudo ./x.py install` is broken, it will almost always fail (since the vendor directory doesn't exist). Since the steps for properly handling this are numerous, I'm recommending removing the suggestion to use `sudo` altogether.
- If the sudo-forced-vendoring detects that the vendor directory is not available, abort with instructions on how to fix.
- Now that cargo-vendor is built-in, automatically run it if it looks like it is needed.
- Update instructions on how to install cargo.
- Remove the unused markdown link references in README/CONTRIBUTING. This reverts most of #44935. These references don't do anything if they are unused.

Closes #49269
cc #61142 #48771 #40108
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

No branches or pull requests

3 participants
@sanxiyn @BaoshanPang and others