From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id oHk6JGukql/IOQAA0tVLHw (envelope-from ) for ; Tue, 10 Nov 2020 14:32:11 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id OIPyH2ukql/eFwAAbx9fmQ (envelope-from ) for ; Tue, 10 Nov 2020 14:32:11 +0000 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 E4B5F9403E6 for ; Tue, 10 Nov 2020 14:32:10 +0000 (UTC) Received: from localhost ([::1]:60882 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kcUgr-00076n-SX for larch@yhetil.org; Tue, 10 Nov 2020 09:32:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36738) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kcUgk-00076d-BF for bug-guix@gnu.org; Tue, 10 Nov 2020 09:32:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:53574) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kcUgk-0006Hu-1a for bug-guix@gnu.org; Tue, 10 Nov 2020 09:32:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kcUgj-00041p-Ue for bug-guix@gnu.org; Tue, 10 Nov 2020 09:32:01 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#43893: [PATCH v3] maint: update-guix-package: Prevent accidentally breaking guix pull. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Tue, 10 Nov 2020 14:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43893 X-GNU-PR-Package: guix X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 43893-submit@debbugs.gnu.org id=B43893.160501868615425 (code B ref 43893); Tue, 10 Nov 2020 14:32:01 +0000 Received: (at 43893) by debbugs.gnu.org; 10 Nov 2020 14:31:26 +0000 Received: from localhost ([127.0.0.1]:36887 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kcUg9-00040i-Vp for submit@debbugs.gnu.org; Tue, 10 Nov 2020 09:31:26 -0500 Received: from mail-qk1-f196.google.com ([209.85.222.196]:41382) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kcUg8-00040R-W6 for 43893@debbugs.gnu.org; Tue, 10 Nov 2020 09:31:25 -0500 Received: by mail-qk1-f196.google.com with SMTP id d9so4480647qke.8 for <43893@debbugs.gnu.org>; Tue, 10 Nov 2020 06:31:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=I3590CZoPwi/rr1FZizvdWpAKdPZIOtZ1M/KBsBZ20I=; b=Qir6MzYoAC46V4iG0fW0tv7dIuTZH3pbFQUE6LPs1NjuZliz9FVCKIn2wdFl8jma7N +MUrsExjTjhXT2cqYDQbKhB9yome3efeQQSF2AB/TptZQhllnNkX4EVJfuFl5vjJE9HF vg9Gad4xtT2nRu/UjKrQOe/yepGAgIRVri3WwODsdhV0xaArmUe6143C6ECGP9kcx/Zi nnZsD1KT5uybrY6Oz9Kd6OFOXWROOP87C9y13kGi7ZNoK5Z/BfWXx63FfX8cjhoCK33T Vcj6Ab5PFQpxVKSKm1Ka7DOXm2kf+uurIro+yb925+SIhW7CmAdc+KWpYXUuu65vRGTL f2tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=I3590CZoPwi/rr1FZizvdWpAKdPZIOtZ1M/KBsBZ20I=; b=D2IzbneqRvXwgx6gKdRtuvj4u0tgg9m4iRyS06o3bCfdtHBCj/f8Kq2fSlBDJEVcOX 2ajTIS2QouXf3SunlVl800KI6zQl0Y4xAc5Ikay2Y4iCJsDdyKcfNCMmPbwTLvf+JpCq JCAkYq48HwH/JgaoJqqMHUDl2DciyzAxkMU1ObNluP+1DgCuP1QVQNLAJi84UlKRHJja NQitq34aAiQY8hCYQe6G3pvxi6cbXfLji5Nc8Uql5DJZ3V2mhrCWptQ8F5FddlKEYvR/ 0W8RJX8cSdguskwQMfCBhexN8o2FM84sv1WOX0lvm+nLpbwvgxQMZrTOQthH4atMe2om Ngzw== X-Gm-Message-State: AOAM530SXEtDbKc+7TchtVmrlDyOLhpCfvROpxLi2eV3wSQgklOYqCPv NIVwBV8qJ7AHxW/VibJedATNf6R0jYY= X-Google-Smtp-Source: ABdhPJwgL934RAOh/GkD9bh+e+gMPZ3e+OWYZGTsiqvAU7CLXAOAjAjfrcLqEtJudGU4flZ1HbW2gQ== X-Received: by 2002:a37:887:: with SMTP id 129mr10358790qki.499.1605018678912; Tue, 10 Nov 2020 06:31:18 -0800 (PST) Received: from hurd (dsl-10-133-153.b2b2c.ca. [72.10.133.153]) by smtp.gmail.com with ESMTPSA id f56sm6328821qta.49.2020.11.10.06.31.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Nov 2020 06:31:18 -0800 (PST) From: Maxim Cournoyer References: <87imbedsko.fsf@gnu.org> <20201014031705.4516-1-maxim.cournoyer@gmail.com> <87lfg0bo9m.fsf@gnu.org> <87v9f44852.fsf@gmail.com> <875z749czt.fsf@gnu.org> <87eelpd0af.fsf@gmail.com> <87k0vhm1fg.fsf@gnu.org> <87d0172adj.fsf@gmail.com> <87k0vefjgv.fsf@gnu.org> <874kmifhn2.fsf@gnu.org> <87d00zyrom.fsf@gmail.com> <871rhevfpp.fsf@gnu.org> <877dquib3z.fsf@gmail.com> <878sbarxvq.fsf@gnu.org> Date: Tue, 10 Nov 2020 09:31:17 -0500 In-Reply-To: <878sbarxvq.fsf@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Mon, 09 Nov 2020 23:03:37 +0100") Message-ID: <87v9edgu6i.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.0 (-) X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 43893@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Scanner: ns3122888.ip-94-23-21.eu Authentication-Results: aspmx1.migadu.com; dkim=fail (headers rsa verify failed) header.d=gmail.com header.s=20161025 header.b=Qir6MzYo; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Spam-Score: 0.09 X-TUID: ZqzLMC8mHBM4 Hey, Ludovic Court=C3=A8s writes: > Hi! > > Maxim Cournoyer skribis: > >>> Maxim Cournoyer skribis: >>> >>>>> +(define (assert-clean-checkout repository) >>>>> + "Error out if the working directory at REPOSITORY contains local >>>>> +modifications." >>>>> + (define description >>>>> + (let ((format-options (make-describe-format-options >>>>> + #:dirty-suffix "-dirty"))) >>>>> + (describe-format (describe-workdir repository) format-options)= )) >>>>> + >>>>> + (when (string-suffix? "-dirty" description) >>>>> + (leave (G_ "attempt to update 'guix' package from a dirty tree (= ~a)~%") >>>>> + description)) >>>>> + >>>>> + (info (G_ "updating 'guix' package to '~a'~%") description)) >>>> >>>> Unfortunately this doesn't catch the case where git has explicitly been >>>> told to '--skip-worktree' on a path or file (the original cause of this >>>> bug report). See >>>> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D43893#11. >>> >>> Any such issue is caught when one eventually runs =E2=80=98guix build g= uix=E2=80=99 >>> (wrong commit ID, wrong hash, etc.). >>> >>> But you=E2=80=99re right that the above test isn=E2=80=99t fool-proof: = it=E2=80=99s just a way >>> to catch this common mistake early and report it nicely. >> >> Right. I still don't like that it wouldn't work from a checkout where >> someone would have modified, e.g., the .dir-locals file locally and >> marked it with 'git --skip-worktree'. Having to revert this kind of >> 'developer setup' is painful. The current approach makes it unnecessary >> (only committed changes are taken into account, not just git tracked >> files). > > =E2=80=9CWouldn=E2=80=99t work=E2=80=9D is a strong statement: like I wro= te, mistakes would > always be caught when you try to build =E2=80=98guix=E2=80=99, as with an= y other package > (we don=E2=80=99t have special support for other packages, why would this= one > have to be different?). True. I meant it in the sense "I wouldn't be able to update the Guix package before manually ensuring that the HEAD of my tree was in a pristine condition, that is, equivalent to the last commit". Since Guix is the focus of Guix developers, it's much more likely to have its sources in flux compared to the other packages we update in Guix. To me it seems useful to automate the 'cleanliness' part of the tree rather than force it on developers, since it can be. We also don't update the package in place from a Git checkout when updating other packages. It's a manual work of 'git clone', 'guix hash -rx' and editing the source manually, which is different from 'make update-guix-package', which strives to automate the process. My 2 cents! Time will tell if this is a viable route. If it breaks every time we use it, we can fallback to the simpler scheme. Maxim