Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revisit fix_is_ci_llvm_available logic #107234

Merged

Conversation

Rattenkrieg
Copy link
Contributor

Fixes #107225
Now supported_platforms has a knowledge whether llvm asserts artifacts are available for particular host triple.

@jyn514 @albertlarsan68 PTAL

@rustbot
Copy link
Collaborator

rustbot commented Jan 23, 2023

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @ozkanonur (or someone else) soon.

Please see the contribution instructions for more information.

@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 Jan 23, 2023
("i686-pc-windows-gnu", false),
("i686-pc-windows-msvc", false),
("i686-unknown-linux-gnu", false),
("x86_64-unknown-linux-gnu", true),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

First five are false according to now removed

if (triple == "aarch64-unknown-linux-gnu" || triple.contains("i686")) && asserts {
    return false
}

("x86_64-unknown-freebsd", false),
("x86_64-unknown-illumos", false),
("x86_64-unknown-linux-musl", false),
("x86_64-unknown-netbsd", false),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

No "llvm with asserts" artifacts are published for tier 2 with host tools.

@jyn514
Copy link
Member

jyn514 commented Jan 23, 2023

r? @albertlarsan68 - feel free to ask if you want advice on the review :)

@rustbot rustbot assigned albertlarsan68 and unassigned onur-ozkan Jan 23, 2023
@rust-log-analyzer

This comment has been minimized.

Copy link
Member

@albertlarsan68 albertlarsan68 left a comment

Choose a reason for hiding this comment

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

Just a nit, r=me when done and CI passes

@@ -19,6 +19,8 @@ fn download_ci_llvm() {
assert_eq!(parse_llvm(""), if_available);
assert_eq!(parse_llvm("rust.channel = \"dev\""), if_available);
assert!(!parse_llvm("rust.channel = \"stable\""));
assert!(parse_llvm("llvm.assertions = true \r\n build.build = \"x86_64-unknown-linux-gnu\" \r\n llvm.download-ci-llvm = \"if-available\""));
assert_eq!(parse_llvm("llvm.assertions = true \r\n build.build = \"aarch64-apple-darwin\" \r\n llvm.download-ci-llvm = \"if-available\""), false);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
assert_eq!(parse_llvm("llvm.assertions = true \r\n build.build = \"aarch64-apple-darwin\" \r\n llvm.download-ci-llvm = \"if-available\""), false);
assert!(!parse_llvm("llvm.assertions = true \r\n build.build = \"aarch64-apple-darwin\" \r\n llvm.download-ci-llvm = \"if-available\""));

Asserting for false should be done in this way rather than asserting equality with false.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it! I'll get back to these tests later today, since there are formatting issues and adding build.build didn't help.

@albertlarsan68 albertlarsan68 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 Jan 24, 2023
@@ -965,6 +965,9 @@ impl Config {
config.changelog_seen = toml.changelog_seen;

let build = toml.build.unwrap_or_default();
if let Some(file_build) = build.build {
config.build = TargetSelection::from_user(&file_build);
};
Copy link
Contributor Author

Choose a reason for hiding this comment

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

NB build triple wasn't read from result of get_toml. I don't know whether it was skipped deliberately or just simply forgotten. I'm leaning towards the latter, since build.host and build.target are read below from the same toml.

Copy link
Member

@jyn514 jyn514 Jan 24, 2023

Choose a reason for hiding this comment

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

probably accidental; https://github.com/rust-lang/rust/blob/8adbe6e436d7ae03dbb0e82729745e1e514eb508/src/bootstrap/config.rs#L815 gets it right because python sets it for https://github.com/rust-lang/rust/blob/8adbe6e436d7ae03dbb0e82729745e1e514eb508/src/bootstrap/build.rs#L4-L6 in https://github.com/rust-lang/rust/blob/8adbe6e436d7ae03dbb0e82729745e1e514eb508/src/bootstrap/bootstrap.py#L788-L797, so likely no one ever noticed.

I think it shouldn't ever matter in practice; even when we stop using python (#94829) the shell scripts should still respect build.build in config.toml, but changing it to make things testable seems good 👍

@Rattenkrieg
Copy link
Contributor Author

@albertlarsan68 is there anything else left for me to address?

@jyn514
Copy link
Member

jyn514 commented Jan 27, 2023

@Rattenkrieg Albert is on vacation until next week

@jyn514 jyn514 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 Jan 27, 2023
@Rattenkrieg
Copy link
Contributor Author

@Rattenkrieg Albert is on vacation until next week

Got it, sorry, no rush then.

@albertlarsan68
Copy link
Member

I think this is good. Can you squash the commits please?

Tip: post a comment containing @rustbot ready when you want another review, it puts the PR back into the to-do list of the reviewer.

@Rattenkrieg Rattenkrieg force-pushed the bootstrap-fix-is_ci_llvm_available branch from 8adbe6e to 9ef8407 Compare January 27, 2023 07:19
@Rattenkrieg
Copy link
Contributor Author

@rustbot ready

@albertlarsan68
Copy link
Member

Thanks!
@bors r+ rollup

@bors
Copy link
Contributor

bors commented Jan 27, 2023

📌 Commit 9ef8407 has been approved by albertlarsan68

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 Jan 27, 2023
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Jan 27, 2023
…vm_available, r=albertlarsan68

Revisit fix_is_ci_llvm_available logic

Fixes rust-lang#107225
Now `supported_platforms` has a knowledge whether llvm asserts artifacts are available for particular host triple.

`@jyn514` `@albertlarsan68` PTAL
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 27, 2023
Rollup of 9 pull requests

Successful merges:

 - rust-lang#106806 (Replace format flags u32 by enums and bools.)
 - rust-lang#107194 (Remove dependency on slice_internals feature in rustc_ast)
 - rust-lang#107234 (Revisit fix_is_ci_llvm_available logic)
 - rust-lang#107316 (Update snap from `1.0.1` to `1.1.0`)
 - rust-lang#107321 (solver comments + remove `TyCtxt::evaluate_goal`)
 - rust-lang#107332 (Fix wording from `rustbuild` to `bootstrap`)
 - rust-lang#107347 (reduce rightward-drift)
 - rust-lang#107352 (compiler: Fix E0587 explanation)
 - rust-lang#107357 (Fix infinite loop in rustdoc get_all_import_attributes function)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 04dfde4 into rust-lang:master Jan 27, 2023
@rustbot rustbot added this to the 1.69.0 milestone Jan 27, 2023
flip1995 pushed a commit to flip1995/rust that referenced this pull request Feb 10, 2023
Rollup of 9 pull requests

Successful merges:

 - rust-lang#106806 (Replace format flags u32 by enums and bools.)
 - rust-lang#107194 (Remove dependency on slice_internals feature in rustc_ast)
 - rust-lang#107234 (Revisit fix_is_ci_llvm_available logic)
 - rust-lang#107316 (Update snap from `1.0.1` to `1.1.0`)
 - rust-lang#107321 (solver comments + remove `TyCtxt::evaluate_goal`)
 - rust-lang#107332 (Fix wording from `rustbuild` to `bootstrap`)
 - rust-lang#107347 (reduce rightward-drift)
 - rust-lang#107352 (compiler: Fix E0587 explanation)
 - rust-lang#107357 (Fix infinite loop in rustdoc get_all_import_attributes function)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@jyn514 jyn514 mentioned this pull request Feb 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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
7 participants