diff options
author | Christopher Baines <mail@cbaines.net> | 2019-06-13 23:13:34 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2019-06-13 23:13:34 +0100 |
commit | 0bd1fc7e87a3f6702f4c1fd97a23d3b13be94efc (patch) | |
tree | 6953cd2449e401ac2a588a11e939a4f7504fa94a /guix-data-service/jobs | |
parent | 11144a5fe92dadfd1f60a7bd9ada2669cffc1e13 (diff) | |
download | data-service-0bd1fc7e87a3f6702f4c1fd97a23d3b13be94efc.tar data-service-0bd1fc7e87a3f6702f4c1fd97a23d3b13be94efc.tar.gz |
Display a backtrace for errors in channel->derivation-file-name
To help with debugging.
Diffstat (limited to 'guix-data-service/jobs')
-rw-r--r-- | guix-data-service/jobs/load-new-guix-revision.scm | 109 |
1 files changed, 56 insertions, 53 deletions
diff --git a/guix-data-service/jobs/load-new-guix-revision.scm b/guix-data-service/jobs/load-new-guix-revision.scm index 5ce8c4c..b9175de 100644 --- a/guix-data-service/jobs/load-new-guix-revision.scm +++ b/guix-data-service/jobs/load-new-guix-revision.scm @@ -293,61 +293,64 @@ (catch #t (lambda () - ;; /etc is only missing if open-inferior/container has been used - (when use-container? - (inferior-eval - '(begin - ;; Create /etc/pass, as %known-shorthand-profiles in (guix - ;; profiles) tries to read from this file. Because the environment - ;; is cleaned in build-self.scm, xdg-directory in (guix utils) - ;; falls back to accessing /etc/passwd. - (mkdir "/etc") - (call-with-output-file "/etc/passwd" - (lambda (port) - (display "root:x:0:0::/root:/bin/bash" port)))) - inferior)) - - (let ((channel-instance - (first - (latest-channel-instances store - (list channel))))) - (inferior-eval '(use-modules (guix channels) - (guix profiles)) - inferior) - (inferior-eval '(define channel-instance - (@@ (guix channels) channel-instance)) - inferior) - - (let ((file-name - (inferior-eval-with-store - inferior - store - `(lambda (store) - (let ((instances - (list - (channel-instance - (channel (name ',(channel-name channel)) - (url ,(channel-url channel)) - (branch ,(channel-branch channel)) - (commit ,(channel-commit channel))) - ,(channel-instance-commit channel-instance) - ,(channel-instance-checkout channel-instance))))) - (run-with-store store - (mlet* %store-monad ((manifest (channel-instances->manifest instances)) - (derv (profile-derivation manifest))) - (mbegin %store-monad - (return (derivation-file-name derv)))))))))) - - (close-inferior inferior) - - file-name))) + (with-throw-handler #t + (lambda () + ;; /etc is only missing if open-inferior/container has been used + (when use-container? + (inferior-eval + '(begin + ;; Create /etc/pass, as %known-shorthand-profiles in (guix + ;; profiles) tries to read from this file. Because the environment + ;; is cleaned in build-self.scm, xdg-directory in (guix utils) + ;; falls back to accessing /etc/passwd. + (mkdir "/etc") + (call-with-output-file "/etc/passwd" + (lambda (port) + (display "root:x:0:0::/root:/bin/bash" port)))) + inferior)) + + (let ((channel-instance + (first + (latest-channel-instances store + (list channel))))) + (inferior-eval '(use-modules (guix channels) + (guix profiles)) + inferior) + (inferior-eval '(define channel-instance + (@@ (guix channels) channel-instance)) + inferior) + + (let ((file-name + (inferior-eval-with-store + inferior + store + `(lambda (store) + (let ((instances + (list + (channel-instance + (channel (name ',(channel-name channel)) + (url ,(channel-url channel)) + (branch ,(channel-branch channel)) + (commit ,(channel-commit channel))) + ,(channel-instance-commit channel-instance) + ,(channel-instance-checkout channel-instance))))) + (run-with-store store + (mlet* %store-monad ((manifest (channel-instances->manifest instances)) + (derv (profile-derivation manifest))) + (mbegin %store-monad + (return (derivation-file-name derv)))))))))) + + (close-inferior inferior) + + file-name))) + (lambda (key . parameters) + (display (backtrace) (current-error-port)) + (display "\n" (current-error-port)) + (simple-format (current-error-port) + "error: channel->derivation-file-name: ~A: ~A\n" + key parameters)))) (lambda args - (simple-format (current-error-port) - "error: channel->derivation-file-name: ~A\n" - args) - (close-inferior inferior) - #f)))) (define (channel->manifest-store-item store channel) |