unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Philip McGrath <philip@philipmcgrath.com>
To: Leo Prikler <leo.prikler@student.tugraz.at>, 49280@debbugs.gnu.org
Subject: [bug#49280] [PATCH v2 1/3] gnu: racket: Update to 8.2.
Date: Sun, 25 Jul 2021 04:22:03 -0400	[thread overview]
Message-ID: <94d8a86a-dca6-46a5-0c5e-fd82a6cd6397@philipmcgrath.com> (raw)
In-Reply-To: <95998dae5aec25fed80dd1e5a3808167796282ae.camel@student.tugraz.at>

On 7/20/21 5:40 AM, Leo Prikler wrote:
> Am Montag, den 19.07.2021, 17:46 -0400 schrieb Philip McGrath:
>> As you'd probably guess, `lib-search-dirs` and other `-search-dirs`
>> "config.rktd" entries specify search paths. The `#f` value is used
>> to
>> specify the point at which the default search path should be spliced
>> into the list: a configuration file can ignore the default altogether
>> or
>> exercise fine-grained control over the search order. Using `#f` also
>> helps to maintain something closer to a single point of control,
>> rather
>> than hard-code the same string constants in several places.
> Okay, but for this specific config, we could still splice #f ourselves
> (particularly to also get full store paths), or can we not thanks to
> the non-constant nature of #f?
> 
>> Most importantly, the default value is not always a constant: for
>> example, command-line flags and Racket parameters control whether
>> user-specific paths are included.
> How exactly would this play out?  Would for example one version of #f
> contain all of the user-installed packages in ~/.guix-profile whereas
> the other would only contain racket's own path?
> 
>> (For `lib-search-dirs` in particular, it's also worth noting that
>> these are Racket-specific search directories: it does not control the
>> use of OS-level defaults for e.g. `dlopen`.)
> Perhaps a confusing naming scheme, but okay.

The short answer is that I don't think including #f is causing any 
problems, whereas trying not to include it seems likely to cause a 
variety of problems.

I'll try to explain more clearly.

It might be more useful to look at the second patch in the series, which 
uses the "extend-layer.rkt" script to generate a "config.rkt" file for 
the `racket` package, and especially the third patch, which replaces 
this code completely for the `racket-minimal` package:

On 7/19/21 2:31 AM, Philip McGrath wrote:
> +         (add-before 'configure 'initialize-config.rktd
>              (lambda* (#:key inputs #:allow-other-keys)
> -             (chdir "src")
> +             (define (write-racket-hash alist)
> +               ;; inside must use dotted pair notation
> +               (display "#hash(")
> +               (for-each (match-lambda
> +                           ((k . v)
> +                            (format #t "(~s . ~s)" k v)))
> +                         alist)
> +               (display ")\n"))
> +             (mkdir-p "racket/etc")
> +             (with-output-to-file "racket/etc/config.rktd"
> +               (lambda ()
> +                 (write-racket-hash
> +                  `((lib-search-dirs
> +                     . (#f ,@(map (lambda (lib)
> +                                    (string-append (assoc-ref inputs 
lib)
> +                                                   "/lib"))
> +                                  '("openssl"
> +                                    "sqlite"))))
> +                    (catalogs
> +                     . (,(string-append
> +                          "https://download.racket-lang.org/releases/"
> +                          ,version
> +                          "/catalog/")
> +                        #f))))))
>                #t))

This code creates a template "config.rktd" file used in the build 
process: the distributed source tarballs contain such a template 
already, which is why we didn't need explicitly configure `catalogs` to 
add the release-pinned package catalog until this change. It is added 
before the `#f` so that the release catalog is checked before the 
default catalogs (which point to the latest sources). For 
`lib-search-dirs`, on the other hand, we want Racket-specific library 
paths to be tried first, and indeed for layers of a Racket installation 
to be searched in order, so `#f` is at the head of the list.

The Racket build process extends the template "config.rktd" file based 
on build options like the `--prefix` passed to `configure`. For example, 
it configures `lib-dir` to "lib/racket" within the store output 
directory. (It would be incorrect to set those values in the template 
"config.rktd" file because it is used in the build process before 
installation.)

The `#f` entry in `lib-search-dirs` is usually replaced by a 
user-specific path like "/home/philip/.local/share/racket/8.1/lib" and 
the installation-wide path specified by the `lib-dir` key, unless one or 
both are changed. Omitting the `#f` entry means that neither of paths 
are ever included. I don't know of any real-life circumstance in which 
one would want such a "config.rktd" file. In particular, missing `#f` 
entries creates problems for layered installations, which use these 
search paths to find earlier layers.

There are some other configuration possibilities we may want to explore 
as Guix's support for Racket packages improves, such as "addon" 
tethering and customizing the "installation name" or "build stamp". 
However, this patch series does not attempt to change how Guix's Racket 
packages work, other than correcting the error I introduced in 
<https://issues.guix.gnu.org/47180>. Racket installed via Guix has the 
same behavior in this respect as Racket installed via Debian or other 
package managers, and that's a way of using Racket I think Guix will 
want to continue to support.

-Philip




  reply	other threads:[~2021-07-25  8:23 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-29 21:52 [bug#49280] [PATCH 0/4] gnu: racket: Add racket-next. Bootstrap from C Philip McGrath
2021-06-29 21:57 ` [bug#49280] [PATCH 1/4] gnu: racket: Fix lib-search-dirs configuration Philip McGrath
2021-06-29 21:57   ` [bug#49280] [PATCH 2/4] gnu: racket: Add racket-next and racket-next-minimal Philip McGrath
2021-07-08 21:25     ` [bug#49280] [PATCH 0/4] gnu: racket: Add racket-next. Bootstrap from C Ludovic Courtès
2021-07-18 21:35       ` Philip McGrath
2021-07-19  6:31         ` [bug#49280] [PATCH v2 1/3] gnu: racket: Update to 8.2 Philip McGrath
2021-07-19  6:31           ` [bug#49280] [PATCH v2 2/3] gnu: racket: Unbundle racket-minimal Philip McGrath
2021-07-30 21:33             ` [bug#49280] [PATCH v2 0/3] gnu: racket: Update to 8.2. Bootstrap from C Ludovic Courtès
2021-07-19  6:31           ` [bug#49280] [PATCH v2 3/3] gnu: racket-minimal: " Philip McGrath
2021-07-19 18:48             ` Philip McGrath
2021-07-19 19:46           ` [bug#49280] [PATCH v2 1/3] gnu: racket: Update to 8.2 Leo Prikler
2021-07-19 21:46             ` Philip McGrath
2021-07-20  9:40               ` Leo Prikler
2021-07-25  8:22                 ` Philip McGrath [this message]
2021-07-25 13:03                   ` Leo Prikler
2021-07-25 18:04                     ` Philip McGrath
2021-07-30 23:05           ` bug#49280: [PATCH v2 0/3] gnu: racket: Update to 8.2. Bootstrap from C Ludovic Courtès
2021-07-30 21:22         ` [bug#49280] " Ludovic Courtès
2021-07-30 21:31         ` [bug#49280] References to unversioned source tarballs Ludovic Courtès
2021-07-30 22:08           ` Philip McGrath
2021-06-29 21:57   ` [bug#49280] [PATCH 3/4] gnu: racket-next: Unbundle racket-next-minimal Philip McGrath
2021-06-29 21:57   ` [bug#49280] [PATCH 4/4] gnu: racket-next-minimal: Bootstrap from C Philip McGrath
2021-07-08 21:43     ` [bug#49280] [PATCH 0/4] gnu: racket: Add racket-next. " Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=94d8a86a-dca6-46a5-0c5e-fd82a6cd6397@philipmcgrath.com \
    --to=philip@philipmcgrath.com \
    --cc=49280@debbugs.gnu.org \
    --cc=leo.prikler@student.tugraz.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).