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

Add x.py setup or similar #76503

Closed
jyn514 opened this issue Sep 9, 2020 · 3 comments · Fixed by #76631
Closed

Add x.py setup or similar #76503

jyn514 opened this issue Sep 9, 2020 · 3 comments · Fixed by #76631
Assignees
Labels
A-contributor-roadblock Area: Makes things more difficult for new contributors to rust itself C-feature-request Category: A feature request, i.e: not implemented / a PR. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@jyn514
Copy link
Member

jyn514 commented Sep 9, 2020

It has been impressed into me several times that there are no good defaults for everyone. Instead, what if people could choose their own defaults, but in a guided way? I'm imagining something like this:

$ x.py setup
Welcome to the Rust project! What do you want to do with x.py?
a) Contribute to the standard library
b) Contribute to the compiler
c) Install Rust from source
Please choose one (a/b/c): b
Changed the following settings:
- `incremental = true`
- `debug = true`
Do you plan to modify codegen/LLVM? (y/[n]): n
# maybe some magic with $(which llvm-config) here; but won't be necessary after https://github.com/rust-lang/rust/pull/76349
To get started, try one of the following commands:
- `x.py check`
- `x.py build library/std`
- `x.py test src/test/ui`

This would be entirely opt-in, if you don't like it, just don't run the command and modify config.toml.example as before. This would work best in conjunction with #76165, but does not require it.

cc @Lokathor, @thomcc

@jyn514 jyn514 added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) C-feature-request Category: A feature request, i.e: not implemented / a PR. labels Sep 9, 2020
@jyn514
Copy link
Member Author

jyn514 commented Sep 9, 2020

Oh, another thing this would make easier is #76446 - instead of messing around with RUSTC_BOOTSTRAP or other env variables, the criteria would just be 'have you run x.py setup in the past' (maybe with a switch in config.toml actually controlling the state).

@thomcc
Copy link
Member

thomcc commented Sep 9, 2020

This reminds me a lot of ./mach bootstrap from mozilla-central (one of the things it does anyway — it also installs build dependencies which isn't relevant here), which is pretty good and what inspired my suggestion.

@jyn514
Copy link
Member Author

jyn514 commented Sep 11, 2020

Another idea I had just now was to suggest running x.py setup the very first time you run x.py to make it more discoverable. This would be opt-out by running with -q the first time to hide the warning. I expect only distro maintainers to use the -q option since they're running x.py for the first time a lot; everyone else will only ever run it once.

@jyn514 jyn514 added the A-contributor-roadblock Area: Makes things more difficult for new contributors to rust itself label Sep 13, 2020
@jyn514 jyn514 self-assigned this Sep 18, 2020
RalfJung added a commit to RalfJung/rust that referenced this issue Sep 25, 2020
Add `x.py setup`

Closes rust-lang#76503.

- Suggest `x.py setup` if config.toml doesn't exist yet
- Prompt for a profile if not given on the command line
- Print the configuration that will be used
- Print helpful starting commands after setup
- Link to the dev-guide after finishing
RalfJung added a commit to RalfJung/rust that referenced this issue Sep 25, 2020
Add `x.py setup`

Closes rust-lang#76503.

- Suggest `x.py setup` if config.toml doesn't exist yet
- Prompt for a profile if not given on the command line
- Print the configuration that will be used
- Print helpful starting commands after setup
- Link to the dev-guide after finishing
@bors bors closed this as completed in c39598a Sep 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-contributor-roadblock Area: Makes things more difficult for new contributors to rust itself C-feature-request Category: A feature request, i.e: not implemented / a PR. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants