add check_only feature to disable building the C code #166
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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_onlyfeature 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?