[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[shepherd] 01/06: build: Remove support for Guile 2.2.
From: |
Ludovic Courtès |
Subject: |
[shepherd] 01/06: build: Remove support for Guile 2.2. |
Date: |
Sun, 28 Apr 2024 17:16:25 -0400 (EDT) |
civodul pushed a commit to branch devel
in repository shepherd.
commit b6f9c3406732019f301a77265a180d88e16d3b73
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Sat Apr 27 19:08:03 2024 +0200
build: Remove support for Guile 2.2.
* configure.ac: Check for Guile 3.0. Remove check for ‘O_CLOEXEC’.
* modules/shepherd.scm (exception-with-kind-and-args?): Remove
‘cond-expand’ form for ‘exception-with-kind-and-args?’ and for ‘find’.
(configuration-file-loader): Remove ‘catch’ form.
* modules/shepherd/support.scm: Remove ‘cond-expand’ form for
‘call-with-port’.
* modules/shepherd/system.scm.in (O_CLOEXEC): Remove.
* tests/misbehaved-client.sh: Remove Guile 2.2 conditional.
* .guix/modules/shepherd-package.scm (guile2.2-shepherd): Remove.
* .guix/manifest.scm (native-builds): Remove reference to
‘guile2.2-shepherd’.
---
.guix/manifest.scm | 3 +--
.guix/modules/shepherd-package.scm | 9 ---------
README | 2 +-
configure.ac | 10 ++--------
modules/shepherd.scm | 19 +++++--------------
modules/shepherd/service.scm | 14 --------------
modules/shepherd/support.scm | 12 ------------
modules/shepherd/system.scm.in | 5 +----
tests/misbehaved-client.sh | 11 ++---------
9 files changed, 12 insertions(+), 73 deletions(-)
diff --git a/.guix/manifest.scm b/.guix/manifest.scm
index b212b80..454a4c6 100644
--- a/.guix/manifest.scm
+++ b/.guix/manifest.scm
@@ -49,8 +49,7 @@ TARGET."
(package->manifest-entry* package system))
(append
(list shepherd
- shepherd-from-tarball
- guile2.2-shepherd)
+ shepherd-from-tarball)
(if (string-suffix? "-linux" system)
(list shepherd/libevent)
'()))))
diff --git a/.guix/modules/shepherd-package.scm
b/.guix/modules/shepherd-package.scm
index 70a258e..57b77ca 100644
--- a/.guix/modules/shepherd-package.scm
+++ b/.guix/modules/shepherd-package.scm
@@ -197,15 +197,6 @@ interface and is based on GNU Guile.")
(modify-inputs (package-native-inputs shepherd)
(delete "autoconf" "automake" "gettext-minimal" "texinfo"
"help2man")))))
-(define-public guile2.2-shepherd
- (package
- (inherit shepherd)
- (name "guile2.2-shepherd")
- (native-inputs
- (append (map specification->package development-packages)
- (list pkg-config guile-2.2)))
- (inputs (list guile-2.2 guile2.2-fibers))))
-
;; Return the Shepherd package that lets you build from Git, for the benefit
;; of 'guix shell'.
shepherd
diff --git a/README b/README
index 04bf4da..349901b 100644
--- a/README
+++ b/README
@@ -16,7 +16,7 @@ daemon-managing daemon.
The GNU Shepherd depends on the following pieces of software:
- - GNU Guile 3.0.x or 2.2.x, https://gnu.org/software/guile
+ - GNU Guile 3.0.x, https://gnu.org/software/guile
- Fibers 1.1.0 or later, https://github.com/wingo/fibers
** Getting started
diff --git a/configure.ac b/configure.ac
index da113f2..4c9a6ae 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,9 +26,9 @@ AC_PATH_PROG([TIMEOUT], [timeout], [not-found])
AM_CONDITIONAL([HAVE_TIMEOUT], [test "x$TIMEOUT" != "xnot-found"])
AC_SUBST([TIMEOUT])
-dnl Check for Guile 2.2+.
+dnl Check for Guile.
m4_pattern_forbid([^GUILE_PKG$])
-GUILE_PKG([3.0 2.2])
+GUILE_PKG([3.0])
dnl Checks for programs.
GUILE_PROGS
@@ -89,12 +89,6 @@ AC_COMPUTE_INT([_SC_OPEN_MAX], [_SC_OPEN_MAX], [#include
<unistd.h>])
AC_MSG_RESULT([$_SC_OPEN_MAX])
AC_SUBST([_SC_OPEN_MAX])
-dnl Guile 2.2.7 lacks a definition for O_CLOEXEC.
-AC_MSG_CHECKING([the 'O_CLOEXEC' value])
-AC_COMPUTE_INT([O_CLOEXEC], [O_CLOEXEC], [#include <fcntl.h>])
-AC_MSG_RESULT([$O_CLOEXEC])
-AC_SUBST([O_CLOEXEC])
-
AC_MSG_CHECKING([<sys/reboot.h> constants])
AC_COMPUTE_INT([RB_AUTOBOOT], [RB_AUTOBOOT], [#include <sys/reboot.h>])
case "$host_os" in
diff --git a/modules/shepherd.scm b/modules/shepherd.scm
index b5c4744..e16de45 100644
--- a/modules/shepherd.scm
+++ b/modules/shepherd.scm
@@ -156,13 +156,8 @@ using fallback mechanism."))
(fcntl fd F_SETFD (logior FD_CLOEXEC flags)))))
(loop (+ fd 1)))))
-(cond-expand
- ((not guile-3)
- (define exception-with-kind-and-args?
- (const #f)))
- (else
- (define exception-with-kind-and-args?
- (exception-predicate &exception-with-kind-and-args))))
+(define exception-with-kind-and-args?
+ (exception-predicate &exception-with-kind-and-args))
(define (configuration-file-loader file)
"Return a thunk that loads @var{file}, the user's configuration file."
@@ -195,13 +190,9 @@ using fallback mechanism."))
(handle-key-and-args-exception
(exception-kind c) (exception-args c))
(failure)))
- (catch #t
- (lambda ()
- (load-in-user-module file)
- (local-output (l10n "Configuration successfully loaded from '~a'.")
- file))
- (lambda (key . args) ;for Guile 2.2
- (handle-key-and-args-exception key args))))))
+ (load-in-user-module file)
+ (local-output (l10n "Configuration successfully loaded from '~a'.")
+ file))))
(define (get-u8/timeout port timeout)
"Read a byte from @var{port}; return that byte, or the EOF object, or
diff --git a/modules/shepherd/service.scm b/modules/shepherd/service.scm
index d5f99ac..da33d52 100644
--- a/modules/shepherd/service.scm
+++ b/modules/shepherd/service.scm
@@ -1339,20 +1339,6 @@ service state and to send requests to the service
monitor."
((head . tail)
(loop tail (if (pred head) result (cons head result)))))))
-(cond-expand
- (guile-3.0 #t)
- (else
- ;; In Guile 2.2, SRFI-1 'find' is in C and thus introduces a continuation
- ;; barrier, which is a problem for 'launch-service'. Provide a Scheme
- ;; implementation to address that.
- (define (find pred lst)
- (let loop ((lst lst))
- (and (not (null? lst))
- (let ((head (car lst)))
- (if (pred head)
- head
- (loop (cdr lst)))))))))
-
(define (start-in-the-background services)
"Start the services named by @var{services}, a list of symbols, in the
background. In other words, this procedure returns immediately without
diff --git a/modules/shepherd/support.scm b/modules/shepherd/support.scm
index 1a83621..a9987d3 100644
--- a/modules/shepherd/support.scm
+++ b/modules/shepherd/support.scm
@@ -22,7 +22,6 @@
(define-module (shepherd support)
#:use-module (shepherd config)
- #:use-module (shepherd system) ;for 'O_CLOEXEC' on Guile 2.2
#:autoload (shepherd colors) (color-output? color colorize-string)
#:use-module (ice-9 match)
#:use-module (ice-9 format)
@@ -495,17 +494,6 @@ which has essential bindings pulled in."
(module-use! m (resolve-interface '(shepherd service)))
m))
-(cond-expand
- (guile-3 #t)
- (else
- ;; This is missing in Guile 2.2.
- (define (call-with-port port proc)
- (call-with-values
- (lambda () (proc port))
- (lambda vals
- (close-port port)
- (apply values vals))))))
-
(define (primitive-load* file)
;; Like 'primitive-load', but in Scheme, so that it does not introduce a
;; continuation barrier that would prevent code in FILE from suspending.
diff --git a/modules/shepherd/system.scm.in b/modules/shepherd/system.scm.in
index 9929f38..ec8f032 100644
--- a/modules/shepherd/system.scm.in
+++ b/modules/shepherd/system.scm.in
@@ -133,7 +133,7 @@ ctrlaltdel(8) and see kernel/reboot.c in Linux."
(sysconf _SC_OPEN_MAX))
(define getpgid
- ;; Guile 3.0.2 and 2.2.7 lack 'getpgid'.
+ ;; Guile 3.0.2 lacks 'getpgid'.
(let ((proc (syscall->procedure int "getpgid" (list int))))
(lambda (pid)
"Return the process group ID for process PID."
@@ -167,9 +167,6 @@ only (by default, Linux binds AF_INET6 addresses on IPv4 as
well)."
(module-define! (current-module) 'variable value)
(module-export! (current-module) '(variable)))))))
-;; Guile 2.2.7 lacks a definition for O_CLOEXEC.
-(define-as-needed O_CLOEXEC @O_CLOEXEC@)
-
(define pipe2
;; Note: Guile 3.0.9 added an optional argument to 'pipe'. Remove this
;; procedure when requiring 3.0.9+.
diff --git a/tests/misbehaved-client.sh b/tests/misbehaved-client.sh
index 3b86360..22ae12c 100644
--- a/tests/misbehaved-client.sh
+++ b/tests/misbehaved-client.sh
@@ -76,13 +76,7 @@ $herd status # still here?
$herd status
-if "$GUILE" -c '(exit (string=? "2" (major-version)))'
-then
- # The 'read' procedure in Guile 2.2 is not suspendable. Thus, the test
- # below would hang forever in 'scm_read'.
- echo "Running on Guile 2.x; skipping test that requires suspendable
'read'." >&2
-else
- "$GUILE" -c "
+"$GUILE" -c "
(use-modules (shepherd comm) (shepherd support) (ice-9 match))
(let ((sock (open-connection \"$socket\")))
@@ -97,7 +91,6 @@ else
(pk 'wrong x)
(exit 1)))))"
- $herd status
-fi
+$herd status
cat "$log"
- [shepherd] branch devel updated (f1b5734 -> 2be2050), Ludovic Courtès, 2024/04/28
- [shepherd] 02/06: guix: Import (gnu services) for ‘modify-services’., Ludovic Courtès, 2024/04/28
- [shepherd] 05/06: logger: Built-in logger recognizes <process> values., Ludovic Courtès, 2024/04/28
- [shepherd] 06/06: service: Remove unused ‘find-service’ procedure., Ludovic Courtès, 2024/04/28
- [shepherd] 01/06: build: Remove support for Guile 2.2.,
Ludovic Courtès <=
- [shepherd] 04/06: service: Add ‘register-service-logger’., Ludovic Courtès, 2024/04/28
- [shepherd] 03/06: service: Move logging code to (shepherd logger)., Ludovic Courtès, 2024/04/28