Lose hope of running against guile 2.2 or earlier.

We have previously allowed versions 2.0 and 2.2 to get past the configure
stage, but all versions of guile before 3.0 have in fact failed to compile the
code due to syntax errors for some time now.

* build-aux/guix.scm:  package depends on guile@3
* configure.ac:  only look for guile version 3
* src/mcron/base.scm:  drop allowance for old-fashioned (version 2.0) select
This commit is contained in:
Dale Mellor 2022-07-07 12:05:56 +01:00
commit 19ba0a82d2
Signed by: khleedril
GPG key ID: CA471FD501618A49
3 changed files with 14 additions and 28 deletions

View file

@ -45,7 +45,7 @@
(source (local-file (dirname %srcdir) #:recursive? #t (source (local-file (dirname %srcdir) #:recursive? #t
#:select? keep-mcron-file?)) #:select? keep-mcron-file?))
(inputs (inputs
`(("guile" ,(specification->package "guile@2.2")))) `(("guile" ,(specification->package "guile@3"))))
(native-inputs (native-inputs
`(("autoconf" ,(specification->package "autoconf")) `(("autoconf" ,(specification->package "autoconf"))
("automake" ,(specification->package "automake")) ("automake" ,(specification->package "automake"))

View file

@ -43,7 +43,7 @@ m4_pattern_allow([^GUILE_PKG])
m4_pattern_allow([^GUILE_PROGS]) m4_pattern_allow([^GUILE_PROGS])
# Check for latest Guile development files. # Check for latest Guile development files.
GUILE_PKG([3.0 2.2 2.0]) GUILE_PKG([3.0])
# Checks for programs. # Checks for programs.
GUILE_PROGS GUILE_PROGS

View file

@ -397,16 +397,16 @@ of CHILDREN-DATA."
(define (match-collected-pid? job-data) (define (match-collected-pid? job-data)
(= (job-data:pid job-data) collected-pid)) (= (job-data:pid job-data) collected-pid))
(if (and has-children? (cond ((and has-children?
(not (= 0 collected-pid))) ;at least one process was collected (not (= 0 collected-pid))) ;at least one process was collected
(begin (update-number-children! 1-)
(update-number-children! 1-) ;; Fully collect the output of the reaped child process.
;; Fully collect the output of the reaped child process. (and=> (find match-collected-pid? children-data)
(and=> (find match-collected-pid? children-data) (lambda (child-data)
(lambda (child-data) (process-output (list child-data))))
(process-output (list child-data)))) (child-cleanup (remove match-collected-pid? children-data)))
(child-cleanup (remove match-collected-pid? children-data))) (else
children-data)) children-data)))
(define* (run-job-loop #:optional (fd-list '()) (define* (run-job-loop #:optional (fd-list '())
#:key (schedule %global-schedule)) #:key (schedule %global-schedule))
@ -423,20 +423,6 @@ infinitum."
;; case we break out of the loop here, and let the main procedure deal with ;; case we break out of the loop here, and let the main procedure deal with
;; the situation (it will eventually re-call this function, thus maintaining ;; the situation (it will eventually re-call this function, thus maintaining
;; the loop). ;; the loop).
(cond-expand
((or guile-3.0 guile-2.2) ;2.2 and 3.0
(define select* select))
(else
;; On Guile 2.0, 'select' could throw upon EINTR or EAGAIN.
(define (select* read write except time)
(catch 'system-error
(lambda ()
(select read write except time))
(lambda args
(if (member (system-error-errno args) (list EAGAIN EINTR))
'(() () ())
(apply throw args)))))))
(let/ec break (let/ec break
(let loop ((children-data '())) ;list of <job-data> objects (let loop ((children-data '())) ;list of <job-data> objects
(match (find-next-jobs #:schedule schedule) (match (find-next-jobs #:schedule schedule)
@ -452,8 +438,8 @@ infinitum."
(port->fdes p))) (port->fdes p)))
ports))) ports)))
(when (> sleep-time 0) (when (> sleep-time 0)
(match (select* (append fd-list children-fdes) (match (select (append fd-list children-fdes)
'() '() sleep-time) '() '() sleep-time)
((() () ()) ((() () ())
;; 'select' returned an empty set, perhaps because it got ;; 'select' returned an empty set, perhaps because it got
;; EINTR or EAGAIN. ;; EINTR or EAGAIN.