Skip to content

Conversation

@RalfJung
Copy link
Contributor

@RalfJung RalfJung commented Jul 29, 2025

I am looking into ways for how we can speed up check-builds in Miri (see rust-lang/miri#4461). The libffi build script accounts for a significant fraction of the remaining build time here since the C code still gets built, even when that is entirely unnecessary for a check build.

In the rustc workspace, we have a check_only feature on some crates for exactly this purpose. I wonder if you'd be open to the idea of having a similar feature for libffi? Of course I would prefer to actually have native support in cargo for this but that idea has a bunch of unanswered design questions (rust-lang/cargo#4001). So meanwhile, the best we can do is hack it in ourselves. This is done with a cargo feature to have cargo properly cache the build with and without the feature and avoid rebuilds when the flag changes. I'm happy to bikeshed the name, e.g. making it more clear that this is an unstable/unsupported configuration if you prefer that. Could you imagine landing something like this?

@arihant2math arihant2math merged commit 9494718 into libffi-rs:master Aug 1, 2025
45 of 46 checks passed
@arihant2math
Copy link
Collaborator

LGTM, seeing that there is precedence for doing this, I think it's probably a good idea to have this feature for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants