[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ✘"Can't find packet library")
From: |
Gary E. Miller |
Subject: |
Re: ✘"Can't find packet library") |
Date: |
Mon, 27 Jul 2020 15:33:23 -0700 |
Yo James!
On Mon, 27 Jul 2020 15:18:22 -0700
James Browning <jamesb.fe80@gmail.com> wrote:
> In previous emails, Gary E. Miller <gem@rellim.com> wrote:
> > Also works on macOS:
> >
> > Python 2.7.16 (default, Apr 17 2020, 18:29:03)
> > [GCC 4.2.1 Compatible Apple LLVM 11.0.3 (clang-1103.0.29.20)
> > (-macos10.15-objc- on darwin Type "help", "copyright", "credits" or
> > "license" for more information.
> > >>> import ctypes.util
> > >>> ctypes.util.find_library("gpsdpacket")
> > 'libgpsdpacket.dylib'
>
> That is setup up by packet.py.in lines 48-50 & 61-66 with Cthulu code
> instead of hardcoded magic values.
Yes, and I see no hardcoded magic values in my test (above) either.
> > Is there a good reason for gps/packet.py to work so hard?
>
> Aside from Python not working hard enough?
I can open the proper file in 3 lines, the current code is much larger.
Of course my code will get bigger with GPSD_HOME and looking in the cwd.
> > Seems to me that the program should look for the lib:
>
> > 1) in GPSD_HOME
> > 2) in current directory
> > 3) using ctypes.util.find_library()
>
> Seems to fail when installed in /usr/local (see previous crotch
> punching).
Works for me. Does this not work for you:
macOS:
>>> import ctypes.util
>>> a = ctypes.util.find_library("gpsdpacket")
'libgpsdpacket.dylib'
>>> s = ctypes.CDLL(a)
Linux:
>>> import ctypes
>>> import ctypes.util
>>> a = ctypes.util.find_library("gpsdpacket")
>>> a
'libgpsdpacket.so.27'
>>> s = ctypes.CDLL(a)
> would probably fail if running from ${repo}/tests/daemon
> or other ridiculousness.
Which is what GPSD_HOME is supposed to fix. gps/packet.py lines 43-46
I have not looked at that code yet.
> > And, instead of looking for the exact lib version, just check the
> > major version after loading it.
>
> Currently, checks for the exact version when running from the repo and
> no version checking for distro installs.
But the problem case is a git install.
Given the continuing version problems (3.17) some form of version
checking, somewhere, is required.
> > Does that sound right?
>
> My compass is broken and I do not feel like implementing it like that.
And the code is broken, for the git install case, so it has to get
changed. I'll make the changes, but as I am new to this, I want my
thoughts in the open for comments.
RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
gem@rellim.com Tel:+1 541 382 8588
Veritas liberabit vos. -- Quid est veritas?
"If you can't measure it, you can't improve it." - Lord Kelvin
pgpTU6sHVUBEx.pgp
Description: OpenPGP digital signature
- ✘"Can't find packet library"), Gary E. Miller, 2020/07/26
- Re: ✘"Can't find packet library"), Bernd Zeimetz, 2020/07/28
- Re: ✘"Can't find packet library"), Bernd Zeimetz, 2020/07/28
- Re: ✘"Can't find packet library"), Gary E. Miller, 2020/07/28
- Re: ✘"Can't find packet library"), Gary E. Miller, 2020/07/28
- Re: ✘"Can't find packet library"), Bernd Zeimetz, 2020/07/28
- Re: ✘"Can't find packet library"), Gary E. Miller, 2020/07/28
- Re: ✘"Can't find packet library"), Gary E. Miller, 2020/07/28
- Re: ✘"Can't find packet library"), Fred Wright, 2020/07/29