about summary refs log tree commit diff
path: root/src/bootstrap/setup.rs
AgeCommit message (Collapse)AuthorLines
2023-01-11Change `src/test` to `tests` in source files, fix tidy and testsAlbert Larsan-1/+1
2023-01-04adjust comments about pre-push.sh hookKaDiWa-2/+2
2022-12-22Avoid running the `Profile` step twice on `x setup`Joshua Nelson-0/+4
Prevents runs like the following: ``` $ x setup Welcome to the Rust project! What do you want to do with x.py? a) library: Contribute to the standard library b) compiler: Contribute to the compiler itself c) codegen: Contribute to the compiler, and also modify LLVM or codegen d) tools: Contribute to tools which depend on the compiler, but do not modify it directly (e.g. rustdoc, clippy, miri) e) user: Install Rust from source Please choose one (a/b/c/d/e): b To get started, try one of the following commands: - `x.py check` - `x.py build` - `x.py test` For more suggestions, see https://rustc-dev-guide.rust-lang.org/building/suggested.html `x.py` will now use the configuration at /home/nilsh/projects/rustfast/src/bootstrap/defaults/config.compiler.toml Welcome to the Rust project! What do you want to do with x.py? ... ```
2022-12-17Remove special cases for setup subcommandBenjamin Tong-11/+59
- Remove setup special-casing in Flags::parse
2022-11-26Revamp the order `setup` executesJoshua Nelson-13/+15
- Create `config.toml` last. It's the most likely to error, and used to stop later steps from executing - Don't print an error message + exit if the git hook already exists; that's expected
2022-11-26Refactor `setup_config_toml` into a functionJoshua Nelson-31/+31
2022-11-26Don't update submodules for `x setup`Joshua Nelson-1/+2
Before, the submodule handling was very jank and would update *between two interactive prompts*: ``` ; x setup Building rustbuild Finished dev [unoptimized] target(s) in 0.05s Welcome to the Rust project! What do you want to do with x.py? a) library: Contribute to the standard library Please choose one (a/b/c/d/e): a Updating submodule library/backtrace Submodule 'library/backtrace' (https://github.com/rust-lang/backtrace-rs.git) registered for path 'library/backtrace' error: you asked `x.py` to setup a new config file, but one already exists at `config.toml` Build completed unsuccessfully in 0:00:02 ``` That's not a great user experience because you need to wait a long time between prompts. It would be possible to move the submodule handling either before or after the prompt, but it seems better to just not require submodules to be checked out at all, to minimize the time spend waiting just to create a new configuration.
2022-11-05Place config.toml in current working directory if config not foundTanner Davies-1/+1
2022-08-14Impl Debug for some structs of rustbuildohno418-1/+1
2022-07-11Auto merge of #98526 - jyn514:download-llvm-outside-checkout, r=Mark-Simulacrumbors-7/+6
Allow using `download-ci-llvm = true` outside the git checkout `@bjorn3` noticed that this is already allowed today when download-llvm is disabled, but breaks with it enabled: ``` $ ./rust2/x.py build fatal: not a git repository (or any of the parent directories): .git thread 'main' panicked at 'command did not execute successfully: "git" "rev-list" "--author=bors@rust-lang.org" "-n1" "--first-parent" "HEAD" "--" "/home/jnelson/rust-lang/rust2/src/llvm-project" "/home/jnelson/rust-lang/rust2/src/bootstrap/download-ci-llvm-stamp" "/home/jnelson/rust-lang/rust2/src/version" expected success, got: exit status: 128', src/bootstrap/native.rs:134:20 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ``` Support it too for consistency. It's unclear to me when anyone would need to use this, but `@bjorn3` feels we should support it, and it's not much additional effort to get it working.
2022-07-10Allow using `download-ci-llvm = true` outside the git checkoutJoshua Nelson-7/+6
@bjorn3 noticed that this is already allowed today when download-llvm is disabled, but breaks with it enabled: ``` $ ./rust2/x.py build fatal: not a git repository (or any of the parent directories): .git thread 'main' panicked at 'command did not execute successfully: "git" "rev-list" "--author=bors@rust-lang.org" "-n1" "--first-parent" "HEAD" "--" "/home/jnelson/rust-lang/rust2/src/llvm-project" "/home/jnelson/rust-lang/rust2/src/bootstrap/download-ci-llvm-stamp" "/home/jnelson/rust-lang/rust2/src/version" expected success, got: exit status: 128', src/bootstrap/native.rs:134:20 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ``` Support it too for consistency. It's unclear to me when anyone would need to use this, but @bjorn3 feels we should support it, and it's not much additional effort to get it working. This also updates a bunch of other git commands that were similarly depending on the current directory.
2022-07-07squash the commitstoshiki goto-2/+2
implement detail_exit but I'm not sure it is right. not create new file and write detail exit in lib.rs replace std::process::exit to detail_exit that is not related to code runnning. remove pub
2022-05-25feat: refactored bootstrap files to use stderr consistentlyRaiyan-12/+12
2022-04-05Fix typo in bootstrap/setup.rsCheng XU-1/+1
2022-03-11Remove redundant slicing of whole ranges in `bootstrap`pierwill-5/+5
2022-03-07Don't depend on python for RUST_BOOTSTRAP_CONFIGJoshua Nelson-11/+9
2022-02-07Rollup merge of #93487 - yerke:yerke/fix-link-toolchain-in-setup, ↵Mara Bos-2/+39
r=Mark-Simulacrum Fix linking stage1 toolchain in `./x.py setup` Closes [92319](https://github.com/rust-lang/rust/issues/92319) Fix linking stage1 toolchain in `./x.py setup`. I guess this can be considered a follow up to https://github.com/rust-lang/rust/pull/89212 by `````@Sl1mb0.````` We create 2 directories and 1 file that are required by rustup to [link a custom toolchain from path](https://github.com/rust-lang/rustup/blob/5225e87a5d974ab5f1626bcb2a7b43f76ab883f0/src/toolchain.rs#L479-L497). cc `````@jyn514````` and `````@Mark-Simulacrum````` as they were active in https://github.com/rust-lang/rust/issues/89206
2022-02-07Rollup merge of #88313 - jyn514:pre-push, r=Mark-SimulacrumMara Bos-6/+6
Make the pre-commit script pre-push instead This should make it substantially less annoying, and hopefully more people will find it useful. In particular, it will no longer run tidy each time you run `git commit --amend` or rebase a branch. This also warns if you have the old script in pre-commit; see the HACK comment for details. r? ````@Mark-Simulacrum```` cc ````@caass````
2022-02-05fix linking stage1 toolchain in setupYerkebulan Tulibergenov-2/+39
2021-09-26Link stage1 build to toolchain automaticallyTimothy Maloney-0/+80
Fixed types Add checks for rustup and if toolchain is linked Fortified rustup/directory checks; made other suggested changes Added check for output status Remove output of rustup from console Made suggested change Deleted confusing comment Fixed compiler error; removed extra declaration Refactored to smaller components; made suggested changes Automate toolchain linking for stage 1 builds
2021-08-24Make the pre-commit script pre-push insteadJoshua Nelson-6/+6
This should make it substantially less annoying, and hopefully more people will find it useful. In particular, it will no longer run tidy each time you run `git commit --amend` or rebase a branch. This also warns if you have the old script in pre-commit; see the HACK comment for details.
2021-04-05Add config file for tools enabling stage1 downloads by defaultJoshua Nelson-3/+17
Otherwise no one will be able to find the setting.
2020-12-31bootstrap: clippy fixesMatthias Krüger-2/+2
addresses: clippy::or_fun_call clippy::single_char_add_str clippy::comparison_to_empty clippy::or_fun_call
2020-12-08don't wrap code block in Ok() (clipppy::unit_arg)Matthias Krüger-2/+3
2020-11-07Rollup merge of #78514 - jyn514:setup-number, r=Mark-SimulacrumYuki Okushi-6/+9
Allow using 1/2/3/4 for `x.py setup` options This undocumented feature allows you to typo 'a' as '1'. r? ```@Mark-Simulacrum``` cc ```@Lokathor```
2020-10-29Create config.toml in the current directory, not the top-level directoryJoshua Nelson-1/+1
See https://github.com/rust-lang/rust/issues/78509 for discussion.
2020-10-28Allow using 1/2/3/4 for `x.py setup` optionsJoshua Nelson-6/+9
This undocumented feature allows you to typo 'a' as '1'.
2020-10-20Rollup merge of #77778 - jyn514:git-hook, r=mark-simulacrumYuki Okushi-3/+11
[x.py setup] Allow setting up git hooks from other worktrees Closes https://github.com/rust-lang/rust/issues/77684 r? @caass
2020-10-14x.py setup: Avoid infinite loop if stdin is /dev/nullIan Jackson-0/+4
EOF is not an error; it just causes read_line to produce "". Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2020-10-14x.py setup: Fix handling of wrong interactive inputIan Jackson-1/+1
We need a fresh input buffer each time, or we reuse the previous data (since `read_line` appends). Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2020-10-14x.py: setup: Offer keywords in interactive promptIan Jackson-2/+2
We understand these profile names because we use .to_str(). Mention them in the question. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2020-10-14x.py: setup: Refactor to centralise list of profilesIan Jackson-14/+50
Put all()'s otuput in the order we want to print things in, and add a comment about why they are in this order. Provide purpose() and all_for_help(). Use these things everywhere. Move all the abbrev character ("a", "b", etc.) processing into interactive_path. No functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2020-10-14Rollup merge of #77786 - jyn514:rustdoc, r=Mark-SimulacrumYuki Okushi-2/+2
Mention rustdoc in `x.py setup` This lets new contributors know which option they should pick; previously it wasn't clear 'compiler' also included rustdoc. Unresolved questions: should this say 'compiler and tools' instead? I don't know of any tools that are modified in-tree other than rustdoc, though. r? @Mark-Simulacrum
2020-10-11Mostly print statements to see where things areWinnie Xiao-3/+4
More print statementsstatements lol Solved the basic case of eliminating check_version ifk_version if subcommand = setup Finished v1 checking out old bootstrap.py checked out old irrelevant files fixed tidy Moved VERSION from bin/main.rs to lib.rs Fixed semicolon return issue x.py fmt
2020-10-10Mention rustdoc in `x.py setup`Joshua Nelson-2/+2
This also allows 'rustdoc' as a string for the compiler profile.
2020-10-10Allow setting up git hooks from other worktreesJoshua Nelson-3/+11
2020-10-07Rollup merge of #77400 - alarsyo:xpy-setup-suggestions, r=jyn514Dylan DPC-29/+63
Fix suggestions for x.py setup #76631 introduced a new `setup` command to x.py By default the command prompts for a profile to use: ``` 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) Contribute to the compiler, and also modify LLVM or codegen d) Install Rust from source ``` and then displays command suggestions, depending on which profile was chosen. However [the mapping between chosen profile](https://github.com/rust-lang/rust/blob/9cba260df0f1c67ea3690035cd5611a7465a1560/src/bootstrap/setup.rs#L75-L85) and [suggestion](https://github.com/rust-lang/rust/blob/9cba260df0f1c67ea3690035cd5611a7465a1560/src/bootstrap/setup.rs#L42-L47) isn't exact, leading to suggestions not being shown if the user presses `c` or `d`. (because "c" is translated to "llvm" and "d" to "maintainer", but suggestions trigger for "codegen" and "user" respectively) A more thorough refactor would stop using "strings-as-type" to make sure this kind of error doesn't happen, but it may be overkill for that kind of "script" program? Tagging the setup command author: @jyn514
2020-10-06Auto merge of #76356 - caass:hooks, r=jyn514bors-0/+47
Add a command to install a git hook to automatically run `x.py test tidy --bless` Some folks (such as myself) would probably find a lot of convenience in a pre-commit hook that automatically runs tidy before committing, to avoid burning CI time learning that your commit wasn't tidy. I'm absolutely positive I have missed some stuff. I basically just got this to where you can run `./x.py run install-git-hook` and then clicked the commit button. Please let me know what else you'd like me to add before this can be merged! [rustc-dev-guide companion PR](https://github.com/rust-lang/rustc-dev-guide/pull/848)
2020-10-06Use String type for Profile parse errorAntoine Martin-9/+4
2020-10-06Show available profiles on errorAntoine Martin-0/+4
2020-10-06Use Profile enum for x.py setupAntoine Martin-29/+64
2020-10-06Fix suggestions for x.py setupAntoine Martin-2/+2
2020-10-05Make changes based on @jyn514's commentsCassandra Fridkin-9/+16
2020-10-05Add install_git_hook_maybe to setup.rsCassandra Fridkin-0/+40
2020-10-04Rename bootstrap/defaults/{config.toml.PROFILE => config.PROFILE.toml}Thom Chiovoloni-2/+2
2020-09-24Add `x.py setup`Joshua Nelson-0/+88
- Suggest `x.py setup` if config.toml doesn't exist yet (twice, once before and once after the build) - Prompt for a profile if not given on the command line - Print the configuration file that will be used - Print helpful starting commands after setup - Link to the dev-guide after finishing - Note that distro maintainers will see the changelog warning