bug#49815: Upcoming timekeeping failure in gpsd

2021-08-07 Thread Thiago Jung Bauermann via Bug reports for GNU Guix
Hi Sarah,

Em sábado, 7 de agosto de 2021, às 00:13:16 -03, Sarah Morgensen escreveu:

> > @@ -259,6 +261,7 @@ such as elevation, speed, heart rate, power,
> > temperature, and gear shifts.")> 
> > (modify-phases %standard-phases
> > 
> >   (add-after 'unpack 'fix-build
> >   
> > (lambda* (#:key outputs #:allow-other-keys)
> > 
> > + (setenv "TAR" "noop")
> > 
> >   (substitute* "SConstruct"
> 
>   ^ Should be "SConscript"
> 
> This fixes the build.

Nice!

> > (("envs = \\{\\}")
> >  "envs = os.environ"))

IIUC this takes care of propagating $C_INCLUDE_PATH to gcc. I should have 
noticed it before. :facepalm:

> Hope that helps!

Thank you!

-- 
Thanks,
Thiago







bug#49815: Upcoming timekeeping failure in gpsd

2021-08-07 Thread Leo Famulari
On Fri, Aug 06, 2021 at 08:13:16PM -0700, Sarah Morgensen wrote:
> >   (substitute* "SConstruct"
>   ^ Should be "SConscript"
> 
> This fixes the build.
> 
> > (("envs = \\{\\}")
> >  "envs = os.environ"))
> 
> Hope that helps!

Aha!

Thanks to you and Thiago for your help with this!

Fixed with 178cbc30d4e4f4a5d718ae220894544709483ef7.





bug#49815: Upcoming timekeeping failure in gpsd

2021-08-06 Thread Sarah Morgensen
Hi Leo,

Leo Famulari  writes:

> I got past the previous build failure by setting the environment
> variable "TAR=noop" (found in the Nix package [0])... who knows what
> that means? It only appears in the Nix packaging.
>
> So now, using the attached patch, it fails to build because it can't
> find limits.h, as shown below. Any ideas?
>

[...]

>
> diff --git a/gnu/packages/gps.scm b/gnu/packages/gps.scm
> index 0eb4362858..df4c8ef4f6 100644
> --- a/gnu/packages/gps.scm
> +++ b/gnu/packages/gps.scm
> @@ -222,14 +222,16 @@ such as elevation, speed, heart rate, power, 
> temperature, and gear shifts.")
>  (define-public gpsd
>(package
>  (name "gpsd")
> -(version "3.21")
> +(version "3.23-rc1")
>  (source
>   (origin
> -   (method url-fetch)
> -   (uri (string-append "https://download-mirror.savannah.gnu.org;
> -   "/releases/gpsd/gpsd-" version ".tar.gz"))
> +   (method git-fetch)
> +   (uri (git-reference
> +  (url "https://gitlab.com/gpsd/gpsd;)
> +  (commit "7f30d88d04dc62b8bd6265ad1d09d72d220f97f6")))
> +   (file-name (git-file-name name version))
> (sha256
> -(base32 "14gyqrbrq6jz4y6x59rdpv9d4c3pbn0vh1blq3iwrc6kz0x4ql35"
> +(base32 "0n2ba6n2z3qjnjl2lvzqrp71x2rkip17p0r9hflviwkzcfr7ppdk"
>  (build-system scons-build-system)
>  (native-inputs
>   `(("bc" ,bc)
> @@ -259,6 +261,7 @@ such as elevation, speed, heart rate, power, temperature, 
> and gear shifts.")
> (modify-phases %standard-phases
>   (add-after 'unpack 'fix-build
> (lambda* (#:key outputs #:allow-other-keys)
> + (setenv "TAR" "noop")
>   (substitute* "SConstruct"
  ^ Should be "SConscript"

This fixes the build.

> (("envs = \\{\\}")
>  "envs = os.environ"))

Hope that helps!

--
Sarah





bug#49815: Upcoming timekeeping failure in gpsd

2021-08-06 Thread Sarah Morgensen
Hi,

Just a quick suggestion from a bystander...

Thiago Jung Bauermann  writes:

> The SCons build system sets the compiler include path from the $CPPPATH
> environment variable while GCC and Guix use $C_INCLUDE_PATH, so set the
> former with the value of the latter.
>
> * guix/build/scons-build-system.scm (build): Set $CPPPATH from
> $C_INCLUDE_PATH.
> ---
>
> Hi Leo,
>
> I was able to build your patch using this one.
>
> Thanks,
> Thiago
>
>
>  guix/build/scons-build-system.scm | 5 +
>  1 file changed, 5 insertions(+)
>
> diff --git a/guix/build/scons-build-system.scm 
> b/guix/build/scons-build-system.scm
> index 17a0b7b877e6..fa422c41a172 100644
> --- a/guix/build/scons-build-system.scm
> +++ b/guix/build/scons-build-system.scm
> @@ -20,6 +20,7 @@
>  (define-module (guix build scons-build-system)
>#:use-module ((guix build gnu-build-system) #:prefix gnu:)
>#:use-module (guix build utils)
> +  #:use-module (srfi srfi-26)
>#:export (%standard-phases
>  scons-build))
>  
> @@ -32,6 +33,10 @@
>  (define* (build #:key outputs (build-targets '()) (scons-flags '()) 
> (parallel-build? #t) #:allow-other-keys)
>(let ((out (assoc-ref outputs "out")))
>  (mkdir-p out)
> +;; SCons expects the include path in $CPPPATH, so copy from
> +;; $C_INCLUDE_PATH.
> +(let ((c-include-path (getenv "C_INCLUDE_PATH")))
> +  (and=> c-include-path (cut setenv "CPPPATH" <>)))

To avoid importing srfi-26, you could write

 (and c-include-path (setenv "CPPPATH" c-include-path))

Or, if you're confident C_INCLUDE_PATH is always set (since
scons-build-system extends gnu-build-system, which includes gcc):

 (setenv "CPPPATH" (getenv "C_INCLUDE_PATH"))

>  (apply invoke "scons"
> (append (if parallel-build?
> (list "-j" (number->string

--
Sarah





bug#49815: Upcoming timekeeping failure in gpsd

2021-08-02 Thread Leo Famulari
I got past the previous build failure by setting the environment
variable "TAR=noop" (found in the Nix package [0])... who knows what
that means? It only appears in the Nix packaging.

So now, using the attached patch, it fails to build because it can't
find limits.h, as shown below. Any ideas?

--
gcc -o gpsd-3.22/drivers/driver_greis_checksum.os -c -O2 -fPIC 
-I/gnu/store/00bkkmzybyfmbhhv0nw7r49m72339lyf-dbus-1.12.16/include/dbus-1.0 
-I/gnu/store/00bkkmzybyfmbhhv0nw7r49m72339lyf-dbus-1.12.16/lib/dbus-1.0/include 
gpsd-3.22/drivers/driver_greis_checksum.c
In file included from 
/gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31/include/bits/posix1_lim.h:161:0,
 from 
/gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31/include/limits.h:183,
 from 
/gnu/store/01b4w3m6mp55y531kyi1g8shh722kwqm-gcc-7.5.0-lib/lib/gcc/x86_64-unknown-linux-gnu/7.5.0/include-fixed/limits.h:194,
 from 
/gnu/store/01b4w3m6mp55y531kyi1g8shh722kwqm-gcc-7.5.0-lib/lib/gcc/x86_64-unknown-linux-gnu/7.5.0/include-fixed/syslimits.h:7,
 from 
/gnu/store/01b4w3m6mp55y531kyi1g8shh722kwqm-gcc-7.5.0-lib/lib/gcc/x86_64-unknown-linux-gnu/7.5.0/include-fixed/limits.h:34,
 from gpsd-3.22/drivers/driver_greis_checksum.c:11:
/gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31/include/bits/local_lim.h:38:10:
 fatal error: linux/limits.h: No such file or directory
 #include 
  ^~~~
compilation terminated.
gcc -o gpsd-3.22/drivers/driver_rtcm2.os -c -O2 -fPIC 
-I/gnu/store/00bkkmzybyfmbhhv0nw7r49m72339lyf-dbus-1.12.16/include/dbus-1.0 
-I/gnu/store/00bkkmzybyfmbhhv0nw7r49m72339lyf-dbus-1.12.16/lib/dbus-1.0/include 
gpsd-3.22/drivers/driver_rtcm2.c
scons: *** [gpsd-3.22/drivers/driver_greis_checksum.os] Error 1
In file included from 
/gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31/include/bits/posix1_lim.h:161:0,
 from 
/gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31/include/limits.h:183,
 from 
/gnu/store/01b4w3m6mp55y531kyi1g8shh722kwqm-gcc-7.5.0-lib/lib/gcc/x86_64-unknown-linux-gnu/7.5.0/include-fixed/limits.h:194,
 from 
/gnu/store/01b4w3m6mp55y531kyi1g8shh722kwqm-gcc-7.5.0-lib/lib/gcc/x86_64-unknown-linux-gnu/7.5.0/include-fixed/syslimits.h:7,
 from 
/gnu/store/01b4w3m6mp55y531kyi1g8shh722kwqm-gcc-7.5.0-lib/lib/gcc/x86_64-unknown-linux-gnu/7.5.0/include-fixed/limits.h:34,
 from gpsd-3.22/drivers/../include/gps.h:14,
 from gpsd-3.22/drivers/../include/gpsd.h:29,
 from gpsd-3.22/drivers/driver_rtcm2.c:65:
/gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31/include/bits/local_lim.h:38:10:
 fatal error: linux/limits.h: No such file or directory
 #include 
  ^~~~
compilation terminated.
scons: *** [gpsd-3.22/drivers/driver_rtcm2.os] Error 1
scons: building terminated because of errors.
--

[0]
https://github.com/NixOS/nixpkgs/blob/b166cc7fddc7c9b3fdd27dd74f177116ee5e2a7b/pkgs/servers/gpsd/default.nix#L54
diff --git a/gnu/packages/gps.scm b/gnu/packages/gps.scm
index 0eb4362858..df4c8ef4f6 100644
--- a/gnu/packages/gps.scm
+++ b/gnu/packages/gps.scm
@@ -222,14 +222,16 @@ such as elevation, speed, heart rate, power, temperature, 
and gear shifts.")
 (define-public gpsd
   (package
 (name "gpsd")
-(version "3.21")
+(version "3.23-rc1")
 (source
  (origin
-   (method url-fetch)
-   (uri (string-append "https://download-mirror.savannah.gnu.org;
-   "/releases/gpsd/gpsd-" version ".tar.gz"))
+   (method git-fetch)
+   (uri (git-reference
+  (url "https://gitlab.com/gpsd/gpsd;)
+  (commit "7f30d88d04dc62b8bd6265ad1d09d72d220f97f6")))
+   (file-name (git-file-name name version))
(sha256
-(base32 "14gyqrbrq6jz4y6x59rdpv9d4c3pbn0vh1blq3iwrc6kz0x4ql35"
+(base32 "0n2ba6n2z3qjnjl2lvzqrp71x2rkip17p0r9hflviwkzcfr7ppdk"
 (build-system scons-build-system)
 (native-inputs
  `(("bc" ,bc)
@@ -259,6 +261,7 @@ such as elevation, speed, heart rate, power, temperature, 
and gear shifts.")
(modify-phases %standard-phases
  (add-after 'unpack 'fix-build
(lambda* (#:key outputs #:allow-other-keys)
+ (setenv "TAR" "noop")
  (substitute* "SConstruct"
(("envs = \\{\\}")
 "envs = os.environ"))


bug#49815: Upcoming timekeeping failure in gpsd

2021-08-01 Thread Leo Famulari
In October, the date reported by gpsd will jump back by 1024 weeks:

https://gitlab.com/gpsd/gpsd/-/issues/144

This will be fixed in the upcoming 3.23 release:

https://gitlab.com/gpsd/gpsd/-/issues/144#note_636906629

This is a serious problem because gpsd is commonly used as a time source
for network time servers.

I tried updating our package from 3.21 to 3.22, to help prepare for this
important update, but the build fails during the configure portion of
the SCons 'build' phase as shown below. I'm not familiar with SCons so
I'm not sure which is the salient error.

--
starting phase `build'
scons: Reading SConscript files ...
scons version: 3.0.4
scons is running under Python version: 3.8.2.final.0
gpsd version: 3.22
This system is: linux
Checking whether the C compiler works... yes
Checking if compiler accepts -pthread... no
Checking whether the C++ compiler works... yes
Checking for C header file curses.h... no
Turning off ncurses support, curses.h not found.
Checking pkg-config for libusb-1.0... yes
Checking for C library librt... no
Checking for C library libnsl... no
Checking for C library libsocket... no
Checking for C library libm... no
Checking for C library libthr... no
Checking pkg-config for dbus-1... yes
Checking pkg-config for bluez... yes
Checking for C type in_port_t... no
Did not find in_port_t typedef, assuming unsigned short int
Checking whether SUN_LEN is declared... yes
Checking for C header file linux/can.h... no
You do not have kernel CANbus available.
Checking if compiler is C11... no
Checking for C header file libkern/OSAtomic.h... no
No memory barriers - SHM export and time hinting may not be reliable.
Checking whether __ORDER_BIG_ENDIAN__ is declared... yes
Checking whether __ORDER_LITTLE_ENDIAN__ is declared... yes
Checking whether __BYTE_ORDER__ is declared... yes
Your compiler has built-in endianness support.
Checking for C header file arpa/inet.h... no
Checking for C header file netdb.h... no
Checking for C header file netinet/in.h... no
Checking for C header file netinet/ip.h... no
Checking for C header file sys/sysmacros.h... yes
Checking for C header file sys/socket.h... no
Checking for C header file sys/un.h... yes
Checking for C header file syslog.h... yes
Checking for C header file termios.h... yes
Checking for C header file winsock2.h... no
Checking if sizeof(time_t) is 64 bits... no
WARNING: time_t is too small.  It will fail in 2038
Checking for C function cfmakeraw()... no
Checking for C function clock_gettime()... no
Checking for C function daemon()... no
Checking for C function fcntl()... no
Checking for C function fork()... no
Checking for C function getopt_long()... no
Checking for C function gmtime_r()... no
Checking for C function inet_ntop()... no
Checking for C function strlcat()... no
Checking for C function strlcpy()... no
Checking for C function strptime()... no
Checking for C function sincos()... no
Checking for C function __sincos()... no
Checking for C header file sys/timepps.h... no
Forcing magic_hat=no since RFC2783 API is unavailable
Checking whether TIOCMIWAIT is declared... no
WARNING: Neither TIOCMIWAIT (PPS) nor RFC2783 API (KPPS) is available.
Checking for C library libbluetooth... no
libbluetooth not found, bluez cannot be enabled.
Checking for C library libdbus-1... no
libdbus-1 not found, dbus_export cannot be enabled.
Checking that xsltproc can make man pages... no
Neither xsltproc nor xmlto found, documentation cannot be built.
Checking pkg-config for Qt5Network... yes
Checking if compiler accepts -Wall... no
Checking if compiler accepts -Wcast-align... no
Checking if compiler accepts -Wextra... no
Checking if compiler accepts -Wimplicit-fallthrough... no
Checking if compiler accepts -Wmissing-declarations... no
Checking if compiler accepts -Wmissing-prototypes... no
Checking if compiler accepts -Wno-missing-field-initializers... no
Checking if compiler accepts -Wno-uninitialized... no
Checking if compiler accepts -Wpointer-arith... no
Checking if compiler accepts -Wreturn-type... no
Checking if compiler accepts -Wstrict-prototypes... no
Checking if compiler accepts -Wvla... no
Checking whether coverage program exists...no
Checking whether cppcheck program exists...no
Checking whether dia program exists...no
Checking whether flake8 program exists...no
Checking whether pycodestyle program exists...no
Checking whether pylint program exists...no
Checking whether scan-build program exists...no
Checking whether tar program 
exists.../gnu/store/v6f44zccwh9z5zk3pjlywjybbi8n2hjh-tar-1.32/bin/tar
Checking whether valgrind program exists...no
Checking whether xmllint program exists...no
Program coverage not found -- skipping Python coverage
Program cppcheck not found -- skipping cppcheck checks
Program dia not found -- not rebuiding cycle.svg.
Program flake8 not found -- skipping flake8 checks
Program pycodestyle not found -- skipping pycodestyle checks
Program pylint not found -- skipping pylint checks
Program scan-build not found --