micropython-lib icon indicating copy to clipboard operation
micropython-lib copied to clipboard

Unix port: ffilib.py: libc.so.6 is no longer the latest version

Open hiway opened this issue 1 year ago • 0 comments

While using os.popen() from unix-ffi libraries on FreeBSD 14.1-RELEASE-p5 amd64, I encountered this error:

...
  File "os/__init__.py", line 32, in <module>
  File "ffilib.py", line 43, in libc
  File "ffilib.py", line 39, in open
  File "ffilib.py", line 33, in open
OSError: [Errno 2] ENOENT

On further investigation, I found that libc major version has been upgraded to 7, and ffilib.py is only looking for versions up to 6.

$ ls /lib/libc.so*
/lib/libc.so.7

https://github.com/micropython/micropython-lib/blob/e4cf09527bce7569f5db742cf6ae9db68d50c6a9/unix-ffi/ffilib/ffilib.py#L42

Changing the 6 to 7 fixed the issue.

Only making a note here since the readme for unix-ffi says: "This directory is unmaintained." and I would like to have a reference come up in searches when someone encounters the error.

hiway avatar Jan 11 '25 05:01 hiway