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

Bump boostrap cc to 1.2.17 and cmake to 0.1.54 #138784

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

madsmtm
Copy link
Contributor

@madsmtm madsmtm commented Mar 21, 2025

The cc version in bootstrap was reverted down to 1.1.22 in #137460 (previously at 1.2.0). The offending issue has since then been resolved in rust-lang/cc-rs#1413, and a new version of cc has been released in rust-lang/cc-rs#1435, so let's try to update the version again.

See the cc-rs changelog and the cmake-rs changelog for details on what has changed here.

r? jieyouxu who tried this last in #137022.
@rustbot label T-bootstrap
try-job: apple

@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc 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) T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Mar 21, 2025
@rust-log-analyzer

This comment has been minimized.

@madsmtm madsmtm closed this Mar 21, 2025
@madsmtm madsmtm reopened this Mar 21, 2025
@rust-log-analyzer

This comment has been minimized.

@madsmtm madsmtm closed this Mar 21, 2025
@madsmtm madsmtm reopened this Mar 21, 2025
@rust-log-analyzer

This comment has been minimized.

@Kobzol
Copy link
Contributor

Kobzol commented Mar 21, 2025

Please add try-job: dist-apple-various to the PR description and run a try build (@bors try). The dist jobs might not run on PR CI.

@madsmtm madsmtm force-pushed the bootstrap-bump-cc-cmake branch from 85502fc to 673b519 Compare March 21, 2025 17:14
@madsmtm
Copy link
Contributor Author

madsmtm commented Mar 21, 2025

Ah, that's why, I really couldn't understand why it didn't work (and failing in sccache looked very much like a spurious network error or something).

Have added to try-job to the description, though pretty sure I don't have permissions to do @bors try. Let's try:
@bors try

@Kobzol
Copy link
Contributor

Kobzol commented Mar 21, 2025

@bors try

bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 21, 2025
…try>

Bump boostrap `cc` to 1.2.17 and `cmake` to 0.1.54

The `cc` version in `bootstrap` was reverted down to 1.1.22 in rust-lang#137460 (previously at 1.2.0). The offending issue has since then been resolved in rust-lang/cc-rs#1413, and a new version of `cc` has been released in rust-lang/cc-rs#1435, so let's try to update the version again.

See [the changelog](https://github.com/rust-lang/cc-rs/blob/d9dd20e376368c7535f6ef89b809098f5f203c1a/CHANGELOG.md) for exact details on what has changed here.

r? jieyouxu who tried this last in rust-lang#137022.
`@rustbot` label T-bootstrap
try-job: dist-apple-various
@bors
Copy link
Contributor

bors commented Mar 21, 2025

⌛ Trying commit 673b519 with merge dbfe100...

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Mar 21, 2025

💔 Test failed - checks-actions

@bors bors 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 Mar 21, 2025
@jieyouxu
Copy link
Member

@bors delegate+ (for try-jobs only, I haven't looked at the cc diff)

@bors
Copy link
Contributor

bors commented Mar 22, 2025

✌️ @madsmtm, you can now approve this pull request!

If @jieyouxu told you to "r=me" after making some further change, please make that change, then do @bors r=@jieyouxu

@madsmtm madsmtm force-pushed the bootstrap-bump-cc-cmake branch from ce6caef to c93efd1 Compare March 22, 2025 04:47
@madsmtm
Copy link
Contributor Author

madsmtm commented Mar 22, 2025

Okay so the failure comes from all the way back in rust-lang/cmake-rs#158, see also rust-lang/cmake-rs#228. I've added a workaround in bootstrap, though ideally this should be fixed in cmake-rs proper (but it requires target parsing to do correctly... So I'm hesitant to attempt it yet).

@bors try

@madsmtm madsmtm force-pushed the bootstrap-bump-cc-cmake branch from c93efd1 to 061eda1 Compare March 22, 2025 04:47
@bors
Copy link
Contributor

bors commented Mar 22, 2025

⌛ Testing commit 061eda1 with merge 77ad7c5...

bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 22, 2025
Bump boostrap `cc` to 1.2.17 and `cmake` to 0.1.54

The `cc` version in `bootstrap` was reverted down to 1.1.22 in rust-lang#137460 (previously at 1.2.0). The offending issue has since then been resolved in rust-lang/cc-rs#1413, and a new version of `cc` has been released in rust-lang/cc-rs#1435, so let's try to update the version again.

See [the changelog](https://github.com/rust-lang/cc-rs/blob/d9dd20e376368c7535f6ef89b809098f5f203c1a/CHANGELOG.md) for exact details on what has changed here.

r? jieyouxu who tried this last in rust-lang#137022.
`@rustbot` label T-bootstrap
try-job: dist-apple-various
@rust-log-analyzer

This comment has been minimized.

@bors bors 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 Mar 24, 2025
madsmtm added 5 commits March 24, 2025 22:40
To avoid a panic in cmake-rs that was introduced in:
rust-lang/cmake-rs#158
compiler-rt's CMake setup seems to have special logic for Apple
platforms that works poorly when this is not set.
Similarly to what was previously done for the `llvm` step.
@madsmtm madsmtm force-pushed the bootstrap-bump-cc-cmake branch from da19f9e to 1f675d3 Compare March 24, 2025 22:06
@madsmtm
Copy link
Contributor Author

madsmtm commented Mar 24, 2025

Gonna try a hunch with CMAKE_OSX_SYSROOT/CMAKE_OSX_DEPLOYMENT_TARGET:

@bors try

@bors
Copy link
Contributor

bors commented Mar 24, 2025

⌛ Trying commit 1f675d3 with merge 5b1530b...

bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 24, 2025
…try>

Bump boostrap `cc` to 1.2.17 and `cmake` to 0.1.54

The `cc` version in `bootstrap` was reverted down to 1.1.22 in rust-lang#137460 (previously at 1.2.0). The offending issue has since then been resolved in rust-lang/cc-rs#1413, and a new version of `cc` has been released in rust-lang/cc-rs#1435, so let's try to update the version again.

See [the `cc-rs` changelog](https://github.com/rust-lang/cc-rs/blob/d9dd20e376368c7535f6ef89b809098f5f203c1a/CHANGELOG.md) and [the `cmake-rs` changelog](https://github.com/rust-lang/cmake-rs/blob/fd56c5a6b4ecda8815c863eb5b12d7b3f0391197/CHANGELOG.md) for details on what has changed here.

r? jieyouxu who tried this last in rust-lang#137022.
`@rustbot` label T-bootstrap
try-job: dist-apple-various
@bors
Copy link
Contributor

bors commented Mar 25, 2025

☀️ Try build successful - checks-actions
Build commit: 5b1530b (5b1530bb0a07ebf6b3dacb54a3c9f8cdb87124a7)

@madsmtm
Copy link
Contributor Author

madsmtm commented Mar 25, 2025

Wow... That actually worked! Seems like we needed to do the same workaround with CMAKE_OSX_SYSROOT/CMAKE_OSX_DEPLOYMENT_TARGET as was done previously for the Llvm build step (last commit).

Trying with try-job: *apple*:

@bors try

And am gonna mark this as ready for review.
@rustbot ready

@bors
Copy link
Contributor

bors commented Mar 25, 2025

⌛ Trying commit 1f675d3 with merge 5b00e15...

bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 25, 2025
…try>

Bump boostrap `cc` to 1.2.17 and `cmake` to 0.1.54

The `cc` version in `bootstrap` was reverted down to 1.1.22 in rust-lang#137460 (previously at 1.2.0). The offending issue has since then been resolved in rust-lang/cc-rs#1413, and a new version of `cc` has been released in rust-lang/cc-rs#1435, so let's try to update the version again.

See [the `cc-rs` changelog](https://github.com/rust-lang/cc-rs/blob/d9dd20e376368c7535f6ef89b809098f5f203c1a/CHANGELOG.md) and [the `cmake-rs` changelog](https://github.com/rust-lang/cmake-rs/blob/fd56c5a6b4ecda8815c863eb5b12d7b3f0391197/CHANGELOG.md) for details on what has changed here.

r? jieyouxu who tried this last in rust-lang#137022.
`@rustbot` label T-bootstrap
try-job: *apple*
@madsmtm madsmtm marked this pull request as ready for review March 25, 2025 00:26
@rustbot
Copy link
Collaborator

rustbot commented Mar 25, 2025

This PR changes how LLVM is built. Consider updating src/bootstrap/download-ci-llvm-stamp.

@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 Mar 25, 2025
@madsmtm
Copy link
Contributor Author

madsmtm commented Mar 25, 2025

Unsure about download-ci-llvm-stamp? Might make sense to update because there are likely a bunch of small object file changes here because of the cc version bump, unsure of the downsides to updating it?

@bors
Copy link
Contributor

bors commented Mar 25, 2025

☀️ Try build successful - checks-actions
Build commit: 5b00e15 (5b00e15065b502fa9b26a2d9fe364139e38dfca2)

@Kobzol
Copy link
Contributor

Kobzol commented Mar 25, 2025

Messing with CMake can likely change how LLVM is built, so I would bump the stamp file.

This PR makes a fairly large version update to CMake and cc, so it is
likely that LLVM is built differently.
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-18 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
#19 exporting to docker image format
#19 sending tarball 20.3s done
#19 DONE 23.1s
##[endgroup]
Setting extra environment values for docker:  --env ENABLE_GCC_CODEGEN=1 --env GCC_EXEC_PREFIX=/usr/lib/gcc/
[CI_JOB_NAME=x86_64-gnu-llvm-18]
[CI_JOB_NAME=x86_64-gnu-llvm-18]
debug: `DISABLE_CI_RUSTC_IF_INCOMPATIBLE` configured.
---
sccache: Listening on address 127.0.0.1:4226
##[group]Configure the build
configure: processing command line
configure: 
configure: build.configure-args := ['--build=x86_64-unknown-linux-gnu', '--llvm-root=/usr/lib/llvm-18', '--enable-llvm-link-shared', '--set', 'rust.randomize-layout=true', '--set', 'rust.thin-lto-import-instr-limit=10', '--set', 'build.print-step-timings', '--enable-verbose-tests', '--set', 'build.metrics', '--enable-verbose-configure', '--enable-sccache', '--disable-manage-submodules', '--enable-locked-deps', '--enable-cargo-native-static', '--set', 'rust.codegen-units-std=1', '--set', 'dist.compression-profile=balanced', '--dist-compression-formats=xz', '--set', 'rust.lld=false', '--disable-dist-src', '--release-channel=nightly', '--enable-debug-assertions', '--enable-overflow-checks', '--enable-llvm-assertions', '--set', 'rust.verify-llvm-ir', '--set', 'rust.codegen-backends=llvm,cranelift,gcc', '--set', 'llvm.static-libstdcpp', '--enable-new-symbol-mangling']
configure: build.build          := x86_64-unknown-linux-gnu
configure: target.x86_64-unknown-linux-gnu.llvm-config := /usr/lib/llvm-18/bin/llvm-config
configure: llvm.link-shared     := True
configure: rust.randomize-layout := True
configure: rust.thin-lto-import-instr-limit := 10
---
  Number of decisions:   4447
  longest path:          1159 (code:    152)
  longest backtrack:       66 (code:    428)
Shared 86733 out of 152951 states by creating 14756 new states, saving 71977
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/expmed.cc: In function ‘rtx_def* extract_bit_field_1(rtx, poly_uint64, poly_uint64, int, rtx, machine_mode, machine_mode, bool, bool, rtx_def**)’:
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/expmed.cc:1864:45: warning: ‘*(unsigned int*)((char*)&imode + offsetof(scalar_int_mode, scalar_int_mode::m_mode))’ may be used uninitialized [-Wmaybe-uninitialized]
 1864 |       rtx sub = extract_bit_field_as_subreg (mode1, op0, imode,
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
 1865 |                                              bitsize, bitnum);
      |                                              ~~~~~~~~~~~~~~~~
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/expmed.cc:1824:19: note: ‘*(unsigned int*)((char*)&imode + offsetof(scalar_int_mode, scalar_int_mode::m_mode))’ was declared here
 1824 |   scalar_int_mode imode;
      |                   ^~~~~
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/gimple-range-gori.cc: In member function ‘void range_def_chain::dump(FILE*, basic_block, const char*)’:
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/gimple-range-gori.cc:319:19: warning: format not a string literal and no format arguments [-Wformat-security]
  319 |           fprintf (f, prefix);
      |           ~~~~~~~~^~~~~~~~~~~
---
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/gcc.cc:7930:9: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
 7930 |   write (fd, "\n\n", 2);
      |   ~~~~~~^~~~~~~~~~~~~~~
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/gcc.cc: In member function ‘void driver::final_actions() const’:
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/gcc.cc:9307:13: warning: ignoring return value of ‘int truncate(const char*, __off_t)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
 9307 |     truncate(totruncate_file, 0);
      |     ~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/lto-wrapper.cc: In function ‘bool find_and_merge_options(int, off_t, const char*, vec<cl_decoded_option>, bool, vec<cl_decoded_option>*, const char*)’:
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/lto-wrapper.cc:1165:8: warning: ignoring return value of ‘ssize_t read(int, void*, size_t)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
 1165 |   read (fd, data, length);
      |   ~~~~~^~~~~~~~~~~~~~~~~~
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/lto/lto-common.cc: In function ‘void lto_resolution_read(splay_tree, FILE*, lto_file*)’:
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/lto/lto-common.cc:2091:10: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
 2091 |   fscanf (resolution, " ");   /* Read white space.  */
      |   ~~~~~~~^~~~~~~~~~~~~~~~~
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/lto/lto-common.cc:2093:9: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
 2093 |   fread (obj_name, sizeof (char), name_len, resolution);
      |   ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/lto/lto-common.cc:2113:10: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
 2113 |   fscanf (resolution, "%u", &num_symbols);
      |   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/jit/jit-recording.cc:32:
---
Applying io_quotes_use            to linux/blkzoned.h
Applying io_quotes_use            to linux/ipmi.h
Applying io_quotes_use            to linux/psp-dbc.h
Applying io_quotes_use            to linux/bt-bmc.h
Applying io_quotes_use            to linux/tps6594_pfsm.h
Applying io_quotes_use            to linux/cxl_mem.h
Applying io_quotes_use            to linux/wmi.h
Applying io_quotes_use            to linux/auto_fs.h
Applying io_quotes_use            to linux/mmtimer.h
Applying io_quotes_use            to linux/f2fs.h
Applying io_quotes_use            to linux/vhost.h
---
Applying machine_name             to x86_64-linux-gnu/bits/unistd_ext.h
Applying io_quotes_use            to x86_64-linux-gnu/asm/mtrr.h
Applying io_quotes_use            to x86_64-linux-gnu/asm/amd_hsmp.h
Applying machine_name             to openssl/e_os2.h
Applying io_quotes_use            to drm/xe_drm.h
Applying io_quotes_use            to drm/radeon_drm.h
Applying io_quotes_use            to drm/panfrost_drm.h
Applying io_quotes_use            to drm/etnaviv_drm.h
Applying io_quotes_use            to drm/lima_drm.h
Applying io_quotes_use            to drm/qaic_accel.h
Applying io_quotes_use            to drm/vc4_drm.h
Applying io_quotes_use            to drm/i915_drm.h
Applying io_quotes_use            to drm/omap_drm.h
Applying io_quotes_use            to drm/pvr_drm.h
Applying io_quotes_use            to drm/amdgpu_drm.h
Applying io_quotes_use            to drm/vgem_drm.h
Applying io_quotes_use            to drm/msm_drm.h
Applying io_quotes_use            to drm/v3d_drm.h
Applying io_quotes_use            to drm/exynos_drm.h
Applying io_quotes_use            to drm/nouveau_drm.h
Applying io_quotes_use            to drm/drm.h
Applying io_quotes_use            to drm/habanalabs_accel.h
Applying io_quotes_use            to drm/tegra_drm.h
Applying io_quotes_use            to rdma/rdma_user_ioctl.h
cc1: note: self-tests are not enabled in this build
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/c++tools/server.cc: In function ‘void server(bool, int, module_resolver*)’:
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/c++tools/server.cc:620:10: warning: ignoring return value of ‘int pipe(int*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
---
[RUSTC-TIMING] proc_macro test:false 5.221
[RUSTC-TIMING] test test:false 9.274
    Finished `release` profile [optimized] target(s) in 1m 20s
##[endgroup]
[TIMING] core::build_steps::compile::Std { target: x86_64-unknown-linux-gnu, compiler: Compiler { stage: 1, host: x86_64-unknown-linux-gnu, forced_compiler: true }, crates: [], force_recompile: false, extra_rust_args: ["-Csymbol-mangling-version=v0", "-Cpanic=abort"], is_for_mir_opt_tests: false } -- 80.972
Testing GCC stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
 Downloading crates ...
  Downloaded boml v0.3.1
   Compiling boml v0.3.1
[RUSTC-TIMING] boml test:false 0.836
   Compiling y v0.1.0 (/checkout/compiler/rustc_codegen_gcc/build_system)
[RUSTC-TIMING] y test:false 3.072
    Finished `release` profile [optimized] target(s) in 4.19s
     Running `/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-codegen/x86_64-unknown-linux-gnu/release/y test --use-backend gcc --gcc-path /checkout/obj/build/x86_64-unknown-linux-gnu/gcc/install/lib --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/cg_gcc --release --mini-tests --std-tests`
`--gcc-path` was provided, ignoring config file. Using `/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/install/lib` as path for libgccjit
[BUILD] mini_core
[RUSTC-TIMING] mini_core test:false 0.197
[BUILD] example
[AOT] mini_core_hello_world
[RUSTC-TIMING] mini_core_hello_world test:false 0.184

@madsmtm
Copy link
Contributor Author

madsmtm commented Mar 25, 2025

Hmm, seems like it failed while testing bootstrap itself after I changed download-ci-llvm-stamp? I don't know why that's the case?

Failure:

thread 'core::config::tests::download_ci_llvm' panicked at src/bootstrap/src/core/config/tests.rs:30:9:
assertion failed: config.llvm_from_ci

@jieyouxu
Copy link
Member

This one I'm not sure about... @Kobzol this can't be from #138704 can it?

@Kobzol
Copy link
Contributor

Kobzol commented Mar 25, 2025

Hmm. Looking at the test, I think that it doesn't really make sense anymore after #138704.

@klensy
Copy link
Contributor

klensy commented Mar 25, 2025

Submitted a PR to cmake-rs for the reliance on CARGO_CFG_*, see rust-lang/cmake-rs#242.

Should wait few days for pr, maybe it will be merged?

@madsmtm
Copy link
Contributor Author

madsmtm commented Mar 25, 2025

Submitted a PR to cmake-rs for the reliance on CARGO_CFG_*, see rust-lang/cmake-rs#242.

Should wait few days for pr, maybe it will be merged?

I'd rather file a follow-up later, it can take time for a new cmake-rs release.

Hmm. Looking at the test, I think that it doesn't really make sense anymore after #138704.

Do you think I should remove it, then?

@Kobzol
Copy link
Contributor

Kobzol commented Mar 25, 2025

Do you think I should remove it, then?

I will do it in a separate PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc 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) T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants