Skip to content

Add a new download-ci-llvm = if-unchanged option and enable it by default for profile = codegen#116881

Merged
bors merged 1 commit into
rust-lang:masterfrom
LuuuXXX:issue-110087
Nov 8, 2023
Merged

Add a new download-ci-llvm = if-unchanged option and enable it by default for profile = codegen#116881
bors merged 1 commit into
rust-lang:masterfrom
LuuuXXX:issue-110087

Conversation

@LuuuXXX

@LuuuXXX LuuuXXX commented Oct 18, 2023

Copy link
Copy Markdown
Contributor

Three tasks have been implemented here.

Add a new download-ci-llvm = if-unchange option and enable if by
default for profile = codegen.

Include all build artifacts by traversing the llvm-project build output,
Keep the downloadable llvm the same state as if you have just run a full
source build.

After selecting the codegen profile during ./x.py setup, the submodule
will be automatically downloaded.

It should be noted that:
if you are using the 'codegen' profile, be aware that the default value changed. otherwise, you can ignore this.

Resolves #110087

@rustbot

rustbot commented Oct 18, 2023

Copy link
Copy Markdown
Collaborator

r? @Mark-Simulacrum

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Oct 18, 2023
@rustbot

rustbot commented Oct 18, 2023

Copy link
Copy Markdown
Collaborator

This PR changes config.example.toml. If appropriate, please also update CONFIG_CHANGE_HISTORY in src/bootstrap/lib.rs and change-id in config.example.toml.

This PR changes src/bootstrap/defaults/config.codegen.toml. If appropriate, please also update config.compiler.toml so the defaults are in sync.

@rust-log-analyzer

This comment has been minimized.

@rustbot

rustbot commented Oct 18, 2023

Copy link
Copy Markdown
Collaborator

This PR changes src/bootstrap/defaults/config.codegen.toml. If appropriate, please also update config.compiler.toml so the defaults are in sync.

This PR changes config.example.toml. If appropriate, please also update CONFIG_CHANGE_HISTORY in src/bootstrap/lib.rs and change-id in config.example.toml.

@rust-log-analyzer

This comment has been minimized.

@LuuuXXX

LuuuXXX commented Oct 19, 2023

Copy link
Copy Markdown
Contributor Author

By the way, triagebot.toml should be updated because the bootstrap codebase is reorganized. The tips above seem out of date.

@onur-ozkan onur-ozkan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current PR ID(which is 116881) should be appended to this constant:

/// Keeps track of major changes made to the bootstrap configuration.
///
/// These values also represent the IDs of the PRs that caused major changes.
/// You can visit `https://github.com/rust-lang/rust/pull/{any-id-from-the-list}` to
/// check for more details regarding each change.
///
/// If you make any major changes (such as adding new values or changing default values), please
/// ensure that the associated PR ID is added to the end of this list.
pub const CONFIG_CHANGE_HISTORY: &[usize] = &[115898];

This should be replaced with the current PR ID:

rust/config.example.toml

Lines 22 to 33 in 020d008

# Keeps track of major changes made to this configuration.
#
# This value also represents ID of the PR that caused major changes. Meaning,
# you can visit github.com/rust-lang/rust/pull/{change-id} to check for more details.
#
# A 'major change' includes any of the following
# - A new option
# - A change in the default values
#
# If `change-id` does not match the version that is currently running,
# `x.py` will prompt you to update it and check the related PR for more details.
change-id = 115898

Comment thread src/bootstrap/src/lib.rs Outdated
@rust-log-analyzer

This comment has been minimized.

@onur-ozkan onur-ozkan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still need some work to confirm the second task, maybe a separate PR is needed.

I think we can handle it in this PR

@onur-ozkan onur-ozkan added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 21, 2023
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 21, 2023
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Oct 21, 2023
Rollup merge of rust-lang#116928 - onur-ozkan:update-triagebot, r=Mark-Simulacrum

fix bootstrap paths in triagebot.toml

ref #rust-lang#116881 (comment)
@rustbot

rustbot commented Oct 23, 2023

Copy link
Copy Markdown
Collaborator

This PR modifies src/bootstrap/src/core/config. If appropriate, please also update CONFIG_CHANGE_HISTORY in src/bootstrap/src/lib.rs and change-id in config.example.toml.

This PR modifies src/bootstrap/defaults. If appropriate, please also update CONFIG_CHANGE_HISTORY in src/bootstrap/src/lib.rs and change-id in config.example.toml.

@rust-log-analyzer

This comment has been minimized.

@bors

bors commented Oct 24, 2023

Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (presumably #116998) made this pull request unmergeable. Please resolve the merge conflicts.

@LuuuXXX LuuuXXX requested a review from onur-ozkan October 24, 2023 08:10
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 24, 2023
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 7, 2023
@onur-ozkan

Copy link
Copy Markdown
Contributor

Can you please rebase and push the commit with a more descriptive message?

Commit history still looks inappropriate.

@LuuuXXX

LuuuXXX commented Nov 7, 2023

Copy link
Copy Markdown
Contributor Author

reworded it

@onur-ozkan onur-ozkan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you squash your commits into "Fix issue #110087" one ? Following commits alone doesn't make too much sense as far as I see. Specially the 2nd one.

Comment thread src/bootstrap/src/core/build_steps/dist.rs Outdated
Three tasks have been implemented here.

Add a new `download-ci-llvm = if-unchange` option and enable if by
default for `profile = codegen`.

Include all build artifacts by traversing the llvm-project build output,
Keep the downloadable llvm the same state as if you have just run a full
source build.

After selecting the codegen profile during ./x.py setup, the submodule
will be automatically downloaded.

@onur-ozkan onur-ozkan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the fixes.

CC #110087
I still need some work to confirm the second task, maybe a separate PR is needed.

PR description seems to be outdated, it would be nice if you update it :) I will queue up the PR anyway.

@onur-ozkan

Copy link
Copy Markdown
Contributor

@bors r+ rollup=iffy

@bors

bors commented Nov 8, 2023

Copy link
Copy Markdown
Collaborator

📌 Commit 1b8dee1 has been approved by onur-ozkan

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 8, 2023
@bors

bors commented Nov 8, 2023

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 1b8dee1 with merge 750c2ec...

@bors

bors commented Nov 8, 2023

Copy link
Copy Markdown
Collaborator

☀️ Test successful - checks-actions
Approved by: onur-ozkan
Pushing 750c2ec to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 8, 2023
@bors bors merged commit 750c2ec into rust-lang:master Nov 8, 2023
@rustbot rustbot added this to the 1.75.0 milestone Nov 8, 2023
@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (750c2ec): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
1.0% [0.5%, 1.5%] 3
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.7% [-0.8%, -0.6%] 4
Improvements ✅
(secondary)
-3.7% [-3.7%, -3.7%] 1
All ❌✅ (primary) 0.0% [-0.8%, 1.5%] 7

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.4% [0.4%, 0.4%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.4% [-0.4%, -0.4%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.0% [-0.4%, 0.4%] 2

Binary size

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.0% [-0.0%, -0.0%] 4
All ❌✅ (primary) - - 0

Bootstrap: 663.473s -> 664.216s (0.11%)
Artifact size: 308.82 MiB -> 308.79 MiB (-0.01%)

Comment thread src/bootstrap/src/lib.rs
/// If you make any major changes (such as adding new values or changing default values), please
/// ensure that the associated PR ID is added to the end of this list.
pub const CONFIG_CHANGE_HISTORY: &[usize] = &[115898, 116998, 117435];
pub const CONFIG_CHANGE_HISTORY: &[usize] = &[115898, 116998, 117435, 116881];

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm getting a WARNING pointing me to this PR. Do I need to do something? Or can I keep my existing config? It's unclear to me. The PR description says there's a new config, but why does everyone have to be alerted of its existence?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also this list is unordered now, that seems wrong?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update change-id = 116881 instead may be help.
AFAIK This is ordered by merge time to keep the source code synchronized with the config file.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update change-id = 116881 instead may be help.

That will silence the warning, sure. But the reason the warning is shown must be that I should do something before silencing it. There's no point in having people mindlessly increment a number every week just to get rid of the latest warning.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also this list is unordered now, that seems wrong?

/// If you make any major changes (such as adding new values or changing default values),
/// please ensure that the associated PR ID is added to the end of this list.
/// This is necessary because the list must be sorted by the merge date.

I'm getting a WARNING pointing me to this PR. Do I need to do something? Or can I keep my existing config? It's unclear to me

# build llvm from source
download-ci-llvm = "if-unchanged"

PR updated the default value here. I am pretty sure we have people who wants to know this change.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then the PR description needs to say: "if you are coming here from x.py, here's what do do: if you are using the 'codegen' profile, be aware that the default value changed. otherwise, you can ignore this".

Currently I'm coming here clueless and wasting 5min trying to figure out if I should do something, before giving up, frustrated.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's my bad, I will add the description for this PR later

@RalfJung

Copy link
Copy Markdown
Member

For this PR I am also confused why we have if-available and if-unchanged as two different options. When would I ever want if-available? Shouldn't if-unchanged just be the default everywhere, since it will "do the right thing" in most situations?

@LuuuXXX

LuuuXXX commented Nov 11, 2023

Copy link
Copy Markdown
Contributor Author

When would I ever want if-available?

If there is no need to modify llvm locally, if-available may be able to give you faster build times. Since you can use Rust CI built LLVM instead of locally building it. and if-unchanged will consider whether there are local modifications in llvm.

Shouldn't if-unchanged just be the default everywhere, since it will "do the right thing" in most situations?

Is it similar to this? https://github.com/orgs/rust-lang/projects/35/views/1?pane=issue&itemId=40227883

@RalfJung

Copy link
Copy Markdown
Member

If there is no need to modify llvm locally, if-available may be able to give you faster build times.

Have you measured it? How long does the change-check take?

We also have true for skipping all the checks, after all.

@LuuuXXX

LuuuXXX commented Nov 11, 2023

Copy link
Copy Markdown
Contributor Author

Not yet, the change-check is based on git diff-index it will not take too much time.

@dtolnay dtolnay removed the has-merge-commits PR has merge commits, merge with caution. label Jan 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a new download-ci-llvm = if-unchanged option and enable it by default for profile = codegen

9 participants