From patchwork Wed Mar 1 06:43:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Efraim Flashner X-Patchwork-Id: 47498 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id D4C7A16CBF; Wed, 1 Mar 2023 06:44:32 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 7D26216C75 for ; Wed, 1 Mar 2023 06:44:30 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pXGCG-0004C1-Dc; Wed, 01 Mar 2023 01:44:16 -0500 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 1pXGC2-0003pq-Ox for guix-patches@gnu.org; Wed, 01 Mar 2023 01:44:07 -0500 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 1pXGC2-0008Qp-DV for guix-patches@gnu.org; Wed, 01 Mar 2023 01:44:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pXGC2-00063T-1O for guix-patches@gnu.org; Wed, 01 Mar 2023 01:44:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#61486] [PATCH] system: Update skeleton gdbinit. Resent-From: Efraim Flashner Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 01 Mar 2023 06:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61486 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?utf-8?q?Court=C3=A8s?= Cc: 61486@debbugs.gnu.org Received: via spool by 61486-submit@debbugs.gnu.org id=B61486.167765300023206 (code B ref 61486); Wed, 01 Mar 2023 06:44:01 +0000 Received: (at 61486) by debbugs.gnu.org; 1 Mar 2023 06:43:20 +0000 Received: from localhost ([127.0.0.1]:52439 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pXGBL-00062E-TK for submit@debbugs.gnu.org; Wed, 01 Mar 2023 01:43:20 -0500 Received: from mail-wr1-f48.google.com ([209.85.221.48]:35799) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pXGBJ-00061y-Qi for 61486@debbugs.gnu.org; Wed, 01 Mar 2023 01:43:18 -0500 Received: by mail-wr1-f48.google.com with SMTP id q16so12124666wrw.2 for <61486@debbugs.gnu.org>; Tue, 28 Feb 2023 22:43:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:sender:from:to :cc:subject:date:message-id:reply-to; bh=yxLEmaI2X1B44U9EeHMtIjfEs0/KgnWPB46naok/CoM=; b=GxgH/EkvQOlOtP6FykJEApq/Tiz8sbOQIM5mywF2GXvqxHZ48Khwsj78aIvbgpA05/ TWJh1xqdZ4DEkpT0/LAWfQxd8l33LZM2qGjdd8cUUhem+qV801Ak6H4w0FWz+r0obtrp /5BbmDfbBklWfwoueqfXEAOHfUe47x5bo1jdkLuqS9Cl1ldOazDv6GOetwsGglhPsR6N 1IP4hmugZ1dLNjXwlg32p1kRlL65wQwa1cKYYww8ismZ2EH6maP1y5QqUoW+iX2VSLgL XaUinJkW56KPMYWd88TCFeYVojNsM2QD0txqgOY0Z7JjXHgCnyRctmSU8oNMnXMVA8nT LEJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:sender :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=yxLEmaI2X1B44U9EeHMtIjfEs0/KgnWPB46naok/CoM=; b=lrs1Fqo1OYPif3l4AiKzAQRTZWK/cIAjERXbY/8cpyojiHyimEw3Vd+NUmNXUVlTX1 DsMo6fsaFqDCuHhWuhTf6kfIXdYqUMImhm/ZQs0MnV9M8dzqZHpvG8OB2N9PyqUtKwgE LVbymjM6X10JsizM9/xjAEmYpYZKzxdU77ogim7h84aEJaSZOLeXD4AEkLE7PvlQattv JJTnsLGho65+pLTsJo/l0tNlOyFw2LH2n5nUEjPtNv9Gq/CBzwItxLYBpe4E+RpsN+EH 0u76wBnWzIxSAjlcjaEHHTG1NOL4tZZOyCPnIpckDx4jNjo90zsyF6tzvKIShbjPWA6r zeXQ== X-Gm-Message-State: AO0yUKWLY0Ycl/Ao/gCz2yLBfFr+44L13a3W+R9dl7Nj+9gZzYfciReI GOmueAy2PbsfiAxRbtToGJA= X-Google-Smtp-Source: AK7set9HWCkmMUt2UZlKb//7mrQhY4/AyIqY9rh9z5a8Ev4LFQuOzxSIJLWqT246ZRyAAzmw4rFzQA== X-Received: by 2002:a05:6000:1243:b0:2c7:169b:c56d with SMTP id j3-20020a056000124300b002c7169bc56dmr3681235wrx.17.1677652991619; Tue, 28 Feb 2023 22:43:11 -0800 (PST) Received: from localhost ([2a02:ed3:910:9200:b62e:99ff:fef0:7bc0]) by smtp.gmail.com with ESMTPSA id m7-20020adfe947000000b002c70f5627d5sm11509851wrn.63.2023.02.28.22.43.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 22:43:10 -0800 (PST) Date: Wed, 1 Mar 2023 08:43:09 +0200 From: Efraim Flashner Message-ID: Mail-Followup-To: Efraim Flashner , Ludovic =?utf-8?q?Court=C3=A8s?= , 61486@debbugs.gnu.org References: <08c09168cea2ab383bb6664682d3e8c52f70f131.1676314760.git.efraim@flashner.co.il> <87o7peg2kg.fsf@gnu.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <87o7peg2kg.fsf@gnu.org> X-PGP-Key-ID: 0x41AAE7DCCA3D8351 X-PGP-Key: https://flashner.co.il/~efraim/efraim_flashner.asc X-PGP-Fingerprint: A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches On Mon, Feb 27, 2023 at 11:34:39PM +0100, Ludovic Courtès wrote: > Hi Efraim, > > Efraim Flashner skribis: > > > * gnu/system/shadow.scm (default-skeleton): Update gdbinit to also > > search for debug packages in guix-home. > > (skeleton-directory): Move .gdbinit to .config/gdb/gdbinit. > > [...] > > > (use-modules (gdb)) > > (execute (string-append \"set debug-file-directory \" > > (or (getenv \"GDB_DEBUG_FILE_DIRECTORY\") > > - \"~/.guix-profile/lib/debug\"))) > > + \"~/.guix-profile/lib/debug\" > > + \"~/.guix-home/profile/lib/debug\"))) > > This won’t have the desired effect: > > --8<---------------cut here---------------start------------->8--- > scheme@(guile-user)> (or #f "a" "b") > $10 = "a" > --8<---------------cut here---------------end--------------->8--- > > Perhaps we should check with ‘file-exists?’ which one to pick, probably > giving higher precedence to ~/.guix-home/profile since Guix Home users > might have both (I do). > > > + (when (file-exists? ".gdbinit") > > + (mkdir-p ".config/gdb") > > + (rename-file ".gdbinit" ".config/gdb/gdbinit")) > > I couldn’t believe it so I had to check the manual and yes, GDB does > look for ~/.config/gdb/gdbinit! Incredible. Now with a new and improved version 2! diff --git a/gnu/system/shadow.scm b/gnu/system/shadow.scm index 445a72e2f5..2bd72d3e96 100644 --- a/gnu/system/shadow.scm +++ b/gnu/system/shadow.scm @@ -2,7 +2,7 @@ ;;; Copyright © 2013-2020, 2022 Ludovic Courtès ;;; Copyright © 2016 Alex Griffin ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen -;;; Copyright © 2020 Efraim Flashner +;;; Copyright © 2020, 2023 Efraim Flashner ;;; Copyright © 2020 Maxim Cournoyer ;;; ;;; This file is part of GNU Guix. @@ -168,8 +168,16 @@ (define (default-skeletons) guile (use-modules (gdb)) (execute (string-append \"set debug-file-directory \" - (or (getenv \"GDB_DEBUG_FILE_DIRECTORY\") - \"~/.guix-profile/lib/debug\"))) + (string-join + (filter file-exists? + (append + (if (getenv \"GDB_DEBUG_FILE_DIRECTORY\") + (list (getenv \"GDB_DEBUG_FILE_DIRECTORY\")) + '()) + (list \"~/.guix-home/profile/lib/debug\" + \"~/.guix-profile/lib/debug\" + \"/run/current-system/profile/lib/debug\"))) + \":\"))) end # Authorize extensions found in the store, such as the @@ -228,6 +236,9 @@ (define (skeleton-directory skeletons) (when (file-exists? ".nanorc") (mkdir-p ".config/nano") (rename-file ".nanorc" ".config/nano/nanorc")) + (when (file-exists? ".gdbinit") + (mkdir-p ".config/gdb") + (rename-file ".gdbinit" ".config/gdb/gdbinit")) #t)))) (define (find-duplicates list)