about summary refs log tree commit diff
path: root/src/bootstrap/setup.rs
AgeCommit message (Collapse)AuthorLines
2023-10-17move bootstrap core implementation to bootstrap/src/core moduleonur-ozkan-600/+0
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-10-02Auto merge of #115898 - onur-ozkan:config-change-tracking, r=Mark-Simulacrumbors-2/+3
bootstrap major change detection implementation The use of `changelog-seen` and `bootstrap/CHANGELOG.md` has not been functional in any way for many years. We often do major/breaking changes but never update the changelog file or the `changelog-seen`. This is an alternative method for tracking major or breaking changes and informing developers when such changes occur. Example output when bootstrap detects a major change: ![image](https://github.com/rust-lang/rust/assets/39852038/ee802dfa-a02b-488b-a433-f853ce079b8a)
2023-10-01implement major change tracking for the bootstrap configurationonur-ozkan-2/+3
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-09-14update SETTINGS_HASHESRalf Jung-0/+1
2023-07-31Rollup merge of #113906 - notriddle:notriddle/cargo-extra-env, r=Mark-SimulacrumMatthias Krüger-0/+1
etc: add `RUSTC_BOOTSTRAP` to rust-analyzer config Fixes the problem reported in https://github.com/rust-lang/rust/issues/112391#issuecomment-1597224941
2023-07-30bootstrap: inline format!() argsMatthias Krüger-7/+6
2023-07-20etc: add `RUSTC_BOOTSTRAP` to rust-analyzer configMichael Howell-0/+1
Fixes the problem reported in https://github.com/rust-lang/rust/issues/112391#issuecomment-1597224941
2023-07-13Rename `detail_exit_macro` to `exit`jyn-2/+2
`detail` and `macro` weren't adding any info.
2023-06-26bootstrap: rename 'user' profile to 'dist'clubby789-7/+7
2023-06-24bootstrap: Backup `settings.json` to the correct filenameNoah Lev-1/+1
The old code actually replaced `.json` with `.bak` (so, `settings.bak`), rather than appending `.bak` as claimed (`settings.json.bak`). `Path::set_extension` can instead be used with dots: > The new extension may contain dots and will be used in its entirety, > but only the part after the final dot will be reflected in > self.extension.
2023-06-21Revert 'Rename profile=user to profile=dist'clubby789-7/+7
This reverts commit a45fc9465204c9fb8c6792e74e3ed10959e46001
2023-06-10Improve documentation for `tools` profileZachary Whiteley-0/+8
Make the build process more beginner friendly: - Include information explaining that the stage2 toolchain should be used (and not the stage1 toolchain) due to the `download-rustc` setting. - Display a message when the user runs `x setup tools` explaining that they should use the stage2 toolchain.
2023-06-03Rollup merge of #111998 - jyn514:ra-dogfooding, r=Mark-SimulacrumMatthias Krüger-0/+1
Add other workspaces to `linkedProjects` in rust_analyzer_settings This makes go-to-definition, etc. work in cg_clif, cg_gcc, rust-analyzer, and src/tools/x.
2023-06-01Update setup.rsGary-7/+7
2023-05-30create `build_helper/src/util` modozkanonur-2/+2
Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-05-26Add other workspaces to `linkedProjects` in `rust_analyzer_settings.json`jyn-0/+1
This makes go-to-definition, etc. work in cg_clif, cg_gcc, rust-analyzer, and src/tools/x.
2023-03-01Rename `src/etc/vscode_settings.json` to `rust_analyzer_settings.json`KittyBorgX-5/+5
2023-02-25Rollup merge of #107848 - clubby789:x-setup-options, r=Mark-SimulacrumMichael Goulet-17/+103
Split `x setup` sub-actions to CLI arguments Closes #107846 This adds a new `none` profile option which simply skips the `config.toml` step. It also adds `hook` and `vscode` subcommands, for installing the pre-push hook and getting `settings.json` respectively.
2023-02-17Change src/etc/vscode_settings.json to always treat ./library as the sysroot ↵Joshua Nelson-0/+1
source See https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frust-analyzer/topic/False.20error.20report.20for.20.60rust-analyzer.28private-field.29.60 for further discussion; previously this had various bugs. I tested go-to-definition on: - `use std::io::Write` in `src/bootstrap/setup.rs` - `use std::cell::RefCell` in `src/librustdoc/core.rs` - `use rustc_span::symbol::sym` in `src/librustdoc/core.rs` - `use std::fmt` in `compiler/rustc_span/src/symbol.rs` - `Global` in `library/alloc/src/alloc/tests.rs` The following things still don't work: - `Global.deallocate` in alloc/tests.rs. This function is under `cfg(not(test))`, so it can't be enabled without disabling RA in `tests.rs` altogether. I think this might be fixable by moving `library/alloc/src/alloc/tests.rs` to `library/alloc/tests/alloc/lib.rs`, so it's in a different crate, but I'd like to avoid blocking this improvement on that change.
2023-02-13Add additional options to `x setup`clubby789-17/+103
2023-02-08Set `rust-analyzer.check.invocationLocation` to `root`clubby789-3/+5
2023-02-07Allow automatically creating vscode `settings.json` from bootstrapclubby789-26/+121
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