ruabmbua / enet-sys

Raw rust bindings to the enet C library
MIT License
19 stars 14 forks source link

Build script error after updating to Fedora 38 #19

Closed LeonMatthes closed 1 year ago

LeonMatthes commented 1 year ago

I've just updated to Fedora 38, and now the build script for enet-sys panics.

I get a really strange output regarding a __atomic_wide_counter_struct_ ident of some sort. This ident also seems to point to a file name. I've attached the output of the compilation, as well as the header file the ident points to.

Do you have any idea what could be causing this?

build-output.txt atomic_wide_counter.h.txt

spearman commented 1 year ago

I believe it's fixed by this bindgen pull request: https://github.com/rust-lang/rust-bindgen/pull/2319

You can try my master fork commit, there is a small change in lib.rs as it seems latest bindgen outputs usize instead of size_t: https://github.com/spearman/enet-sys/commit/cccd9792090467276139bbde52f5d84892e41e05

LeonMatthes commented 1 year ago

@spearman Thanks a lot, that does indeed fix it. :partying_face:

I'm currently working on my fork of https://github.com/futile/enet-rs/ where enet_sys::size_t is actually used a lot. Could you open a PR for this main repository with your changes, and a type alias to pub type size_t = usize for backwards compatability? Would love for these changes to end up on crates.io, so I can also version-bump enet-rs.

ruabmbua commented 1 year ago

Thanks for the report, seems like other linux distros are also affected. I fixed it in master and published a new version to crates.io

spearman commented 1 year ago

I'm currently working on my fork of https://github.com/futile/enet-rs/ where enet_sys::size_t is actually used a lot. Could you open a PR for this main repository with your changes, and a type alias to pub type size_t = usize for backwards compatability? Would love for these changes to end up on crates.io, so I can also version-bump enet-rs.

I haven't used that crate, I have my own wrapper here https://github.com/spearman/enet-rs I think at the time I started working on it enet had not been published to crates.io. I am coming back to it now and I am not sure if I'm going to switch yet.

LeonMatthes commented 1 year ago

Thanks for the report, seems like other linux distros are also affected. I fixed it in master and published a new version to crates.io

Hi @ruabmbua

Thank you for the very quick response.

Unfortunately, the new version is missing the enet_sys::size_t type. That means that switching from 1.0.1 to 1.0.2 is a breaking change!

You could work around this as mentioned by adding:

/// enet's size_t type, now replaced by simply using usize.
///
/// Provided for backwards-compatibility.
#[deprecated]
pub type size_t = usize;

to src/lib.rs.

Could you redact version 1.0.2 and push version 1.0.3 with the type alias added? That will fix it.