From: Mathieu Othacehe <othacehe@gnu.org>
To: 58733@debbugs.gnu.org
Subject: bug#58733: installer: coredump generation
Date: Mon, 31 Oct 2022 16:51:00 +0100 [thread overview]
Message-ID: <87o7tsm1p7.fsf@gnu.org> (raw)
In-Reply-To: <87v8o0m809.fsf@gnu.org> (Mathieu Othacehe's message of "Mon, 31 Oct 2022 14:34:46 +0100")
[-- Attachment #1: Type: text/plain, Size: 222 bytes --]
> Here is an attached patch implementing the proposed mechanism.
I also prepared the attached patch as a follow-up. The idea is to hide
the backtrace page when the user chooses to "Report the failure".
Thanks,
Mathieu
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-installer-Skip-the-backtrace-page-on-user-abort.patch --]
[-- Type: text/x-patch, Size: 4273 bytes --]
From d3f2ce83152a8ea453b407652dbee7b86a64816b Mon Sep 17 00:00:00 2001
From: Mathieu Othacehe <othacehe@gnu.org>
Date: Mon, 31 Oct 2022 16:43:09 +0100
Subject: [PATCH 1/1] installer: Skip the backtrace page on user abort.
When the user aborts the installation because a core dump is discovered or the
installation command failed, displaying the abort backtrace doesn't make much
sense. Hide it when the abort condition is &user-abort-error and skip directly
to the dump page.
* gnu/installer/steps.scm (&user-abort-error): New variable.
(user-abort-error?): New procedure.
* gnu/installer/newt/final.scm (run-install-failed-page): Raise a
user-abort-error.
* gnu/installer/newt/welcome.scm (run-welcome-page): Ditto.
* gnu/installer.scm (installer-program): Hide the backtrace page and directly
propose to dump the report when the a &user-abort-error is raised.
---
gnu/installer.scm | 18 ++++++++++++++----
gnu/installer/newt/final.scm | 5 ++---
gnu/installer/newt/welcome.scm | 3 +--
gnu/installer/steps.scm | 8 +++++++-
4 files changed, 24 insertions(+), 10 deletions(-)
diff --git a/gnu/installer.scm b/gnu/installer.scm
index 52c595b5b7..5cd1af8edf 100644
--- a/gnu/installer.scm
+++ b/gnu/installer.scm
@@ -453,11 +453,21 @@ (define results
key args)
(define dump-dir
(prepare-dump key args #:result %current-result))
+
+ (define user-abort?
+ (match args
+ (((? user-abort-error? obj)) #t)
+ (_ #f)))
+
(define action
- ((installer-exit-error current-installer)
- (get-string-all
- (open-input-file
- (string-append dump-dir "/installer-backtrace")))))
+ (if user-abort?
+ 'dump
+ ((installer-exit-error current-installer)
+ (get-string-all
+ (open-input-file
+ (string-append dump-dir
+ "/installer-backtrace"))))))
+
(match action
('dump
(let* ((dump-files
diff --git a/gnu/installer/newt/final.scm b/gnu/installer/newt/final.scm
index 6e55be5067..9f950a0551 100644
--- a/gnu/installer/newt/final.scm
+++ b/gnu/installer/newt/final.scm
@@ -92,9 +92,8 @@ (define (run-install-failed-page)
;; Keep going, the installer will be restarted later on.
#t)
(3 (raise
- (condition
- (&message
- (message "User abort.")))))))
+ (condition
+ (&user-abort-error))))))
(_
(send-to-clients '(installation-failure))
#t)))
diff --git a/gnu/installer/newt/welcome.scm b/gnu/installer/newt/welcome.scm
index 5d47591d67..326996b005 100644
--- a/gnu/installer/newt/welcome.scm
+++ b/gnu/installer/newt/welcome.scm
@@ -145,8 +145,7 @@ (define (run-welcome-page logo)
(1 #t)
(2 (raise
(condition
- (&message
- (message "User abort.")))))))
+ (&user-abort-error))))))
(run-menu-page
(G_ "GNU Guix install")
(G_ "Welcome to GNU Guix system installer!
diff --git a/gnu/installer/steps.scm b/gnu/installer/steps.scm
index 8b25ae97c8..0c505e40e4 100644
--- a/gnu/installer/steps.scm
+++ b/gnu/installer/steps.scm
@@ -28,7 +28,10 @@ (define-module (gnu installer steps)
#:use-module (srfi srfi-34)
#:use-module (srfi srfi-35)
#:use-module (rnrs io ports)
- #:export (<installer-step>
+ #:export (&user-abort-error
+ user-abort-error?
+
+ <installer-step>
installer-step
make-installer-step
installer-step?
@@ -50,6 +53,9 @@ (define-module (gnu installer steps)
%current-result))
+(define-condition-type &user-abort-error &error
+ user-abort-error?)
+
;; Hash table storing the step results. Use it only for logging and debug
;; purposes.
(define %current-result (make-hash-table))
--
2.38.0
next prev parent reply other threads:[~2022-10-31 15:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-23 9:29 bug#58733: installer: coredump generation Mathieu Othacehe
2022-10-31 13:34 ` Mathieu Othacehe
2022-10-31 15:51 ` Mathieu Othacehe [this message]
2022-11-02 10:34 ` Ludovic Courtès
2022-11-02 16:58 ` Mathieu Othacehe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87o7tsm1p7.fsf@gnu.org \
--to=othacehe@gnu.org \
--cc=58733@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).