rust-lang / cc-rs

Rust library for build scripts to compile C/C++ code into a Rust library
https://docs.rs/cc
Apache License 2.0
1.77k stars 427 forks source link

Version 1.0.95 breaks cross compilation #1039

Closed ofek closed 2 months ago

ofek commented 2 months ago

The issue appears to be this commit: https://github.com/rust-lang/cc-rs/commit/9af6b9591b8766752d1c0d6fe347fe32a3b9e5d1

I discovered this when trying to build this repo: https://github.com/ofek/pyapp

Passed 6 hours ago: https://github.com/pypa/hatch/actions/runs/8760646787/job/24045960846#step:12:121

Now consistently failing: https://github.com/pypa/hatch/actions/runs/8762826835/job/24051033022?pr=1407#step:12:124

NobodyXu commented 2 months ago

Hmmm I think it's one of the old glibc, which doesn't have the preadv2 symbol.

I would open a PR in upstream jobserver-rs for this.

groovybits commented 2 months ago

See my issue https://github.com/rust-lang/cc-rs/issues/1040 it breaks cargo-c too, same issue it seems.

NobodyXu commented 2 months ago

Opened an issue in jobserver, it will be fixed in upstream rust-lang/jobserver-rs#87

ofek commented 2 months ago

Can you explain the issue a bit more please because I don't quite understand why the issue is in the other library when it was the new release of this package that started causing issues.

NobodyXu commented 2 months ago

The preadv2 syscall is used by jobserver-rs as an optimization, cc-rs does not call preadv2 directly.

Sorry if I was being rude, I wrote that jobserver optimization myself so my first reaction is this is from jobserver, which is probably confusing for you.

ofek commented 2 months ago

Oh that makes much more sense now, thank you! I will close this.

NobodyXu commented 2 months ago

Thank you very much for reporting, it seems upstream already merged the PR fixing this (by removing use of preadv2 for now) and would cut a new release soon.