Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wireless module doesn't compile on recent Arch #65

Open
cbiffle opened this issue Mar 30, 2024 · 1 comment
Open

Wireless module doesn't compile on recent Arch #65

cbiffle opened this issue Mar 30, 2024 · 1 comment

Comments

@cbiffle
Copy link

cbiffle commented Mar 30, 2024

Hi! Hoping to try this project out. It might be unmaintained, in which case please ignore me.

I'm unable to compile cnx on recent Arch because of (fundamentally) bugs in the older bindgen when processing headers from glibc 2.39. This will affect the other distros eventually.

The compilation failure is in iwlib-sys:

error: failed to run custom build command for `iwlib_sys v0.1.0`

Caused by:
  process didn't exit successfully: `/home/cbiffle/src/cnx/target/debug/build/iwlib_sys-fae758f3245ddce5/build-script-build` (exit status: 101)
  --- stdout
  cargo:rustc-link-lib=iw
  cargo:rerun-if-changed=wrapper.h

  --- stderr
  thread 'main' panicked at /home/cbiffle/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bindgen-0.53.3/src/ir/context.rs:894:9:
  "__atomic_wide_counter_struct_(unnamed_at_/usr/include/bits/atomic_wide_counter_h_28_3)" is not a valid Ident

This appears to be due to bindgen 0.53 parsing header files wrong. (I agree with the error message -- that last line is certainly not a valid ident!) Something glibc has started doing between whatever version you're testing on, and version 2.39, has confused it.

It appears that iwlib-sys in git has been updated to use bindgen 0.65, which fixes the problem. However, it also doesn't seem to have made a release in about a year. I see that this project and iwlib-sys have some committers in common, so you might be able to fix this by either making an iwlib-sys release and bumping your dependency, or depending on its git repo directly.

However, doing either is going to require either removing the dependency on the (apparently unmaintained) sioctl package, or updating it, too, to use a more modern bindgen. Otherwise, they conflict and Cargo can't resolve the dependency graph.

By editing cnx's Cargo.toml to depend on iwlib from git, and removing the use of sioctl, I was able to get it to build.

@psibi
Copy link
Collaborator

psibi commented Apr 1, 2024

I would be happy to accept a PR for the same.

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

No branches or pull requests

2 participants