Upcoming timekeeping failure in gpsd

  • Done
  • quality assurance status badge
Details
3 participants
  • Thiago Jung Bauermann
  • Sarah Morgensen
  • Leo Famulari
Owner
unassigned
Submitted by
Leo Famulari
Severity
normal
L
L
Leo Famulari wrote on 1 Aug 2021 23:27
(address . bug-guix@gnu.org)
YQcRqonOKMHEFOLJ@jasmine.lan
Attachment: file
L
L
Leo Famulari wrote on 2 Aug 2021 23:24
(address . 49815@debbugs.gnu.org)
YQhikmaTv8sRAGbZ@jasmine.lan
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 <linux/limits.h>
^~~~~~~~~~~~~~~~
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 <linux/limits.h>
^~~~~~~~~~~~~~~~
compilation terminated.
scons: *** [gpsd-3.22/drivers/driver_rtcm2.os] Error 1
scons: building terminated because of errors.
------

[0]
Toggle diff (34 lines)
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"))
T
T
Thiago Jung Bauermann wrote on 7 Aug 2021 00:55
[PATCH] build-system/scons: Set $CPPPATH
(name . Leo Famulari)(address . leo@famulari.name)
20210806225517.346462-1-bauermann@kolabnow.com
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(+)

Toggle diff (23 lines)
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" <>)))
(apply invoke "scons"
(append (if parallel-build?
(list "-j" (number->string
S
S
Sarah Morgensen wrote on 7 Aug 2021 02:44
Re: bug#49815: Upcoming timekeeping failure in gpsd
(name . Thiago Jung Bauermann)(address . bauermann@kolabnow.com)
86lf5e13tj.fsf_-_@mgsn.dev
Hi,

Just a quick suggestion from a bystander...

Thiago Jung Bauermann <bauermann@kolabnow.com> writes:

Toggle quote (40 lines)
> 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"))

Toggle quote (4 lines)
> (apply invoke "scons"
> (append (if parallel-build?
> (list "-j" (number->string

--
Sarah
T
T
Thiago Jung Bauermann wrote on 7 Aug 2021 02:58
Re: [PATCH] build-system/scons: Set $CPPPATH
(name . Leo Famulari)(address . leo@famulari.name)(address . 49815@debbugs.gnu.org)
2433013.0tHY3Qn5xH@popigai
Hi,

Em sexta-feira, 6 de agosto de 2021, às 19:55:17 -03, Thiago Jung Bauermann
escreveu:
Toggle quote (2 lines)
> I was able to build your patch using this one.

Actually no. Sorry, I spoke too soon. It still fails.
Back to the drawing board.


--
Thanks,
Thiago
S
S
Sarah Morgensen wrote on 7 Aug 2021 05:13
Re: bug#49815: Upcoming timekeeping failure in gpsd
(name . Leo Famulari)(address . leo@famulari.name)
864kc2hrqr.fsf@mgsn.dev
Hi Leo,

Leo Famulari <leo@famulari.name> writes:

Toggle quote (8 lines)
> 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?
>

[...]

Toggle quote (33 lines)
>
> 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.

Toggle quote (3 lines)
> (("envs = \\{\\}")
> "envs = os.environ"))

Hope that helps!

--
Sarah
L
L
Leo Famulari wrote on 7 Aug 2021 20:12
(name . Sarah Morgensen)(address . iskarian@mgsn.dev)
YQ7NBTI0XETDWQ+J@jasmine.lan
On Fri, Aug 06, 2021 at 08:13:16PM -0700, Sarah Morgensen wrote:
Toggle quote (10 lines)
> > (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.
Closed
T
T
Thiago Jung Bauermann wrote on 8 Aug 2021 00:17
(name . Sarah Morgensen)(address . iskarian@mgsn.dev)
3847867.9Jr9e7KGpX@popigai
Hi Sarah,

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

Toggle quote (16 lines)
> > @@ -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!

Toggle quote (3 lines)
> > (("envs = \\{\\}")
> > "envs = os.environ"))

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

Toggle quote (2 lines)
> Hope that helps!

Thank you!

--
Thanks,
Thiago
?