Subject: Re: [bug#37412] [PATCH 1/2] gnu: Add guix-data-service.

From: Christopher Baines <[email-masked]>
Date: Tue, 24 Sep 2019 20:34:55 +0100

Ludovic Courtès <[email-masked]> writes:

> Christopher Baines <[email-masked]> skribis:
>
>> * gnu/packages/web.scm (guix-data-service): New variable.
>
> [...]
>
>> +      (native-inputs
>> +       `(("autoconf" ,autoconf)
>> +         ("automake" ,automake)
>> +         ("emacs-with-modules" ,(directory-union
>> +                                 "emacs-union"
>> +                                 (list emacs-no-x
>> +                                       emacs-htmlize)))
>
> Should it be ‘emacs-minimal’?

It probably could be, but at the moment this doesn't work with the Emacs
Lisp code that's run at package build time to convert the README to HTML
[1].

1: https://git.savannah.gnu.org/cgit/guix/data-service.git/tree/Makefile.am#n35

Do you know if there's a way to remove the need for the autoloading
behaviour from the guix-emacs.el file? The error I get when using
emacs-minimal suggests htmlize isn't being found.

>> +      (native-search-paths
>> +       ;; XXX guile-git requires this to be set, maybe there's a better way
>> +       (list (search-path-specification
>> +              (variable "GIT_SSL_CAINFO")
>> +              (file-type 'regular)
>> +              (separator #f)
>> +              (files '("etc/ssl/certs/ca-certificates.crt")))))
>
> Like I wrote, I’d rather remove the search path and add the environment
> variable…

Yeah, I'm actually unsure if this is doing anything. I'll remove it.

>> +      (start #~(make-forkexec-constructor
>> +                (list #$(file-append package
>> +                                     "/bin/guix-data-service")
>> +                      "--pid-file=/var/run/guix-data-service/pid"
>> +                      #$(string-append "--port=" (number->string port))
>> +                      #$(string-append "--host=" host)
>> +                      ;; Perform any database migrations when the
>> +                      ;; service is started
>> +                      "--update-database")
>> +
>> +                #:user #$user
>> +                #:group #$group
>> +                #:pid-file "/var/run/guix-data-service/pid"
>> +                ;; Allow time for migrations to run
>> +                #:pid-file-timeout 60
>> +                #:environment-variables
>> +                `(,(string-append
>> +                    "GUIX_LOCPATH=" #$glibc-utf8-locales "/lib/locale")
>> +                  "LC_ALL=en_US.utf8")
>> +                #:log-file "/var/log/guix-data-service/web.log"))
>
> … here.           ↑

So, this shepherd service which serves requests doesn't do any Git
access, and the process jobs shepherd service defined below actually
already sets it:

  "GIT_SSL_CAINFO=/etc/ssl/certs/ca-certificates.crt"

So yeah, I think I can just remove the native-search-paths bit from the
package definition.

> But anyway, these are details so I think you can go ahead and push as
> you see fit.

Great, thanks for taking a look Ludo!

Chris