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

rustbuild lacks make install #34675

Closed
Aatch opened this issue Jul 6, 2016 · 3 comments
Closed

rustbuild lacks make install #34675

Aatch opened this issue Jul 6, 2016 · 3 comments
Labels
T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@Aatch
Copy link
Contributor

Aatch commented Jul 6, 2016

I decided to switch to using rustbuild recently and discovered that there is no make install for rustbuild. This is somewhat annoying as it's not very clear how exactly to do a full install of the just-built compiler given what's there.

@Aatch Aatch added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Jul 6, 2016
@alexcrichton
Copy link
Member

Oh dear, this is a very good point! I ended up doing 90% of the work without going all the way there! So it turns out that make install is actually a very thin wrapper around make prepare which in rustbuild is just --step dist. This should definitely be implemented!

The step for implementing this are likely along the lines of:

  • Add an install target to this array with the one argument of a `stage.
  • Modify this function to say that the dependency of the install target is the dist target
  • Add a case to this loop to dispatch the to the right step
  • Add an install function to dist.rs most likely to install local artifacts.
  • In the install function, extract the tarball created by the dist step, run the install.sh script for the std pkg, the rustc pkg, and optionally the docs pkg

This shouldn't be too hard but I'm not going to tag this with E-easy as it's somewhat difficult. Especially around handling sudo vs not-sudo I think could get a little tricky, but the gist is that we should probably just refuse a bootstrap build or rustbuild build if the $USER is root, having make install delegate to the right user to prepare the installation. Then the make install target could just make sure to install to the right location regardless of the user.

@alexcrichton
Copy link
Member

As pointed out by @jirutka we should be careful to respect GNU standards here for environment variables and such when implementing this.

bors added a commit that referenced this issue Oct 6, 2016
rustbuild: Add install target. #34675

It just prints to the screen currently.

r? @alexcrichton

I'm working on the next commit to actually have it install.
@alexcrichton
Copy link
Member

Fixed in #35641

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

No branches or pull requests

2 participants