Menu

#221 Ubuntu Core Snap failing to build RPI GPIO

New
nobody
None
Critical
Patch
2025-02-27
2025-02-27
Will Spies
No

I am building Python 3.11 into an Ubuntu Core Snap(craft.yaml). This for use within Greengrass (also part of same Snap). Running on a Raspberry CM4. During pip install of RPi.GPIO==0.7.1 I get a failure from gcc linker:

2025-02-27T16:24:49.551Z [WARN] (Copier) com.thio.coredevice.thio_bp_lab: stderr. gcc -pthread -shared -L/root/parts/python/install/usr/lib -L/root/parts/python/install/usr/lib/aarch64-linux-gnu -L/root/parts/python/install/usr/lib -L/root/parts/python/install/usr/lib/aarch64-linux-gnu -DCONFIG64 -L/snap/aws-iot-greengrass-v2/x1 build/temp.linux-aarch64-cpython-311/source/cgpio.o build/temp.linux-aarch64-cpython-311/source/common.o build/temp.linux-aarch64-cpython-311/source/constants.o build/temp.linux-aarch64-cpython-311/source/cpuinfo.o build/temp.linux-aarch64-cpython-311/source/eventgpio.o build/temp.linux-aarch64-cpython-311/source/pygpio.o build/temp.linux-aarch64-cpython-311/source/pypwm.o build/temp.linux-aarch64-cpython-311/source/softpwm.o -o build/lib.linux-aarch64-cpython-311/RPi/GPIO.cpython-311-aarch64-linux-gnu.so. {scriptName=services.com.thio.coredevice.thiobplab.lifecycle.run.Script, serviceName=com.thio.coredevice.thiobplab, currentState=RUNNING}

###### 2025-02-27T16:24:49.551Z [WARN] (Copier) com.thio.coredevice.thiobplab: stderr. /snap/aws-iot-greengrass-v2/x1/usr/bin/ld: cannot find /usr/lib/aarch64-linux-gnu/libcnonshared.a. {scriptName=services.com.thio.coredevice.thiobplab.lifecycle.run.Script, serviceName=com.thio.coredevice.thiobplab, currentState=RUNNING}

2025-02-27T16:24:49.551Z [WARN] (Copier) com.thio.coredevice.thiobplab: stderr. collect2: error: ld returned 1 exit status. {scriptName=services.com.thio.coredevice.thiobplab.lifecycle.run.Script, serviceName=com.thio.coredevice.thiobplab, currentState=RUNNING}
2025-02-27T16:24:49.551Z [WARN] (Copier) com.thio.coredevice.thiobplab: stderr. error: command '/snap/aws-iot-greengrass-v2/x1/usr/bin/gcc' failed with exit code 1. {scriptName=services.com.thio.coredevice.thio*

The main error appears to be the linker cannot find the libc_nonshared.a. I have found this library under /snap/aws-iot-greengrass-v2/x1/usr/lib in the snap -- however even though I added this under the -L option (using CFLAGS) I still get an error from ld cannot find /usr/lib/libc_nonshared.a

Help?

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.