From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id +JgcG84pBWDZVgAA0tVLHw (envelope-from ) for ; Mon, 18 Jan 2021 06:25:18 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id kJvqFs4pBWCBLwAA1q6Kng (envelope-from ) for ; Mon, 18 Jan 2021 06:25:18 +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 B53EC940341 for ; Mon, 18 Jan 2021 06:25:17 +0000 (UTC) Received: from localhost ([::1]:52528 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l1NyW-0006Zk-Cu for larch@yhetil.org; Mon, 18 Jan 2021 01:25:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59548) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1NyJ-0006ZR-Nk for guix-patches@gnu.org; Mon, 18 Jan 2021 01:25:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:34592) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l1NyI-0000lB-4V for guix-patches@gnu.org; Mon, 18 Jan 2021 01:25:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l1NyI-0003qQ-1B for guix-patches@gnu.org; Mon, 18 Jan 2021 01:25:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#45891] [PATCH] packages: 'patch-and-repack' returns a directory when given a directory. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 18 Jan 2021 06:25:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45891 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 45891-submit@debbugs.gnu.org id=B45891.161095105414720 (code B ref 45891); Mon, 18 Jan 2021 06:25:01 +0000 Received: (at 45891) by debbugs.gnu.org; 18 Jan 2021 06:24:14 +0000 Received: from localhost ([127.0.0.1]:46138 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l1NxU-0003pL-Oa for submit@debbugs.gnu.org; Mon, 18 Jan 2021 01:24:13 -0500 Received: from mail-qt1-f182.google.com ([209.85.160.182]:45974) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l1NxT-0003p8-0y for 45891@debbugs.gnu.org; Mon, 18 Jan 2021 01:24:11 -0500 Received: by mail-qt1-f182.google.com with SMTP id d15so5155549qtw.12 for <45891@debbugs.gnu.org>; Sun, 17 Jan 2021 22:24:11 -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=wIXlcT90EziNuBfKN97sj7RL4V+R7+fNXoP8gQ/9tIY=; b=sgaDGYi8QrsCbDdv9YpWBPwwIUTJTt6OxhGM7wYBxQRuBvGKfzGV3kPjlbmO7Tzdhp 6fAxsMpwaRmVTigSmp/kIWprpd3tnJB7OKyqmMYr8sfgBV49inc4/305YQE6wvCTdith 6o/86kVCMJit3GNo6ZL0sSETDWGRWZx9R4jNPSRlP1Nj15uj46c2Mzzte8yXrWJF4MnL THI/Ign1WxyiPHyFrhdD/PjWYLSV9lBPSno7e9xRl/b3zjLscmfPeO9LNLmgyjQuILwA PSQS8MLAQRuFTqQBnr2Ro99WRSifwNt9Ml1fr7qzMxbj0rGj3IWFyqTeRL/fVsZpBEtj kTBg== 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=wIXlcT90EziNuBfKN97sj7RL4V+R7+fNXoP8gQ/9tIY=; b=DbCFX6hzaIL1pvY7RmWtoOxruJ0xAFeFOA7IoKOe6+cyFDSK5i/LGCCraAIsj0925b gb3mV98mrQn+MfcZ75TKGrngX9DewUG7aKsNmCrL6/H/8zPT9pxmNokVfQW/rc7RUQsg 87r7614gAypcaFfjJgRMJXl8sT0CQNG2vE6iO6Zhs5qSQTZEqaQYRsxDv1ybqbm4p+/z 2cPqEcx/qykBpZtlIAgeyKxAPV++Dcvl+h3ZgIpHYmVxRMBzuR4CmHBgkAbd1H8TS9Fl ZciutmL1Xdn0OILVCltlnuos26FKOMF0/DYEOUkZv5wEpfAjMsakaQh7boU9uoXAcmr1 levw== X-Gm-Message-State: AOAM533MQhOCe9wqxwFDj7fSABlynX1kWUOjrx5fQhXG9pQI0BGQkDd1 kNvJAdGeOsU079fyf99M+zaFwE8ZPsE= X-Google-Smtp-Source: ABdhPJyeFiin4n1eYfcI7Zneeroo61Cg06WBa9m9ta/6FPFyCJyPnYdLK0tSh3IudCohclDaQihh7w== X-Received: by 2002:ac8:6c50:: with SMTP id z16mr3459234qtu.112.1610951043774; Sun, 17 Jan 2021 22:24:03 -0800 (PST) Received: from hurd (dsl-149-228.b2b2c.ca. [66.158.149.228]) by smtp.gmail.com with ESMTPSA id 70sm10192162qkk.10.2021.01.17.22.24.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Jan 2021 22:24:03 -0800 (PST) From: Maxim Cournoyer References: <20210115131548.8792-1-ludo@gnu.org> <878s8tluev.fsf@gmail.com> <87lfcsy3jd.fsf@gnu.org> Date: Mon, 18 Jan 2021 01:24:02 -0500 In-Reply-To: <87lfcsy3jd.fsf@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Sat, 16 Jan 2021 22:28:54 +0100") Message-ID: <87v9bukbjx.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-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: , Cc: 45891@debbugs.gnu.org Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -1.26 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=sgaDGYi8; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: B53EC940341 X-Spam-Score: -1.26 X-Migadu-Scanner: scn1.migadu.com X-TUID: CtHOgysyH022 Hi Ludo, Ludovic Court=C3=A8s writes: > Hi Maxim, > > Maxim Cournoyer skribis: > >> Ludovic Court=C3=A8s writes: >> >>> Previously, 'patch-and-repack' would always create a tar.xz archive as a >>> result, even if the input was a directory (a checkout). This change >>> reduces gratuitous CPU and storage overhead. >> >> I like it! >> >> Note that on core-updates, xz compression is relatively fast on modern >> machines as it can do multi-threading. About space the savings; could >> the 'temporary' pristine source be cleared from the store always? > > No, it=E2=80=99s not possible=E2=80=94the GC will remove what=E2=80=99s u= nreachable when it > eventually runs. OK. > >>> (define (tarxz-name file-name) >>> ;; Return a '.tar.xz' file name based on FILE-NAME. >>> - (let ((base (cond ((numeric-extension? file-name) >>> - original-file-name) >>> - ((checkout? file-name) >>> - (string-drop-right file-name 9)) >>> - (else (file-sans-extension file-name))))) >>> + (let ((base (if (numeric-extension? file-name) >>> + original-file-name >>> + (file-sans-extension file-name)))) >> >> This is not new code, but I'm wondering what's the purpose of >> numeric-extension? > > It=E2=80=99s for file names like =E2=80=9Chello-2.10=E2=80=9D, where you = wouldn=E2=80=99t want to strip > =E2=80=9C.10=E2=80=9D. (Such file names should be rare, but it=E2=80=99s= not impossible.) Ah! Thanks for explaining. >> What kind of files does it expect to catch? Also, what happened to >> stripping the '-checkout' suffix that used to be done? It doesn't >> seem like it will happen anymore. > > Stripping =E2=80=9C-checkout=E2=80=9D is no longer necessary because for = these we keep > the original name. > >>> - (let ((name (tarxz-name original-file-name))) >>> + (let ((name (if (checkout? original-file-name) >>> + original-file-name >>> + (tarxz-name original-file-name)))) >>> (gexp->derivation name build >>> #:graft? #f >>> #:system system >> >> Was these cases (tar archive source derivation, directory source >> derivation) already covered by tests under tests/packages.cm? How did >> you otherwise test it? World rebuilding changes are not fun to test >> without unit tests. > > In this case I rebuilt the world and tested =E2=80=98guix build -S=E2=80= =99 on a > git-fetch package with a snippet, but I agree that=E2=80=99s super expens= ive (I > tested the handful of commits I recently pushed to =E2=80=98core-updates= =E2=80=99 at the > same time.) > > There are no unit tests specifically for this procedure, but I think > we=E2=80=99ll quickly find out if it doesn=E2=80=99t behave as intended. > > WDYT? LGTM. Feel free to push! About my related change that we thought was conflicting with this one; it at least applies on top of your change, and only one test fails currently, I'm working on a fix. Feel free to push to core-updates! Thank you, Maxim