gpsd-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gpsd-users] 'scons check' installs files, fails on pyserial


From: Charles Curley
Subject: Re: [gpsd-users] 'scons check' installs files, fails on pyserial
Date: Fri, 5 Oct 2018 12:51:57 -0600

On Thu, 4 Oct 2018 16:14:46 -0700
"Gary E. Miller" <address@hidden> wrote:

> Yo Charles!
> 
> On Thu, 4 Oct 2018 15:20:11 -0600
> Charles Curley <address@hidden> wrote:
> 
> > I checked out release-3.18, and ran scons && scons check, first as a
> > non-root user. That failed as follows:
> > 
> > scons: *** [/usr/local/bin/gegps] /usr/local/bin/gegps: Permission
> > denied scons: building terminated because of errors.  
> 
> Tyring to install in the system as non-root?  That SHOULD not work.
> Ever.  Nor should "scons && scons check" be installing anything.

Agree.

And I narrowed the installation down to "scons check".

> 
> Or is scons trying to execute /usr/local/bin/gegps?  In which case
> it should work fine.  Since you are running "scons && scons check" no
> way to know which ("scons" or "scons check") is wrong.  And neither
> should be running anything out of the tree.

If you run as root, "scons check" installs (not good), then runs the
programs out of the tree (meh). The only thing it does (as far as I've
gotten) is run with -V to have the program print out the version. I.e.
a basic sanity check. This is not necessarily a bad thing, as that's
how I learned about the pyserial dependency. I'd rather lean about it
at test time than after installation.

> 
> So always best to post the full output.  Then others can see what
> happened, not just the parts you pass on.

Noted.

> 
> > for obvious reasons:
> > 
> > address@hidden:~/versioned/gpsd$ ls -l $( which gegps )
> > -rwxr-xr-x 1 root root 4395 Oct  4 14:43 /usr/local/bin/gegps
> > address@hidden:~/versioned/gpsd$   
> 
> Looks correct to me.  Only root should be abe to write
> in /usr/local/*bin/

I sit corrected. And permissions for the directory were odd:

address@hidden:~$ ll -d /usr/local/bin
drwxrwxr-x 2 root 500 4096 Oct  4 14:43 /usr/local/bin/
address@hidden:~$

but "other" should be able to read and execute (search) regardless. So
I don't know why a permission was being denied to a non-root
user. Since I don't have Google Earth installed, it may have failed
trying to open something related to GE.

Here is complete output, from this morning's run of "scons check", as a
non-root user:

--------------------------------------------------
address@hidden:~/versioned/gpsd$ scons check
scons: Reading SConscript files ...
Checking if compiler accepts -pthread... (cached) yes
Checking whether the C++ compiler works... (cached) yes
Checking pkg-config for ncurses... (cached) yes
Checking pkg-config for tinfo... (cached) yes
Checking pkg-config for libusb-1.0... (cached) yes
Checking for C library librt... (cached) yes
Checking pkg-config for dbus-1... (cached) yes
Checking pkg-config for bluez... (cached) yes
Checking for C type in_port_t... (cached) yes
Checking whether SUN_LEN is declared... (cached) yes
Checking for C header file linux/can.h... (cached) yes
You have kernel CANbus available.
Checking if compiler is C11... (cached) yes
Checking if compiler supplies __STDC_NO_ATOMICS__... (cached) no
Checking for C header file stdatomic.h... (cached) yes
Checking if compiler supplies __ORDER_BIG_ENDIAN__... (cached) yes
Checking if compiler supplies __ORDER_LITTLE_ENDIAN__... (cached) yes
Checking if compiler supplies __BYTE_ORDER__... (cached) yes
Your compiler has built-in endianness support.
Checking for C header file sys/un.h... (cached) yes
Checking for C header file sys/socket.h... (cached) yes
Checking for C header file sys/select.h... (cached) yes
Checking for C header file netdb.h... (cached) yes
Checking for C header file netinet/in.h... (cached) yes
Checking for C header file netinet/ip.h... (cached) yes
Checking for C header file arpa/inet.h... (cached) yes
Checking for C header file syslog.h... (cached) yes
Checking for C header file termios.h... (cached) yes
Checking for C header file winsock2.h... (cached) no
Checking for C function daemon()... (cached) yes
Checking for C function strlcpy()... (cached) no
Checking for C function strlcat()... (cached) no
Checking for C function clock_gettime()... (cached) yes
Checking for C function strptime()... (cached) yes
Checking for C function gmtime_r()... (cached) yes
Checking for C function inet_ntop()... (cached) yes
Checking for C function fcntl()... (cached) yes
Checking for C function fork()... (cached) yes
Checking for C header file sys/timepps.h... (cached) yes
Checking if sys/ioctl.h supplies TIOCMIWAIT... (cached) yes
Checking for C library libbluetooth... (cached) yes
Checking for C library libdbus-1... (cached) yes
Checking that xsltproc can make man pages... (cached) yes
Checking pkg-config for QtNetwork... (cached) yes
Checking if compiler accepts -Wextra... (cached) yes
Checking if compiler accepts -Wall... (cached) yes
Checking if compiler accepts -Wno-uninitialized... (cached) yes
Checking if compiler accepts -Wno-missing-field-initializers... (cached) yes
Checking if compiler accepts -Wcast-align... (cached) yes
Checking if compiler accepts -Wmissing-declarations... (cached) yes
Checking if compiler accepts -Wmissing-prototypes... (cached) yes
Checking if compiler accepts -Wstrict-prototypes... (cached) yes
Checking if compiler accepts -Wpointer-arith... (cached) yes
Checking if compiler accepts -Wreturn-type... (cached) yes
Checking whether python program exists.../usr/bin/python
Obtaining Python exe path... /usr/bin/python
Obtaining Python lib dir... /usr/lib/python2.7/dist-packages
Obtaining Python config vars... ok
All configuration flags are defaulted.
scons: done reading SConscript files.
scons: Building targets ...
timebase_h(["timebase.h"], ["leapseconds.cache"])
gcc -o timebase.o -c -pthread -Wextra -Wall -Wno-uninitialized 
-Wno-missing-field-initializers -Wcast-align -Wmissing-declarations 
-Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith -Wreturn-type -O2 
-pthread -DHAVE_SYS_TIMEPPS_H=1 -I/usr/include/dbus-1.0 
-I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/libusb-1.0 
timebase.c
ar rc libgpsd.a bsd_base64.o crc24q.o driver_ais.o driver_evermore.o 
driver_garmin.o driver_garmin_txt.o driver_geostar.o driver_greis.o 
driver_greis_checksum.o driver_italk.o driver_navcom.o driver_nmea0183.o 
driver_nmea2000.o driver_oncore.o driver_rtcm2.o driver_rtcm3.o drivers.o 
driver_sirf.o driver_skytraq.o driver_superstar2.o driver_tsip.o driver_ubx.o 
driver_zodiac.o geoid.o gpsd_json.o isgps.o libgpsd_core.o matrix.o 
net_dgpsip.o net_gnss_dispatch.o net_ntrip.o ntpshmread.o ntpshmwrite.o 
packet.o ppsthread.o pseudoais.o pseudonmea.o serial.o subframe.o timebase.o 
timespec_str.o
ranlib libgpsd.a
gcc -o gpsdecode -pthread gpsdecode.o -L. -lgpsd -lgps_static -lusb-1.0 
-lbluetooth -lm -lrt -ldbus-1
Testing AIVDM decoding w/ CSV format...
 Testing ./test/sample.aivdm...
Testing AIVDM decoding w/ JSON unscaled format...
 Testing ./test/sample.aivdm...
Testing AIVDM decoding w/ JSON scaled format...
 Testing ./test/sample.aivdm...
Testing idempotency of unscaled JSON dump/decode for AIS
Testing idempotency of scaled JSON dump/decode for AIS
./test_bits --quiet
Run normal regression tests for 3.18...
gcc -o test_geoid -pthread test_geoid.o -L. -lgpsd -lgps_static -lusb-1.0 
-lbluetooth -lm -lrt -ldbus-1
Testing the geoid model...
./test_geoid 37.371192 122.014965 | diff -u ./test/geoid.test.chk -
./test_json
JSON unit tests
succeeded.
Testing the Maidenhead Locator conversion...
/usr/bin/python ./test_maidenhead.py >/dev/null
gcc -o test_matrix -pthread test_matrix.o -L. -lgpsd -lgps_static -lusb-1.0 
-lbluetooth -lm -lrt -ldbus-1
./test_matrix --quiet
Matrix-algebra regression test succeeded
gcc -o test_packet -pthread test_packet.o -L. -lgpsd -lgps_static -lusb-1.0 
-lbluetooth -lm -lrt -ldbus-1
Consistency-checking driver methods...
./test_packet -c >/dev/null
Testing detection of invalid packets...
./test_packet | diff -u ./test/packet.test.chk -
check_compile(["python-compilation-regress"], ["gpscap.py", "gpssim.py", 
"jsongen.py", "leapsecond.py", "maskaudit.py", "test_maidenhead.py", 
"test_misc.py", "test_xgps_deps.py", "valgrind-audit.py", "gps/__init__.py", 
"gps/client.py", "gps/fake.py", "gps/gps.py", "gps/misc.py", 
"gps/watch_options.py", "gegps", "gpscat", "gpsfake", "gpsprof", "ubxtool", 
"zerk", "xgps", "xgpsspeed", "SConstruct"])
scons: *** [/usr/local/bin/gegps] /usr/local/bin/gegps: Permission denied
scons: building terminated because of errors.
address@hidden:~/versioned/gpsd$
--------------------------------------------------


> 
> > Hmmm, that seemed odd to me. gegps is part of gpsd. Why is a test
> > run depending on a program that is already installed?  
> 
> Neither "scons" or "scons check" should install anything.  Are you
> sure that is the case?

See below.

> 
> > So I re-cloned, this time as root. Aha! 'scons check' produces:
> > 
> > Install file: "gegps" as "/usr/local/bin/gegps"  
> 
> Sure looks like an install, not an exectute, to me.
> 
> > So a different question: why is what should be a test run installing
> > software on what might be a virgin system?  
> 
> "scons check" should not.  I'll run some tests.
> 
> > Can the subsequent tests be
> > run locally -- and regardless of the user? They are.  
> 
> They are supposed to be.
> 
> > And 'scons check' fails:
> > 
> > gpsfake: Version 3.18
> > ./gpsprof -V
> > gpsprof: Version 3.18
> > ./ubxtool -V
> > ubxtool: failed to import pyserial
> > scons: *** [python-versions] Error 2
> > scons: building terminated because of errors.  
> 
> Well, that one is obvious.  You do not have pyserial installed.
> 
> > I should probably install one or both of:
> > 
> > address@hidden:~# apt-cache search pyserial
> > python-serial - pyserial - module encapsulating access for the
> > serial port python3-serial - pyserial - module encapsulating access
> > for the serial port address@hidden:~#   
> 
> I have idea what voodoo incantation your distro requires. "apt" mungs
> things in non-standard and non-obvious ways.

Fair enough.

> 
> > Recommendation as to which, or both, to install?  
> 
> I'm guessing here.  python-serial is for Python 2.  python3-serial is
> for Python 3.  So I would install both.  15 months until Python 2 EOL.

OK, will do.

> 
> Unlikely the 10 year Python2/3 madness will simply at that time...
> 
> > We should probably document this dependency in INSTALL.  
> 
> Tell us what to say when you figure it out.  I'll add a generic
> note now.

Will do.


> 
> After release I added a check in SConstruct to warn if pyserial not
> installed.  Fred Wright is working on a patch to make pyserial
> optional.

Both excellent ideas. Thank you.



-- 
"When we talk of civilization, we are too apt to limit the meaning of
the word to its mere embellishments, such as arts and sciences; but
the true distinction between it and barbarism is, that the one
presents a state of society under the protection of just and
well-administered law, and the other is left to the chance government
of brute force."
- The Rev. James White, Eighteen Christian Centuries, 1889
Key fingerprint = CE5C 6645 A45A 64E4 94C0  809C FFF6 4C48 4ECD DFDB
https://charlescurley.com



reply via email to

[Prev in Thread] Current Thread [Next in Thread]