| 1 | From 6b3aed3d71ea9481762de7bd42395704176b6625 Mon Sep 17 00:00:00 2001
|
| 2 | From: Suhail <[email protected]>
|
| 3 | Date: Mon, 16 Dec 2024 15:07:55 -0500
|
| 4 | Subject: [PATCH v2] racket: raco: Ensure launchers of packages include config
|
| 5 | directory.
|
| 6 |
|
| 7 | Currently, binaries installed via "raco" (included in Guix's "racket" package)
|
| 8 | don't include the -G / --config configuration option specifying the "Main
|
| 9 | configuration directory". This is problematic.
|
| 10 |
|
| 11 | Specifically, when installing "rash" via raco using the below:
|
| 12 |
|
| 13 | #+begin_src sh
|
| 14 | raco pkg install rash
|
| 15 | #+end_src
|
| 16 |
|
| 17 | The resulting rash-repl binary (which is missing the -G configuration option
|
| 18 | in the call to the racket binary), when invoked, results in the following
|
| 19 | error:
|
| 20 |
|
| 21 | #+begin_src sh
|
| 22 | standard-module-name-resolver: collection not found
|
| 23 | for module path: (lib "rash/repl.rkt")
|
| 24 | collection: "rash"
|
| 25 | in collection directories:
|
| 26 | ${HOME}/.local/share/racket/8.14/collects
|
| 27 | /gnu/store/...-racket-vm-cs-8.14/opt/racket-vm/collects/
|
| 28 | #+end_src
|
| 29 |
|
| 30 | Adding the -G configuration option in the call to the racket binary fixes the
|
| 31 | above error.
|
| 32 |
|
| 33 | The executable scripts (at least on linux) are generated via
|
| 34 | make-unix-launcher in ./racket/collects/launcher/launcher.rkt . The patch
|
| 35 | below ensures that the -G flag is added to such launcher scripts. The patch
|
| 36 | is conservative in that it allows it to be overwritten by callers of
|
| 37 | launcher.rkt as desired.
|
| 38 |
|
| 39 | ---
|
| 40 | racket/collects/launcher/launcher.rkt | 9 ++++++++-
|
| 41 | 1 file changed, 8 insertions(+), 1 deletion(-)
|
| 42 |
|
| 43 | diff --git a/racket/collects/launcher/launcher.rkt b/racket/collects/launcher/launcher.rkt
|
| 44 | index 0faacec4ce..2c77d55caf 100644
|
| 45 | |
| 46 | |
| 47 | @@ -405,7 +405,14 @@
|
| 48 | [x-flags? (and (eq? kind 'mred)
|
| 49 | (eq? (cross-system-type) 'unix)
|
| 50 | (not (script-variant? variant)))]
|
| 51 | - [flags (let ([m (assq 'wm-class aux)])
|
| 52 | + [flags (let ([m (assq 'wm-class aux)]
|
| 53 | + [flags (if (or (member "-G" flags)
|
| 54 | + (member "--config" flags))
|
| 55 | + flags
|
| 56 | + (list* "-G"
|
| 57 | + (format "~a"
|
| 58 | + (find-system-path 'config-dir))
|
| 59 | + flags))])
|
| 60 | (if m
|
| 61 | (list* "-J" (cdr m) flags)
|
| 62 | flags))]
|
| 63 | --
|
| 64 | 2.47.1
|
| 65 |
|