From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id CMtZFDLvX2P8wgAAbAwnHQ (envelope-from ) for ; Mon, 31 Oct 2022 16:52:18 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id MFRJFDLvX2PqlQAAauVa8A (envelope-from ) for ; Mon, 31 Oct 2022 16:52:18 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 481081CD58 for ; Mon, 31 Oct 2022 16:52:17 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1opX52-0005af-TY; Mon, 31 Oct 2022 11:52:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opX50-0005Vw-UN for bug-guix@gnu.org; Mon, 31 Oct 2022 11:52:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1opX50-0007gk-My for bug-guix@gnu.org; Mon, 31 Oct 2022 11:52:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1opX50-00084R-IF for bug-guix@gnu.org; Mon, 31 Oct 2022 11:52:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#58733: installer: coredump generation Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 31 Oct 2022 15:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58733 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 58733@debbugs.gnu.org Received: via spool by 58733-submit@debbugs.gnu.org id=B58733.166723147830972 (code B ref 58733); Mon, 31 Oct 2022 15:52:02 +0000 Received: (at 58733) by debbugs.gnu.org; 31 Oct 2022 15:51:18 +0000 Received: from localhost ([127.0.0.1]:41592 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1opX4H-00083U-My for submit@debbugs.gnu.org; Mon, 31 Oct 2022 11:51:18 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33274) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1opX4F-00083F-Qb for 58733@debbugs.gnu.org; Mon, 31 Oct 2022 11:51:17 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opX46-0007YC-RO for 58733@debbugs.gnu.org; Mon, 31 Oct 2022 11:51:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=FnQvfetsx9wpUF76abYUSz/R18dzA5N/I9ao7IjX3k0=; b=g0p1tHZoKZSaHbxlSTcJ Je/V/bQoyg2iPHUbe4Me4KnW9EhNSy9K2M/+ClV3C0gwDg5uTx2rnZXKScOfMJ+UGTm1Q+KRnFssS 7bUi/eoZOQVvYBRmVTIZ7wJUoim+iGfH7Aw8vHKuBjggw+kB2/9/31v5Z3JlIE3CfTsc1sYQWPgKI sTrA/N4mXvXah16+HCm4xirC7OJPe4ytO425QaJ0KGOGu6o76rKKWW2GmS4dhI8AenHvCi30XfhDG +6zfwt+aqqeSftGQNxhU02fY8sBgefa9fbFdVwsBddpQFuvOm2QBc4fcSWn6WxNbjmEvhuDbm8UoN nnqGtg1Ns6YSbA==; Received: from 2a02-8429-81d2-3d01-94c9-8097-ea5c-2775.rev.sfr.net ([2a02:8429:81d2:3d01:94c9:8097:ea5c:2775] helo=meije) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opX42-0007yd-KO for 58733@debbugs.gnu.org; Mon, 31 Oct 2022 11:51:06 -0400 From: Mathieu Othacehe References: <87o7u228hq.fsf@gnu.org> <87v8o0m809.fsf@gnu.org> Date: Mon, 31 Oct 2022 16:51:00 +0100 In-Reply-To: <87v8o0m809.fsf@gnu.org> (Mathieu Othacehe's message of "Mon, 31 Oct 2022 14:34:46 +0100") Message-ID: <87o7tsm1p7.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "bug-Guix" Errors-To: bug-guix-bounces+larch=yhetil.org+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1667231538; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=FnQvfetsx9wpUF76abYUSz/R18dzA5N/I9ao7IjX3k0=; b=Vuq5t9UFzLlwDbrM5qJFIb4vYRyjoLU29LXuJV+7dXv09gqoNSJV2/LGOUwRGteYdkzTEa gj/nCBupXb/kERehIo4XSQc3TLQTsqyv7vbTH4QvAKHvM1FsawZqEroJEfh61P9jXLLt/u xuZq8uecnh8ikWQ/OV1fbt7YqlAZ/gDSEjmqCobhn6XAAtv0AYtlPODEOv9vyw0uq/tU+o 0WV/T+KS1Sn44/8iORQneIUUEkZZeQt6StSkChk1ERxvHILRil/fIqMtfK9DhleGxjFlD0 NGijP4I72OeIR4vDbJe5mSGZB6yjMuhlIMrD9EGT4M/SSeVMzBhLsLKWmR8vjQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1667231538; a=rsa-sha256; cv=none; b=vAOz1mzBsMXiELDH1+41z6dPEzPXFHLf/NDHxrmzSWzXmnBBdocMbAejDVmxLxzqGvZF47 p30Z4pGqs2TOGg5vvsXpnPpkhD9mipu3JPoTWS31qg5cySuk8640OgrgzQ3DFt3UjJEAnV bsa3CICZGvuECifp7cDdUNBButtBMdvtdC4oYv1+b76MmxltxEtflQj+2YNIiMpCMzNh85 KuwaUCMQAJCL2Bf2N1cRakWeTDLdRSaP5NqQx9cjocuk6+7AlrNxYghgbvMRd52sSQAFJn t8MawKRvSC8pKBncX28rrryD46GUSVvdEeFsSkHh298MwimGvexY9PfgguDjCg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=g0p1tHZo; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.87 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=g0p1tHZo; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 481081CD58 X-Spam-Score: -3.87 X-Migadu-Scanner: scn1.migadu.com X-TUID: S9FUQocuaru5 --=-=-= Content-Type: text/plain > 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 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-installer-Skip-the-backtrace-page-on-user-abort.patch >From d3f2ce83152a8ea453b407652dbee7b86a64816b Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe 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 ( + #:export (&user-abort-error + user-abort-error? + + 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 --=-=-=--