Skip to content

Conversation

@bjorn3
Copy link
Member

@bjorn3 bjorn3 commented Dec 2, 2025

This reduces check times for miri from 2m15s to 20s. And reduces check times for miri with --compile-time-deps from 1m50s to 7s. This makes rust-analyzer start a lot faster after switching branches.

r? @RalfJung

@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 Dec 2, 2025
@Kobzol
Copy link
Member

Kobzol commented Dec 2, 2025

Thanks! The genmc-sys things being built for Miri were super slow. You can r=me once PR CI passes.

@rust-log-analyzer

This comment has been minimized.

@RalfJung
Copy link
Member

RalfJung commented Dec 2, 2025

genmc-sys is off-by-default, this is different.

However, I'm not super happy about this as it means the native-lib code doesn't get checked, and sometimes one has to work on that code. Ideally we'd still check it, we'd just skip building the C dependency. libffi-sys has a feature for that since libffi-rs/libffi-rs#166, could we make use of that? capstone-sys has a similar feature.

@bjorn3
Copy link
Member Author

bjorn3 commented Dec 3, 2025

capstone-sys has a similar feature.

Which one? I only see full and use_bindgen as features, neither of which disables compilation of the C code.

I could disable native-lib just when --compile-time-deps is passed, but that would make rust-analyzer report many functions in the nix crate as non-existent I think.

@RalfJung
Copy link
Member

RalfJung commented Dec 3, 2025

capstone-sys has this. Maybe this is not in a release yet?

@RalfJung
Copy link
Member

RalfJung commented Dec 3, 2025

To be fair, it is fairly rare to work on the native-lib stuff in the Rust repo. So I can live with this as a temporary measure. Comments in the code should make it clear that this is a temporary hack that should be removed once Miri's dependencies can properly suppress building their C dependencies.

However, this does mean ./x check miri and ./x build miri actually compile different code, which is very confusing -- do we do that anywhere else? Is there a good place to document it?

@bjorn3
Copy link
Member Author

bjorn3 commented Dec 3, 2025

do we do that anywhere else?

Not that I am aware of.

This reduces check times for miri from 2m15s to 20s. And reduces check
times for miri with --compile-time-deps from 1m50s to 7s. This makes
rust-analyzer start a lot faster after switching branches.
@bjorn3 bjorn3 force-pushed the faster_compile_time_deps branch from 73b5ff0 to b3bf315 Compare December 3, 2025 14:49
@RalfJung
Copy link
Member

RalfJung commented Dec 3, 2025

Okay, let's do this for now, we can always fine-tune later.

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Dec 3, 2025

📌 Commit b3bf315 has been approved by RalfJung

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 Dec 3, 2025
Zalathar added a commit to Zalathar/rust that referenced this pull request Dec 4, 2025
…=RalfJung

Disable native-lib for x check miri

This reduces check times for miri from 2m15s to 20s. And reduces check times for miri with --compile-time-deps from 1m50s to 7s. This makes rust-analyzer start a lot faster after switching branches.

r? `@RalfJung`
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 4, 2025
…=RalfJung

Disable native-lib for x check miri

This reduces check times for miri from 2m15s to 20s. And reduces check times for miri with --compile-time-deps from 1m50s to 7s. This makes rust-analyzer start a lot faster after switching branches.

r? ``@RalfJung``
bors added a commit that referenced this pull request Dec 4, 2025
Rollup of 12 pull requests

Successful merges:

 - #147841 (Fix ICE when applying test macro to crate root)
 - #149147 (Fix unused_assignments false positives from macros)
 - #149183 (Use `TypingMode::PostAnalysis` in `try_evaluate_const`)
 - #149456 (std: don't call `current_os_id` from signal handler)
 - #149501 (CTFE: avoid emitting a hard error on generic normalization failures)
 - #149528 (reword error for invalid range patterns)
 - #149539 (Additional test for uN::{gather,scatter}_bits)
 - #149549 (Regression test for system register `ttbr0_el2`)
 - #149550 (Disable native-lib for x check miri)
 - #149554 (build-manifest: generate MSI and MINGW arrays from rustc)
 - #149557 (c-variadic: bpf and spirv do not support c-variadic definitions)
 - #149569 (Fix mailmap issue)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 5105c4f into rust-lang:main Dec 4, 2025
11 checks passed
@rustbot rustbot added this to the 1.93.0 milestone Dec 4, 2025
rust-timer added a commit that referenced this pull request Dec 4, 2025
Rollup merge of #149550 - bjorn3:faster_compile_time_deps, r=RalfJung

Disable native-lib for x check miri

This reduces check times for miri from 2m15s to 20s. And reduces check times for miri with --compile-time-deps from 1m50s to 7s. This makes rust-analyzer start a lot faster after switching branches.

r? ```@RalfJung```
@bjorn3 bjorn3 deleted the faster_compile_time_deps branch December 9, 2025 08:34
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

Development

Successfully merging this pull request may close these issues.

6 participants