about summary refs log tree commit diff
path: root/src/bootstrap
AgeCommit message (Collapse)AuthorLines
2023-07-06Rollup merge of #113371 - jyn514:submodule-with-tags, r=albertlarsan68fee1-dead-0/+3
Fix submodule handling when the current branch is named after a tag If: 1. The current branch has the same name as git tag, and 2. The current branch is set to track a remote other than `origin`, and 3. We try to update a submodule then we'll get the following error: ``` ; x c Updating submodule src/doc/reference remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0 fatal: 'personal' does not appear to be a git repository fatal: Could not read from remote repository. ``` The problem is that 1. causes `git symbolic-ref --short HEAD` to try and disambiguate the branch from the tag using `heads/branch-name`, which breaks a previous workaround for a bug in `git submodule update` that uses the wrong remote. Adapt the workaround to strip `heads/` from the output.
2023-07-05Fix submodule handling when the current branch is named after a tagjyn-0/+3
If: 1. The current branch has the same name as git tag, and 2. The current branch is set to track a remote other than `origin`, and 3. We try to update a submodule then we'll get the following error: ``` ; x c Updating submodule src/doc/reference remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0 fatal: 'personal' does not appear to be a git repository fatal: Could not read from remote repository. ``` The problem is that 1. causes `git symbolic-ref --short HEAD` to try and disambiguate the branch from the tag using `heads/branch-name`, which breaks a previous workaround for a bug in `git submodule update` that uses the wrong remote. Adapt the workaround to strip `heads/` from the output.
2023-07-05Rollup merge of #113356 - he32:netbsd-riscv64, r=oli-obkMichael Goulet-1/+4
Add support for NetBSD/riscv64 aka. riscv64gc-unknown-netbsd.
2023-07-05Rollup merge of #113010 - klensy:ri-rls-fmt, r=ozkanonurMichael Goulet-1/+1
rust-installer & rls: remove exclusion from rustfmt & tidy <strike>based on #112884</strike> `rust-installer` and `rls` no longer submodules, but not removed from exclude list for rustfmt and tidy, preventing running fmt and lints on them.
2023-07-05Add support for NetBSD/riscv64 aka. riscv64gc-unknown-netbsd.Havard Eidnes-1/+4
2023-07-05Auto merge of #112697 - tgross35:explain-markdown, r=oli-obkbors-0/+5
Add simple markdown formatting to `rustc --explain` output This is a second attempt at #104540, which is #63128 without dependencies. This PR adds basic markdown formatting to `rustc --explain` output when available. Currently, the output just displays raw markdown: this works of course, but it really doesn't look very elegant. (output is `rustc --explain E0038`) <img width="583" alt="image" src="https://github.com/rust-lang/rust/assets/13724985/ea418117-47af-455b-83c0-6fc59276efee"> After this patch, sample output from the same file: <img width="693" alt="image" src="https://github.com/rust-lang/rust/assets/13724985/12f7bf9b-a3fe-4104-b74b-c3e5227f3de9"> This also obeys the `--color always/auto/never` command option. Behavior: - If pager is available and supports color, print with formatting to the pager - If pager is not available or fails print with formatting to stdout - otherwise without formatting - Follow `--color always/never` if suppied - If everything fails, just print plain text to stdout r? `@oli-obk` cc `@estebank` (since the two of you were involved in the previous discussion)
2023-07-04bootstrap: rust-installer no loger subtree, so allow running lints over itklensy-1/+1
2023-07-03Remove compare modeMichael Goulet-1/+1
2023-07-03Add a simple markdown parser for formatting `rustc --explain`Trevor Gross-0/+5
Currently, the output of `rustc --explain foo` displays the raw markdown in a pager. This is acceptable, but using actual formatting makes it easier to understand. This patch consists of three major components: 1. A markdown parser. This is an extremely simple non-backtracking recursive implementation that requires normalization of the final token stream 2. A utility to write the token stream to an output buffer 3. Configuration within rustc_driver_impl to invoke this combination for `--explain`. Like the current implementation, it first attempts to print to a pager with a fallback colorized terminal, and standard print as a last resort. If color is disabled, or if the output does not support it, or if printing with color fails, it will write the raw markdown (which matches current behavior). Pagers known to support color are: `less` (with `-r`), `bat` (aka `catbat`), and `delta`. The markdown parser does not support the entire markdown specification, but should support the following with reasonable accuracy: - Headings, including formatting - Comments - Code, inline and fenced block (no indented block) - Strong, emphasis, and strikethrough formatted text - Links, anchor, inline, and reference-style - Horizontal rules - Unordered and ordered list items, including formatting This parser and writer should be reusable by other systems if ever needed.
2023-07-02Auto merge of #113260 - flip1995:clippyup, r=Manishearthbors-17/+5
Update Clippy r? `@Manishearth` cc `@oli-obk` (for the ui-test changes in de69d556eb5006a21f868b8c12d48f0ef1308a5a and the valtree fix in 0cbe963e51faa7e3e771c1f9cea9aa443a648455) Fixes https://github.com/rust-lang/rust/issues/102093 This must've been the most involved Clippy sync ever.
2023-07-02Fix compile-test tests to work with the new ui_test cratePhilipp Krones-17/+5
2023-07-02Rollup merge of #113244 - Kobzol:bootstrap-rust-analyzer-tests, r=jyn514Matthias Krüger-1/+3
Make Rust Analyzer tests faster by compiling less code This should bring down the test duration of RA significantly.
2023-07-02Rollup merge of #113234 - jyn514:revert-python-test-args, r=clubby789Matthias Krüger-5/+15
Don't pass --test-args to `python -m unitest` The args for unittest and cargo test are mutually incompatible. Suggest that people use `python -m unittest ...` manually instead. This also changes `bootstrap_test.py` to be easier to run standalone; see the commit for details. r? `@clubby789` cc https://github.com/rust-lang/rust/pull/112281#discussion_r1248849172
2023-07-02Auto merge of #112756 - hi-rustin:rustin-patch-bootstrap, r=clubby789bors-9/+65
Use RustOptimize to set optimize close https://github.com/rust-lang/rust/issues/112678 Use RustOptimize to set optimize.
2023-07-02Fix broken testshi-rustin-5/+1
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2023-07-01Make Rust Analyzer tests faster by compiling less codeJakub Beránek-1/+3
2023-07-01Don't pass --test-args to `python -m unitest`jyn-5/+15
The args for unittest and cargo test are mutually incompatible. Suggest that people use `python -m unittest ...` manually instead. This also changes `bootstrap_test.py` to be easier to run standalone; see the commit for details.
2023-07-01Add tests for RustOptimizehi-rustin-1/+20
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2023-07-01Use RustOptimize to set optimizehi-rustin-9/+50
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2023-07-01msvc dist extended: rust-analyzer is optionalRémy Rakic-19/+20
The windows tarballs and installers expect rust-analyzer to be present, but it's not always the case. For example, in try builds.
2023-07-01msvc dist extended: clippy is optionalRémy Rakic-22/+29
The windows tarballs and installers expect clippy to be present, but it's not always the case. For example, in try builds.
2023-07-01Rollup merge of #113185 - jyn514:dist-channel, r=ozkanonurMatthias Krüger-0/+3
Set `channel = nightly` in dist profile This avoids some channel-specific defaults leaking into local installs. It also makes it easier to set options for compiler/library/codegen profiles in the future, since they can be gated off `channel` instead of being duplicated between all three files. Here are the exact things `channel` controls today: https://github.com/rust-lang/rust/blob/68d458bb402b873b9ae80423710c2672967479df/src/bootstrap/llvm.rs#L466-L470 https://github.com/rust-lang/rust/blob/85c4ea0138fcca2e8cf4515a063cd3b762d64aec/src/bootstrap/config.rs#L1374-L1375 https://github.com/rust-lang/rust/blob/85c4ea0138fcca2e8cf4515a063cd3b762d64aec/src/bootstrap/config.rs#L1464-L1465 ``@cuviper`` i expect you don't want any of those to be set in distro builds, right?
2023-06-29Set `channel = nightly` in dist profilejyn-0/+3
2023-06-29Rollup merge of #112300 - Zalathar:run-coverage, r=wesleywiserMatthias Krüger-4/+18
Convert `run-make/coverage-reports` tests to use a custom compiletest mode I was frustrated by the fact that most of the coverage tests are glued together with makefiles and shell scripts, so I tried my hand at converting most of them over to a newly-implemented `run-coverage` mode/suite in compiletest. This ~~*mostly*~~ resolves #85009, ~~though I've left a small number of the existing tests as-is because they would require more work to fix/support~~. --- I had time to go back and add support for the more troublesome tests that I had initially skipped over, so this PR now manages to completely get rid of `run-make/coverage-reports`. --- The patches are arranged as follows: - Declare the new mode/suite in bootstrap - Small changes to compiletest that will be used by the new mode - Implement the new mode in compiletest - Migrate most of the tests over - Add more code to bootstrap and compiletest to support the remaining tests - Migrate the remaining tests (with some temporary hacks to avoid re-blessing them) - Remove the temporary hacks and re-bless the migrated tests - Remove the unused remnants of `run-make/coverage-reports`
2023-06-29Rollup merge of #112234 - ozkanonur:hotfix, r=jyn514Matthias Krüger-9/+41
refactor `tool_doc!` resolves https://github.com/rust-lang/rust/pull/112211#discussion_r1215190510
2023-06-29refactor `tool_doc!` so that it can accept additional arguments.ozkanonur-9/+41
Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-06-29Rollup merge of #113048 - psumbera:solaris-bootstrap-cfgs, r=ozkanonurTakayuki Maeda-4/+6
Fix build on Solaris where fd-lock cannot be used. This fixes build regression after https://github.com/rust-lang/rust/commit/e7e584b7d9d4eba8b9655b255840ef9caf9b40c0. Resolves #113085
2023-06-28Rollup merge of #111571 - jhpratt:proc-macro-span, r=m-ou-seDylan DPC-2/+2
Implement proposed API for `proc_macro_span` As proposed in [#54725 (comment)](https://github.com/rust-lang/rust/issues/54725#issuecomment-1546918161). I have omitted the byte-level API as it's already available as [`Span::byte_range`](https://doc.rust-lang.org/nightly/proc_macro/struct.Span.html#method.byte_range). `@rustbot` label +A-proc-macros r? `@m-ou-se`
2023-06-28Declare a `run-coverage-rustdoc` suite for coverage tests that need `rustdoc`Zalathar-0/+7
2023-06-28Declare a `run-coverage` test mode/suite in bootstrapZalathar-4/+11
2023-06-27[PATCH] Fix build on Solaris where fd-lock cannot be used.Petr Sumbera-4/+6
2023-06-26bootstrap: rename 'user' profile to 'dist'clubby789-10/+43
2023-06-26Rollup merge of #113034 - jyn514:ci-progress, r=oli-obkMatthias Krüger-16/+20
Switch some more Steps to `builder.msg` In particular, this hides compiletest suites under a dropdown - some builders are configured with `verbose-tests`, which makes the suites take up many thousands of lines. before: ``` Documenting stage1 cargo (x86_64-unknown-linux-gnu) Check compiletest suite=rustdoc-js mode=js-doc-test (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu) ``` after: ``` ::group::Documenting stage1 cargo (x86_64-unknown-linux-gnu) ::group::Testing stage1 compiletest suite=rustdoc-js mode=js-doc-test (x86_64-unknown-linux-gnu) ``` found this from https://github.com/rust-lang-ci/rust/actions/runs/5366993848/jobs/9736792611 r? `@oli-obk`
2023-06-26Rollup merge of #111326 - he32:netbsd-aarch64-be, r=oli-obkMatthias Krüger-0/+1
Add support for NetBSD/aarch64-be (big-endian arm64).
2023-06-26Rollup merge of #112281 - jyn514:test-bootstrap-py, r=albertlarsan68Takayuki Maeda-107/+144
Test the cargo args generated by bootstrap.py I recommend reviewing this commit-by-commit using the instructions in https://rustc-dev-guide.rust-lang.org/git.html#moving-large-sections-of-code. - Test cargo arguments passed by bootstrap.py This moves a lot of code around, but the logic itself is not too terribly complicated. - Move almost all logic in `def bootstrap` to the `RustBuild` class, to avoid mixing setting configuration with running commands - Update various doctests to the new (more complete) RustBuild config. In particular, don't pretend that `bin_root` supports `build` being unset. - Change `parse_args` not to use a global, to allow testing it - Set BUILD_DIR appropriately so bootstrap.py doesn't panic because cargo isn't found - Allow passing arguments to `bootstrap_test.py` Previous, it used the built-in test runner, which doesn't support options unless they're manually passed in the script. - Fix progress messages for configure in bootstrap_test.py Before it would unconditionally print `configure-args = []`. r? `@albertlarsan68` cc https://github.com/rust-lang/rust/pull/112089 https://github.com/rust-lang/rust/pull/111979#issuecomment-1568525699
2023-06-25fix some bugsjyn-1/+7
- fix tests when `--build` is set - don't leak `config.example.toml` fd - don't crash if `config.toml` doesn't exist yet
2023-06-25Switch some more Steps to `builder.msg`jyn-16/+20
In particular, this hides compiletest suites under a dropdown - some builders are configured with `verbose-tests`, which makes the suites take up many thousands of lines. before: ``` Documenting stage1 cargo (x86_64-unknown-linux-gnu) Check compiletest suite=rustdoc-js mode=js-doc-test (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu) ``` after: ``` ::group::Documenting stage1 cargo (x86_64-unknown-linux-gnu) ::group::Testing stage1 compiletest suite=rustdoc-js mode=js-doc-test (x86_64-unknown-linux-gnu) ```
2023-06-25Rollup merge of #112918 - zephaniahong:issue-107077-fix, r=Mark-SimulacrumGuillaume Gomez-36/+21
display PID of process holding lock Displays PID of process holding lock when trying to run multiple instances of x.py
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-24Don't test the profile override hackjyn-12/+15
It generates invalid TOML. I want to get rid of it eventually, but this avoids the issue in the meantime.
2023-06-23Test color/verbose/warnings properlyjyn-22/+25
These weren't being passed in to bootstrap consistently before; in particular `serialize_and_parse` forgot to pass them in.
2023-06-23Test cargo arguments passed by bootstrap.pyjyn-88/+118
This moves a lot of code around, but the logic itself is not too terribly complicated. - Move almost all logic in `def bootstrap` to the `RustBuild` class, to avoid mixing setting configuration with running commands - Update various doctests to the new (more complete) RustBuild config. In particular, don't pretend that `bin_root` supports `build` being unset. - Change `parse_args` not to use a global, to allow testing it - Set BUILD_DIR appropriately so bootstrap.py doesn't panic because cargo isn't found
2023-06-23Allow passing arguments to `bootstrap_test.py`jyn-14/+9
Previous, it used the built-in test runner, which doesn't support options unless they're manually passed in the script.
2023-06-23Fix progress messages for configure in bootstrap_test.pyjyn-1/+1
Before it would unconditionally print `configure-args = []`.
2023-06-23Make `try_run` return a `Result<(), ()>` instead of a booleanGuillaume Gomez-40/+49
2023-06-23display pid of process holding lockZephaniah Ong-36/+21
2023-06-21Revert 'Rename profile=user to profile=dist'clubby789-7/+7
This reverts commit a45fc9465204c9fb8c6792e74e3ed10959e46001
2023-06-20Delete use of proc_macro_span_shrink from proc-macro2David Tolnay-2/+2
2023-06-19Rollup merge of #112499 - tgross35:py-ruff-fixes, r=Mark-SimulacrumMichael Goulet-7/+7
Fix python linting errors These were flagged by `ruff`, run using the config in https://github.com/rust-lang/rust/pull/112482
2023-06-18Auto merge of #112774 - compiler-errors:rollup-z8oof6r, r=compiler-errorsbors-5/+7
Rollup of 6 pull requests Successful merges: - #112537 (Don't record adjustments twice in `note_source_of_type_mismatch_constraint`) - #112663 (cleanup azure leftovers) - #112668 (Test `x.ps1` in `msvc` CI job) - #112710 (Re-use the deref-pattern recursion instead of duplicating the logic) - #112753 (Don't try to auto-bless 32-bit `mir-opt` tests on ARM Mac hosts) - #112758 (refactor(resolve): delete update_resolution function) r? `@ghost` `@rustbot` modify labels: rollup