-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Update cc crate for bootstrap to v1.0.97 #122504
Conversation
rustbot has assigned @albertlarsan68. Use r? to explicitly pick a reviewer |
As noted in the change description, I'm hoping to get all cc crate dependencies for rustc updated to at least 1.0.80, which has a fix we need for building the Rust toolchain for the Android platform. I saw the comment in Cargo.toml, and I understand there is a good reason for pinning the version. I am happy to work on any fixes to the bootstrap code that are necessary to land this change. I set the version to 1.0.90, which is the most recent, but I'd be happy with anything >=1.0.80, if that would be preferable. |
This comment has been minimized.
This comment has been minimized.
Bootstrap has its own lockfile, I see. I didn't notice that before. It will need the .lock updated too. |
Here are all 3 PRs I've sent: |
@jfgoog It should just be a matter of using |
7094ed0
to
6979b48
Compare
This comment has been minimized.
This comment has been minimized.
6979b48
to
51e31ff
Compare
Done. |
Cool. @albertlarsan68 I will leave this to you but I have to wonder if there is any chance of bootstrap using the workspace cc version? Perhaps we should pursue that conversation separately. |
This comment has been minimized.
This comment has been minimized.
??? @NobodyXu This is a peculiar error message, "Compiler version doesn't include clang or GCC"? |
I have a suspicion that things like this are the reason that the version is pinned. |
Apparently! |
More conservative version, updating to 1.0.80 instead of all the way to 1.0.90: #122507 Let's see if that fares better in presubmit checks. |
The The actual error is |
This pr accidentally bumped not only |
Ahhh. |
@jfgoog Can you back out the other |
51e31ff
to
0ded290
Compare
Done |
☔ The latest upstream changes (presumably #124726) made this pull request unmergeable. Please resolve the merge conflicts. |
rust-lang/cc-rs#1047 is merged |
0b5e082
to
d767c96
Compare
Updated to the latest cc v1.0.97 to pick up the fix to SDKROOT. |
This comment has been minimized.
This comment has been minimized.
Reason: In order to build the Windows version of the Rust toolchain for the Android platform, the following patch to the cc is crate is required to avoid incorrectly determining that we are building with the Android NDK: rust-lang/cc-rs@57853c4 This patch is present in version 1.0.80 and newer versions of the cc crate. The rustc source distribution currently has 3 different versions of cc in the vendor directory, only one of which has the necessary fix. We (the Android Rust toolchain) are currently maintaining local patches to upgrade the cc crate dependency versions, which we would like to upstream. Furthermore, beyond the specific reason, the cc crate in bootstrap is currently pinned at an old version due to problems in the past when trying to update it. It is worthwhile to figure out and resolve these problems so we can keep the dependency up-to-date. Other fixes: As of cc v1.0.78, object files are prefixed with a 16-character hash. Update src/bootstrap/src/core/build_steps/llvm.rs to account for this to avoid failures when building libunwind and libcrt. Note that while the hash prefix was introduced in v1.0.78, in order to determine the names of the object files without scanning the directory, we rely on the compile_intermediates method, which was introduced in cc v1.0.86 As of cc v1.0.86, compilation on MacOS uses the -mmacosx-version-min flag. A long-standing bug in the CMake rules for compiler-rt causes compilation to fail when this flag is specified. So we add a workaround to suppress this flag. Updating to cc v1.0.91 and newer requires fixes to bootstrap unit tests. The unit tests use targets named "A", "B", etc., which fail a validation check introduced in 1.0.91 of the cc crate.
d767c96
to
615b485
Compare
Thanks a lot for working on this! @bors r+ rollup=never |
☀️ Test successful - checks-actions |
Finished benchmarking commit (e2865db): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)This benchmark run did not return any relevant results for this metric. CyclesResultsThis 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.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 676.36s -> 675.387s (-0.14%) |
Holy crap...it merged! |
- Add back previously removed pin-cc-to-1-0-77.patch(and fix rotten). - Remove this patch once rust-lang/rust#122504 land in 1.80 - This package should be built from main branch and after wasi-libc 1:0+374+9e8c5423-2 is built.
- Add back previously removed pin-cc-to-1-0-77.patch(and fix rotten). - Remove this patch once rust-lang/rust#122504 land in 1.80 - This package should be built from main branch and after wasi-libc 1:0+374+9e8c5423-2 is built.
Remove pin-cc-to-1-0-77.patch because rust-lang/rust#122504 landed in 1.80
Remove pin-cc-to-1-0-77.patch because rust-lang/rust#122504 landed in 1.80
Reason:
In order to build the Windows version of the Rust toolchain for the Android platform, the following patch to the cc is crate is required to avoid incorrectly determining that we are building with the Android NDK: rust-lang/cc-rs@57853c4
This patch is present in version 1.0.80 and newer versions of the cc crate. The rustc source distribution currently has 3 different versions of cc in the vendor directory, only one of which has the necessary fix.
We (the Android Rust toolchain) are currently maintaining local patches to upgrade the cc crate dependency versions, which we would like to upstream.
Furthermore, beyond the specific reason, the cc crate in bootstrap is currently pinned at an old version due to problems in the past when trying to update it. It is worthwhile to figure out and resolve these problems so we can keep the dependency up-to-date.
Other fixes:
As of cc v1.0.78, object files are prefixed with a 16-character hash.
Update src/bootstrap/src/core/build_steps/llvm.rs to account for this to
avoid failures when building libunwind and libcrt. Note that while the hash
prefix was introduced in v1.0.78, in order to determine the names of the
object files without scanning the directory, we rely on the compile_intermediates
method, which was introduced in cc v1.0.86
As of cc v1.0.86, compilation on MacOS uses the -mmacosx-version-min flag.
A long-standing bug in the CMake rules for compiler-rt causes compilation
to fail when this flag is specified. So we add a workaround to suppress this
flag.
Updating to cc v1.0.91 and newer requires fixes to bootstrap unit tests.
The unit tests use targets named "A", "B", etc., which fail a validation
check introduced in 1.0.91 of the cc crate.
As of cc v1.0.74, the SDKROOT environment variable is used on Darwin if present,
regardless of whether it is for the correct platform or not. This is fixed in cc v1.0.97.