about summary refs log tree commit diff
path: root/src/tools/build_helper
AgeCommit message (Collapse)AuthorLines
2024-11-11move `src/tools/build_helper` into `src/build_helper`onur-ozkan-657/+0
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-10-12Rollup merge of #131358 - onur-ozkan:129528, r=Mark-SimulacrumTrevor Gross-3/+13
force "HEAD" for non-CI and `git_upstream_merge_base` for CI environment When rust-lang/rust is configured as remote, some of the git logic (for tracking changed files) that uses get_closest_merge_commit starts to produce annoying results as the upstream branch becomes outdated quickly (since it isn't updated with git pull). We can rely on HEAD for non-CI environments as we specifically treat bors commits as merge commits, which also exist on upstream. As for CI environments, we should use `git_upstream_merge_base` to correctly track modified files as bors commits may be in `HEAD` but not yet on the upstream remote. This is also an alternative fix for https://github.com/rust-lang/rust/issues/129528 since https://github.com/rust-lang/rust/pull/131331 reverts the previous fix attempts.
2024-10-12force "HEAD" for non-CI and `git_upstream_merge_base` for CI environmentonur-ozkan-3/+13
When rust-lang/rust is configured as remote, some of the git logic (for tracking changed files) that uses get_closest_merge_commit starts to produce annoying results as the upstream branch becomes outdated quickly (since it isn't updated with git pull). We can rely on HEAD for non-CI environments as we specifically treat bors commits as merge commits, which also exist on upstream. As for CI environments, we should use `git_upstream_merge_base` to correctly track modified files as bors commits may be in `HEAD` but not yet on the upstream remote. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-10-06Revert "Rollup merge of #129584 - lolbinarycat:old-upstream-warning, ↵onur-ozkan-34/+0
r=albertlarsan68" This reverts commit 776187d2c9a42dc07452ae36a8b765d66bd8e2ca, reversing changes made to 7d015575ada1de8a4627fcdea416194a57a175c2.
2024-10-06Revert "Auto merge of #130121 - ↵onur-ozkan-46/+16
lolbinarycat:bootstrap-warn-old-upstream-worktree, r=albertlarsan68" This reverts commit 507c05bead4026ed8841512095b4218119eb479f, reversing changes made to 0609062a91c8f445c3e9a0de57e402f9b1b8b0a7.
2024-09-29create `CiEnv::is_rust_lang_managed_ci_job`onur-ozkan-0/+9
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-09-13Auto merge of #130121 - lolbinarycat:bootstrap-warn-old-upstream-worktree, ↵bors-16/+46
r=albertlarsan68 bootstrap: handle worktrees in warn_old_master_branch fixes #130111
2024-09-11document the new git logic in more detailonur-ozkan-4/+12
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-09-09implement `build_helper::git::get_closest_merge_commit`onur-ozkan-6/+34
Compare to `get_git_merge_base`, this doesn't require configuring the upstream remote. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-09-09add `git_merge_commit_email` into `GitConfig`onur-ozkan-0/+1
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-09-08bootstrap: handle worktrees in warn_old_master_branchbinarycat-16/+46
fixes #130111
2024-08-27warn the user if the upstream master branch is oldbinarycat-0/+34
fixes https://github.com/rust-lang/rust/issues/129528
2024-07-29Reformat `use` declarations.Nicholas Nethercote-2/+2
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-17abstract merge-base commit logiconur-ozkan-1/+1
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-07-15Move `force_coloring_in_ci` from `builder_helper` to `bootstrap`Jakub Beránek-14/+0
It was only used in bootstrap. This move allows us to modify the function to work with `BootstrapCommand`, rather than `Command`.
2024-07-13Rollup merge of #127434 - onur-ozkan:use-bootstrap-instead-of-rustbuild, ↵Jubilee-1/+1
r=Mark-Simulacrum use "bootstrap" instead of "rustbuild" in comments and docs Let's stick with the single name "bootstrap" to refer to the bootstrap project to avoid confusion. This should make it clearer, especially for new contributors.
2024-07-12Improve error message of drop bombsJakub Beránek-1/+1
2024-07-12Print command creation and execution location when it failsJakub Beránek-0/+4
This should make it quicker to debug command failures.
2024-07-12Store full arm location in `DropBomb`Jakub Beránek-4/+4
Before, only the line was stored. This was enough for run-make tests, since these mostly only contain a single `rmake.rs` file, but not for bootstrap.
2024-07-12Move `DropBomb` from `run-make-support` to `build_helper`Jakub Beránek-0/+66
So that it can be also used in bootstrap.
2024-07-07use "bootstrap" instead of "rustbuild" in comments and docsonur-ozkan-1/+1
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-06-23Rollup merge of #126230 - onur-ozkan:followup-126225, r=Mark-SimulacrumMatthias Krüger-0/+28
tidy: skip submodules if not present for non-CI environments Right now tidy requires rustc-perf to be fetched as it checks its license, but this doesn't make sense for most contributors since rustc-perf is a dist-specific tool and its license will not change frequently, especially during compiler development. This PR makes tidy to skip rustc-perf if it's not fetched and if it's not running in CI. Applies https://github.com/rust-lang/rust/pull/126225#issuecomment-2158143674 and reverts #126225.
2024-06-17tidy: skip submodules if not present for non-CI environmentsonur-ozkan-0/+28
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-06-13build_helper: apply considerable clippy suggestionsonur-ozkan-15/+11
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-06-09feat: vendor crates required by opt-dist to collect profilesWeihang Lo-0/+23
These are the default package set required by opt-dist to correctly work, hence for people wanting to build a production grade of rustc in a sandboxed / air-gapped environment, these need to be vendored. The size of `rustc-src-nightly.tar.xz` before and after this change: * Before: 298M * After: 323M (+8%) These crates are the default set of packages required by opt-dist to correctly work, hence for people wanting to build a production grade of rustc in an sandboxed / air-gapped environment, these need to be vendored. The size of `rustc-src-nightly.tar.xz` before and after this change: * Before: 298M * After: 323M (+8%) Size change might or might not be a concern. See the previous discussion: https://github.com/rust-lang/rust/pull/125166#issuecomment-2113626468 Previous efforts on making: * https://github.com/rust-lang/rust/pull/125125 * https://github.com/rust-lang/rust/pull/125166 --- Note that extra works still need to be done to make it fully vendored. * The current pinned rustc-perf uses `tempfile::Tempdir` as the working directory when collecting profiles from some of these packages. This "tmp" working directory usage make it impossible for Cargo to pick up the correct vendor sources setting in `.cargo/config.toml` bundled in the rustc-src tarball. [^1] * opt-dist verifies the final built rustc against a subset of rustc test suite. However it rolls out its own `config.toml` without setting `vendor = true`, and that results in `./vendor/` directory removed. [^2] [^1]: https://github.com/rust-lang/rustc-perf/blob/4f313add609f43e928e98132358e8426ed3969ae/collector/src/compile/benchmark/mod.rs#L164-L173 [^2]: https://github.com/rust-lang/rust/blob/606afbb617a2949a4e35c4b0258ff94c980b9451/src/tools/opt-dist/src/tests.rs#L62-L77
2024-06-04docs: add README.md for build_helperWeihang Lo-0/+3
2024-05-24Run rustfmt on files that need it.Nicholas Nethercote-1/+1
Somehow these files aren't properly formatted. By default `x fmt` and `x tidy` only check files that have changed against master, so if an ill-formatted file somehow slips in it can stay that way as long as it doesn't get modified(?) I found these when I ran `x fmt` explicitly on every `.rs` file in the repo, while working on https://github.com/rust-lang/compiler-team/issues/750.
2024-05-11use shared stage0 parser from `build_helper`onur-ozkan-0/+77
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-03-05Do not try to format removed filesclubby789-5/+12
2023-11-06rename github_repository to git_repositoryPietro Albini-3/+3
2023-10-24allow configuring the parent GitHub repositoryPietro Albini-11/+30
The git integration in build_helper hardcoded `rust-lang/rust` as the parent GitHub repository, and `master` as the branch name. This works great for `rust-lang/rust`, but causes problems in downstream forks like Ferrocene whenever those functions are invoked (like `./x fmt`). In `src/stage0.json` there was already a configuration key for the name of the nightly branch, but it wasn't used by build_helper. This commit adds the `github_repository` key to the file, and requires both values to be passed to build_helper whenever a git function is called. This will allow downstream forks to tweak the values.
2023-10-02Rollup merge of #114453 - Kobzol:ci-group-stdout, r=onur-ozkanTyler Mandry-3/+3
Print GHA log groups to stdout instead of stderr In all other places (e.g. `bootstrap.py`, `opt-dist`), we use stdout instead of stderr. I think that using stderr might be causing some discrepancies in the log, where sometimes the contents of a group "leak" outside the group. Let's see what happens if we use stdout instead. It's possible that it will be worse, since we print most stuff to stderr (?). r? `@ghost`
2023-08-31bootstrap: use git merge-base for LLVM CI download logicRalf Jung-18/+20
2023-08-04Print GHA log groups to stdout instead of stderrJakub Beránek-3/+3
In all other places (e.g. `bootstrap.py`, `opt-dist`), we use stdout instead of stderr. I think that using stderr might be causing some discrepancies in the log, where sometimes the contents of a group "leak" outside the group. Let's see what happens if we use stdout instead. It's possible that it will be worse, since we print most stuff to stderr (?).
2023-08-01Revert "Rollup merge of #113588 - RalfJung:llvm-merge-base, r=albertlarsan68"Rémy Rakic-20/+18
This reverts commit 849f4f8845ad3104596244874d9e8a087ca2e15b, reversing changes made to 02426434e2ff0194e41dcd8420e9c87346149985.
2023-08-01Rollup merge of #113588 - RalfJung:llvm-merge-base, r=albertlarsan68Matthias Krüger-18/+20
bootstrap: use git merge-base for LLVM CI download logic Fixes https://github.com/rust-lang/rust/issues/101907 I tested this with a local branch that has extra merge commits due to Miri, and it worked fine there. But I am sure there are tons of other situations I did not think of... r? `@jyn514`
2023-07-31apply nitRalf Jung-1/+1
Co-authored-by: Albert Larsan <albertlarsan@unbon.cafe>
2023-07-25Split nested GHA groups instead of panickingJakub Beránek-19/+43
2023-07-17bootstrap: use git merge-base for LLVM CI download logicRalf Jung-18/+20
2023-07-15Rollup merge of #113644 - jyn514:bootstrap-cleanups, r=albertlarsan68Matthias Krüger-2/+4
misc bootstrap cleanups - rename `detail_exit_macro` to `exit` - remove unnecessary `Builder::new_standalone` function - support `x suggest` with build-metrics
2023-07-14Add `track_caller` to builder.msgjyn-0/+1
this makes the panics on nested GHA groups more useful
2023-07-14Add even more GHA log groupsjyn-0/+13
This also adds a dynamic check that we don't emit nested groups, since GHA currently doesn't support them.
2023-07-13Rename `detail_exit_macro` to `exit`jyn-2/+4
`detail` and `macro` weren't adding any info.
2023-07-12Re-format let-else per rustfmt updateMark Rousskov-2/+6
2023-07-09Port PGO/LTO/BOLT optimized build pipeline to RustJakub Beránek-0/+95
2023-06-23Make `try_run` return a `Result<(), ()>` instead of a booleanGuillaume Gomez-8/+12
2023-06-15cleanup more azure leftoversklensy-5/+1
2023-06-04Don't double-print status messages in GHAjyn-0/+2
Before: ``` Building stage0 tool jsondocck (x86_64-unknown-linux-gnu) Building stage0 tool jsondocck (x86_64-unknown-linux-gnu) Downloading crates ... ``` After: ``` Building stage0 tool jsondocck (x86_64-unknown-linux-gnu) Downloading crates ... ```
2023-05-30create `build_helper/src/util` modozkanonur-0/+42
Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-04-22Group entire build steps in the gha logsOli Scherer-0/+24