Closed
Description
Current behavior 😯
$ cargo build --target aarch64-unknown-linux-musl --release --no-default-features --features=max-pure
[...]
error: failed to run custom build command for `libsqlite3-sys v0.30.1`
Expected behavior 🤔
max-pure
feature should be actually pure (ideally, CI should ensure it works without a C compiler available at all)
Git behavior
No response
Steps to reproduce 🕹
No response
Activity
Have pure-rust-build job find what compiles C code
Byron commentedon Nov 17, 2024
Thanks for bringing this to my attention.
It's true that
max-pure
is over-promising at the moment and what really is tested on CI is that a build is possible without additional tooling, likecmake
. Here is the listing of prerequisites that are currently required to make any Rust build:gitoxide/.github/workflows/ci.yml
Lines 33 to 41 in 2fc93f7
Note that
curl
is used to install Rust viarustup.rs
.As of now, it's not possible to make any Rust build without a C compiler as it invokes the linker through it. Thanks to that, C-dependencies can always sneak in and build as long as they don't invoke more than
make
to compile.Even though this particular issue can be solved by turning off
gitoxide-core-tools-query
for themax-pure
build, it seems that what this issue really is about is to be able to build without a functionalgcc
.Maybe the CI run could be tuned to replace
gcc
with a wrapper that only allows linking - then an attempt to build an actual C file would fail naturally, and one would maybe notice even more such invocations.Maybe there is also a way to force Rust to use
ld
directly?NobodyXu commentedon Nov 17, 2024
There's nightly flag for using rustup distributed lld, honestly I wish something like zig-cc is provided via rustup.
Byron commentedon Nov 17, 2024
That should be possible to integrate on CI and would solve the problem. Thanks for suggesting!
pure-rust-build
job find what compiles C code #1682EliahKagan commentedon Nov 17, 2024
I've opened #1682 to make the
pure-rust-build
CI job detect this issue, including but going beyond the dependency onlibsqlite3-sys
that was reported here (since there are some other dependencies that build C code as well).The approach I've proposed there is intended as a way of getting immediate greater insight into how and why
max-pure
has dependencies that build C. I think it might also be useful alongside the approach proposed in #1681 (comment), or that it could potentially be replaced by that approach. Once this issue is fixed (or closer to being fixed), the benefit of allowing the build to succeed to observe all C compilation may no longer be needed.Byron commentedon Nov 17, 2024
Thanks a lot for your help!
I have set this issue to
blocked
once again asring
currently builds some C code as part of its own compilation. It probably does so for very good reason, but while it's doing so a truly pure Rust build can't be accomplished unless one turns off HTTPS transport.I could also imagine an intermediate step which involves setting up a
pure
target, one that tries to achieve a pure Rust build without having to providemax
features.tanriol commentedon Nov 17, 2024
Not that I personally needed it to be absolutely pure Rust - removing
gitoxide-core-tools-query
andgitoxide-core-tools-corpus
frommax-pure
was enough for my case to work, everything else cross-compiled successfully - but that's what the feature naming implied.fix: no `ein t query` in `max-pure` (#1681)
7 remaining items