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

building new wheels with SPIDEV (using GPIO char-dev API) #48

Closed
2bndy5 opened this issue Mar 22, 2024 · 0 comments · Fixed by #49
Closed

building new wheels with SPIDEV (using GPIO char-dev API) #48

2bndy5 opened this issue Mar 22, 2024 · 0 comments · Fixed by #49
Labels
dependencies Pull requests that update a dependency file

Comments

@2bndy5
Copy link
Member

2bndy5 commented Mar 22, 2024

With the updates to the RF24 lib's SPIDEV driver, The list of dependencies has expanded to the linux kernel's gpio.h header. However, this header is not available in the CI when building a binary distributable "wheel" (the file that is uploaded to pypi and downloaded by pip).

Technical Detail

Technically, the gpio.h file isn't available in the docker images that cibuildwheel uses to create our binary distributions. The gpio.h is available in the ubuntu-latest runners, though the header file is not exposed to the docker container being run by cibuildwheel.

I considered using a customized docker image, but the manylinux-* tags that pip uses (to recognize compatible binary distributions hosted at pypi) implies a certain level of conformance with libc version... I'd rather not maintain a specialized docker image because of 1 missing file.

If you're thinking: "What about linux/spi/spi-dev.h?" No worries there. The SPI & I2C header files are present in the docker images, presumably because those data busses are used by a plethora of PC hardware peripherals.


As a workaround, we can include a copy of the gpio.h from the linux kernel into this repo. I think the GPL allows this since we are providing the source code with distributions (as source distribution wheels to pypi). In fact the libgpiod repo does this as well (see their copy of gpio.h), but they don't provide binary distributions to pypi (piwheels picks up the slack for them on RPi OS 32-bit).

The only complexity in this workaround is that RF24/utility/SPIDEV/gpio.* files need to use quotes in the #include statements:

-#include <linux/gpio.h>
+#include "linux/gpio.h"

And Similarly for the RPI and SPIDEV drivers' interrupt implementations.

I can adjust the build system in this repo to add our copy of the gpio.h header file.

@2bndy5 2bndy5 added the dependencies Pull requests that update a dependency file label Mar 22, 2024
2bndy5 added a commit to nRF24/RF24 that referenced this issue Mar 22, 2024
2bndy5 added a commit to nRF24/RF24 that referenced this issue Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant