From 2073e446b7534d92909f27cf4f4101207b9c7a35 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Wed, 9 Jul 2025 12:50:24 +0100 Subject: [PATCH] Tweak the job script Don't use with-fluids (I forget why), and enable core dumps. --- scripts/guix-data-service-process-job.in | 64 +++++++++++++----------- 1 file changed, 36 insertions(+), 28 deletions(-) diff --git a/scripts/guix-data-service-process-job.in b/scripts/guix-data-service-process-job.in index 85e5631..488a0b7 100644 --- a/scripts/guix-data-service-process-job.in +++ b/scripts/guix-data-service-process-job.in @@ -96,31 +96,39 @@ (let ((opts (parse-options (cdr (program-arguments))))) (match (assq-ref opts 'arguments) ((job) - (with-fluids ((%file-port-name-canonicalization 'none)) - (run-fibers - (lambda () - (with-exception-handler - (lambda (exn) - ;; Exit if exceptions get this far, as not all fibers are - ;; guaranteed to finish - (primitive-exit 1)) - (lambda () - (process-load-new-guix-revision-job - job - #:skip-system-tests? (assq-ref opts 'skip-system-tests) - #:extra-inferior-environment-variables - (filter-map - (match-lambda - (('inferior-environment-variable key val) - (cons key val)) - (_ #f)) - opts) - #:ignore-systems (assq-ref opts 'ignore-systems) - #:ignore-targets (assq-ref opts 'ignore-targets) - #:inferior-memory-limit (assq-ref opts 'inferior-memory-limit) - #:parallelism (assq-ref opts 'parallelism))) - #:unwind? #t)) - #:hz 0 - #:parallelism 1 - ;; Drain to make sure there are no bugs with the use of fibers - #:drain? #t))))) + (with-exception-handler + (lambda (exn) + (simple-format #t "failed enabling core dumps: ~A\n" exn)) + (lambda () + (setrlimit 'core #f #f)) + #:unwind? #t) + + (fluid-set! %file-port-name-canonicalization 'none) + + (run-fibers + (lambda () + (with-exception-handler + (lambda (exn) + ;; Exit if exceptions get this far, as not all fibers are + ;; guaranteed to finish + (primitive-exit 1)) + (lambda () + (process-load-new-guix-revision-job + job + #:skip-system-tests? (assq-ref opts 'skip-system-tests) + #:extra-inferior-environment-variables + (filter-map + (match-lambda + (('inferior-environment-variable key val) + (cons key val)) + (_ #f)) + opts) + #:ignore-systems (assq-ref opts 'ignore-systems) + #:ignore-targets (assq-ref opts 'ignore-targets) + #:inferior-memory-limit (assq-ref opts 'inferior-memory-limit) + #:parallelism (assq-ref opts 'parallelism))) + #:unwind? #t)) + #:hz 0 + #:parallelism 1 + ;; Drain to make sure there are no bugs with the use of fibers + #:drain? #t))))