Subject: Re: bug#49815: Upcoming timekeeping failure in gpsd

From: Sarah Morgensen <[email-masked]>
Date: Fri, 06 Aug 2021 17:44:24 -0700

Hi,

Just a quick suggestion from a bystander...

Thiago Jung Bauermann <[email-masked]> 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