-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Add a tidy check for GCC submodule version #137683
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
Conversation
This is great, thanks a lot! r=me once CI is happy. |
This races with #137660 though, so maybe I'll wait until that one is merged and the next cg_gcc sync happens (because that PR desyncs the versions). |
Yeah, let's maybe wait for the other PR to be merged so then we can land this one and eventually update the SHA as needed. |
7823503
to
c62a5da
Compare
This comment has been minimized.
This comment has been minimized.
Yeah, the lint seems to be working. Now we need to wait for a GCC submodule (or cg_gcc) update. |
Thanks. |
Ok, let me know once that happens :) This lint is only useful during synces anyway, so it shouldn't be needed before the next one :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tACK. Some nits.
let cg_gcc_version = std::fs::read_to_string(&cg_gcc_version_path) | ||
.expect(&format!("Cannot read GCC version from {}", cg_gcc_version_path.display())) | ||
.trim() | ||
.to_string(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let cg_gcc_version = std::fs::read_to_string(&cg_gcc_version_path) | |
.expect(&format!("Cannot read GCC version from {}", cg_gcc_version_path.display())) | |
.trim() | |
.to_string(); | |
let cg_gcc_version = std::fs::read_to_string(&cg_gcc_version_path) | |
.expect(&format!("Cannot read GCC version from {}", cg_gcc_version_path.display())); | |
let cg_gcc_version = cg_gcc_version.trim(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The to_string
allocation doesn't matter here, so I would rather just keep the original.
let git_output = String::from_utf8_lossy(&git_output.stdout) | ||
.trim() | ||
.split_whitespace() | ||
.next() | ||
.unwrap_or_default() | ||
.to_string(); | ||
|
||
// The SHA can start with + if the submodule is modified or - if it is not checked out. | ||
let gcc_submodule_sha = git_output.trim_start_matches(&['+', '-']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let git_output = String::from_utf8_lossy(&git_output.stdout) | |
.trim() | |
.split_whitespace() | |
.next() | |
.unwrap_or_default() | |
.to_string(); | |
// The SHA can start with + if the submodule is modified or - if it is not checked out. | |
let gcc_submodule_sha = git_output.trim_start_matches(&['+', '-']); | |
let git_output = String::from_utf8_lossy(&git_output.stdout); | |
let gcc_submodule_sha = git_output | |
.trim() | |
.split_whitespace() | |
.next() | |
.and_then(|sha| sha.strip_prefix(['+','-'])) | |
.unwrap_or_default(); |
A sync was done in this PR. |
To keep it in sync with rustc_codegen_gcc.
c62a5da
to
796a9ee
Compare
|
I updated the GCC submodule, because it wasn't updated in the sync PR (luckily we will now have this tidy check to detect that 😆). Once CI is green, I'll approve on @GuillaumeGomez's behalf. |
@bors r=GuillaumeGomez |
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#137683 (Add a tidy check for GCC submodule version) - rust-lang#138968 (Update the index of Result to make the summary more comprehensive) - rust-lang#139572 (docs(std): mention const blocks in const keyword doc page) - rust-lang#140152 (Unify the format of rustc cli flags) - rust-lang#140193 (fix ICE in `#[naked]` attribute validation) - rust-lang#140205 (Tidying up UI tests [2/N]) - rust-lang#140284 (remove expect() in `unnecessary_transmutes`) - rust-lang#140290 (rustdoc: fix typo change from equivelent to equivalent) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#137683 - Kobzol:tidy-gcc-submodule, r=GuillaumeGomez Add a tidy check for GCC submodule version To make sure that it stays in sync with the required GCC version of the GCC codegen backend. The check should succeed on CI, although it will fail after rust-lang#137660, until the next GCC sync. r? `@GuillaumeGomez`
To make sure that it stays in sync with the required GCC version of the GCC codegen backend.
The check should succeed on CI, although it will fail after #137660, until the next GCC sync.
r? @GuillaumeGomez