From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 28 10:03:51 2023 Received: (at submit) by debbugs.gnu.org; 28 Oct 2023 14:03:51 +0000 Received: from localhost ([127.0.0.1]:39284 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qwjup-0001VM-DN for submit@debbugs.gnu.org; Sat, 28 Oct 2023 10:03:51 -0400 Received: from lists.gnu.org ([2001:470:142::17]:46514) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qwjum-0001V4-8L for submit@debbugs.gnu.org; Sat, 28 Oct 2023 10:03:49 -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 1qwju8-0007ou-TV for guix-patches@gnu.org; Sat, 28 Oct 2023 10:03:09 -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 1qwju7-0007wF-F7; Sat, 28 Oct 2023 10:03:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=XkaNwGQR4v4313JGGElauh+r1N7RVZucZLyuF6fC24g=; b=rA0lOWaYfhqnt0 p3zVyYadGyT1GPUa8jDuaZDsTAOXtXP0Ybd3B9uXFcdok9ncbxOBlbKAsUTuw/2ZIYhv2ipYDuTzK qmP0/1int6D8knntPduzdjxSwmwQzH4NCGVLxkL7yRT6v87egGJAEyIiEwMhobpNtolVgTFFryYD5 e8aT91BVvqxF0tbuyyCtaE9l9GyzjPBA9mGCOvE15DfHpKnVZeXxg2cCfQ+DVDgzBIEq7mRJ2Q6fu N3o8Wt5pfjTUDrXJRwHtl00WSxSIw/5l2GmWdLcqOF42VRfnYjn54BcNG7QCIp9ktx8KoWk1AQvWR X/VU7Hy2pf4SMGeyRaqA==; From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: guix-patches@gnu.org Subject: [PATCH 0/3] Make time-machine commit check cheaper; make test effective Date: Sat, 28 Oct 2023 16:02:53 +0200 Message-ID: X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Debbugs-Cc: Christopher Baines , Josselin Poiret , Ludovic Courtès , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: submit Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= , Maxim Cournoyer , Simon Tournier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello Guix! These changes were prompted by . Feedback welcome! Ludo'. Ludovic Courtès (3): tests: Make ‘guix time-machine’ test effective. time-machine: Make target commit check cheaper. time-machine: Warn when no command is given. guix/inferior.scm | 58 +++++++++++----------- guix/scripts/time-machine.scm | 91 +++++++++++++++++------------------ tests/guix-time-machine.sh | 24 +++++++-- 3 files changed, 95 insertions(+), 78 deletions(-) base-commit: ff1146fb4f7254a8f644f89d7af6b4b566528603 -- 2.41.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 28 10:09:38 2023 Received: (at 66793) by debbugs.gnu.org; 28 Oct 2023 14:09:38 +0000 Received: from localhost ([127.0.0.1]:39299 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qwk0Q-0001f3-5k for submit@debbugs.gnu.org; Sat, 28 Oct 2023 10:09:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52934) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qwk0O-0001ei-C0 for 66793@debbugs.gnu.org; Sat, 28 Oct 2023 10:09:36 -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 1qwjzm-0000Ja-W0; Sat, 28 Oct 2023 10:08:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=2wYSI9vfiptedBsb7H+Psw3dlncWoFG/Nf0+76RotLk=; b=UW96iN3GYde10ouoEkgO o9Q7k1TGNENHTt59sGuRa9ELJpHq7o7VXcF4TsvnutIYYf34JYy92p8uJTDI8PbUzRunrMgTEqJkR Ro6XeUzAiTUNCIp/PFMiyZSniE3lp3i1wdvw86MkEcNUpbZ0RSihFpuJBJBCn7C+4KUW1PNlqu5vu Xj115eziGFB4xsVX2yTDUbH5mNnMGsNaf+MFX/eoumFbjnx4vw7/X/IH573Nh9P6MHOR7PVtuOvyo 9DmFVQIUaTncFqcNE/hSIt/asdsi3fDS4rTaNWxn+HCooCa+7oA+9OjMU1lDiGYZvItSXA3HBUyC+ S11BVh9plRC1ww==; From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: 66793@debbugs.gnu.org Subject: [PATCH 1/3] =?UTF-8?q?tests:=20Make=20=E2=80=98guix=20time-machin?= =?UTF-8?q?e=E2=80=99=20test=20effective.?= Date: Sat, 28 Oct 2023 16:08:33 +0200 Message-ID: X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 66793 Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) The test as added in 79ec651a286c71a3d4c72be33a1f80e76a560031 had no effect: first because ‘guix time-machine --commit=X’, not followed by a command, does nothing, and second because the “! COMMAND” shell stanza does not have the desired effect (see ). This change rewrites the test to make it effective. * tests/guix-time-machine.sh: Rewrite. Change-Id: Ib44a11331c8625e346139a236cffa699cdbd02f2 --- tests/guix-time-machine.sh | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/tests/guix-time-machine.sh b/tests/guix-time-machine.sh index 8b62ef75ea..a78c1533fb 100644 --- a/tests/guix-time-machine.sh +++ b/tests/guix-time-machine.sh @@ -1,5 +1,6 @@ # GNU Guix --- Functional package management for GNU # Copyright © 2023 Maxim Cournoyer +# Copyright © 2023 Ludovic Courtès # # This file is part of GNU Guix. # @@ -20,9 +21,24 @@ # Test the 'guix time-machine' command-line utility. # -guix time-machine --version +if [ -d "$abs_top_srcdir/.git" ] \ + || guile -c '(getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV)' 2> /dev/null +then + guix time-machine --version +else + echo "This test requires networking or a local Git checkout; skipping." >&2 + exit 77 +fi -# Visiting a commit older than v1.0.0 fails. -! guix time-machine --commit=v0.15.0 +if [ -d "$abs_top_srcdir/.git" ] +then + EXTRA_OPTIONS="--url=$abs_top_srcdir" +else + EXTRA_OPTIONS="" +fi -exit 0 +# Visiting a commit older than v1.0.0 must fail (this test is expensive +# because it clones the whole repository). +guix time-machine -q --commit=v0.15.0 $EXTRA_OPTIONS -- describe && false + +true -- 2.41.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 28 10:09:39 2023 Received: (at 66793) by debbugs.gnu.org; 28 Oct 2023 14:09:39 +0000 Received: from localhost ([127.0.0.1]:39301 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qwk0Q-0001fB-HO for submit@debbugs.gnu.org; Sat, 28 Oct 2023 10:09:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48098) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qwk0P-0001el-7d for 66793@debbugs.gnu.org; Sat, 28 Oct 2023 10:09:37 -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 1qwjzn-0000Jm-UL; Sat, 28 Oct 2023 10:08:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=6Ql20mviB9vqAveWLKILA3qy0/UOnKBo/2Bzi5xaI7Q=; b=GZFK3AS/yN3/fs61fjAl EnzKoNQN/qUa/IzhMqb3B9y8NLtDiQDIyJoERGqqv6zJoQ+2QRAPrqkJm0rEVcwmpl773T/sxwmQ+ ftvpkbd1hJuYItnTaXTDfjEQUDrKJQAmN/rtn3IBkakAuUfF556p2BNYKcz94R4DAy7KaC3zoCpCE BiMQ7Vhd+PnJeKtzoTLbdKYrpUhSdRnh9ruFDMY1zrIaMOKFaRHiHmkFaZwqjqHlxng2MDiJaonPZ aURTuRVqPDh0qqg0yXkoUJM1OIvDQHopG5+PpDNnxWuFCkUDdKevZA4tqVNZ7cm7mN1BMh/hGGWr2 J5d4fn0gN2r22Q==; From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: 66793@debbugs.gnu.org Subject: [PATCH 2/3] time-machine: Make target commit check cheaper. Date: Sat, 28 Oct 2023 16:08:34 +0200 Message-ID: <648020c38a11915d2d147c4b05da682b011b593e.1698501649.git.ludo@gnu.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Debbugs-Cc: Christopher Baines , Josselin Poiret , Ludovic Courtès , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 66793 Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= , Simon Tournier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Commit 79ec651a286c71a3d4c72be33a1f80e76a560031 introduced a check to error out when attempting to use ‘time-machine’ to travel to a commit before ‘v1.0.0’. This commit fixes a performance issue with the strategy used in 79ec651a286c71a3d4c72be33a1f80e76a560031 (the repository was opened, updated, and traversed a second time by ‘validate-guix-channel’) as well as a user interface issue (“Updating channel” messages would be printed too late). This patch reimplements the check in terms of the existing #:validate-pull mechanism, which is designed to avoid extra repository operations. Fixes . * guix/inferior.scm (cached-channel-instance): Change default value of #:validate-channels. Remove call to VALIDATE-CHANNELS; pass it as #:validate-pull to ‘latest-channel-instances’. * guix/scripts/time-machine.scm (%reference-channels): New variable. (validate-guix-channel): New procedure. (guix-time-machine)[validate-guix-channel]: Remove. Pass #:reference-channels to ‘cached-channel-instance’. Reported-by: Simon Tournier Change-Id: I9b0ec61fba7354fe08b04a91f4bd32b72a35460c --- guix/inferior.scm | 58 +++++++++++++++++++---------------- guix/scripts/time-machine.scm | 58 ++++++++++++++++------------------- 2 files changed, 58 insertions(+), 58 deletions(-) diff --git a/guix/inferior.scm b/guix/inferior.scm index fca6fb4b22..190ba01b3c 100644 --- a/guix/inferior.scm +++ b/guix/inferior.scm @@ -872,14 +872,17 @@ (define* (cached-channel-instance store (authenticate? #t) (cache-directory (%inferior-cache-directory)) (ttl (* 3600 24 30)) - validate-channels) + (reference-channels '()) + (validate-channels (const #t))) "Return a directory containing a guix filetree defined by CHANNELS, a list of channels. The directory is a subdirectory of CACHE-DIRECTORY, where entries can be reclaimed after TTL seconds. This procedure opens a new connection to the build daemon. AUTHENTICATE? determines whether CHANNELS are authenticated. -VALIDATE-CHANNELS, if specified, must be a one argument procedure accepting a -list of channels that can be used to validate the channels; it should raise an -exception in case of problems." + +VALIDATE-CHANNELS must be a four-argument procedure used to validate channel +instances against REFERENCE-CHANNELS; it is passed as #:validate-pull to +'latest-channel-instances' and should raise an exception in case a target +channel commit is deemed \"invalid\"." (define commits ;; Since computing the instances of CHANNELS is I/O-intensive, use a ;; cheaper way to get the commit list of CHANNELS. This limits overhead @@ -927,30 +930,31 @@ (define* (cached-channel-instance store (if (file-exists? cached) cached - (begin - (when (procedure? validate-channels) - (validate-channels channels)) - (run-with-store store - (mlet* %store-monad ((instances - -> (latest-channel-instances store channels - #:authenticate? - authenticate?)) - (profile - (channel-instances->derivation instances))) - (mbegin %store-monad - ;; It's up to the caller to install a build handler to report - ;; what's going to be built. - (built-derivations (list profile)) + (run-with-store store + (mlet* %store-monad ((instances + -> (latest-channel-instances store channels + #:authenticate? + authenticate? + #:current-channels + reference-channels + #:validate-pull + validate-channels)) + (profile + (channel-instances->derivation instances))) + (mbegin %store-monad + ;; It's up to the caller to install a build handler to report + ;; what's going to be built. + (built-derivations (list profile)) - ;; Cache if and only if AUTHENTICATE? is true. - (if authenticate? - (mbegin %store-monad - (symlink* (derivation->output-path profile) cached) - (add-indirect-root* cached) - (return cached)) - (mbegin %store-monad - (add-temp-root* (derivation->output-path profile)) - (return (derivation->output-path profile)))))))))) + ;; Cache if and only if AUTHENTICATE? is true. + (if authenticate? + (mbegin %store-monad + (symlink* (derivation->output-path profile) cached) + (add-indirect-root* cached) + (return cached)) + (mbegin %store-monad + (add-temp-root* (derivation->output-path profile)) + (return (derivation->output-path profile))))))))) (define* (inferior-for-channels channels #:key diff --git a/guix/scripts/time-machine.scm b/guix/scripts/time-machine.scm index f31fae7435..bd64364fa2 100644 --- a/guix/scripts/time-machine.scm +++ b/guix/scripts/time-machine.scm @@ -46,12 +46,6 @@ (define-module (guix scripts time-machine) #:use-module (srfi srfi-71) #:export (guix-time-machine)) -;;; The required inferiors mechanism relied on by 'guix time-machine' was -;;; firmed up in v1.0.0; it is the oldest, safest commit that can be travelled -;;; to. -(define %oldest-possible-commit - "6298c3ffd9654d3231a6f25390b056483e8f407c") ;v1.0.0 - ;;; ;;; Command-line options. @@ -144,6 +138,31 @@ (define (parse-args args) (("--") opts) (("--" command ...) (alist-cons 'exec command opts)))))) + +;;; +;;; Avoiding traveling too far back. +;;; + +;;; The required inferiors mechanism relied on by 'guix time-machine' was +;;; firmed up in v1.0.0; it is the oldest, safest commit that can be travelled +;;; to. +(define %oldest-possible-commit + "6298c3ffd9654d3231a6f25390b056483e8f407c") ;v1.0.0 + +(define %reference-channels + (list (channel (inherit %default-guix-channel) + (commit %oldest-possible-commit)))) + +(define (validate-guix-channel channel start commit relation) + "Raise an error if CHANNEL is the 'guix' channel and the RELATION of COMMIT +to %OLDEST-POSSIBLE-COMMIT is not that of an ancestor." + (unless (or (not (guix-channel? channel)) + (memq relation '(ancestor self))) + (raise (formatted-message + (G_ "cannot travel past commit `~a' from May 1st, 2019") + (string-take %oldest-possible-commit 12))))) + + ;;; ;;; Entry point. @@ -160,31 +179,6 @@ (define-command (guix-time-machine . args) (ref (assoc-ref opts 'ref)) (substitutes? (assoc-ref opts 'substitutes?)) (authenticate? (assoc-ref opts 'authenticate-channels?))) - - (define (validate-guix-channel channels) - "Finds the Guix channel among CHANNELS, and validates that REF as -captured from the closure, a git reference specification such as a commit hash -or tag associated to the channel, is valid and new enough to satisfy the 'guix -time-machine' requirements. If the captured REF variable is #f, the reference -validate is the one of the Guix channel found in CHANNELS. A -`formatted-message' condition is raised otherwise." - (let* ((guix-channel (find guix-channel? channels)) - (guix-channel-commit (channel-commit guix-channel)) - (guix-channel-branch (channel-branch guix-channel)) - (guix-channel-ref (if guix-channel-commit - `(tag-or-commit . ,guix-channel-commit) - `(branch . ,guix-channel-branch))) - (reference (or ref guix-channel-ref)) - (checkout commit relation (update-cached-checkout - (channel-url guix-channel) - #:ref reference - #:starting-commit - %oldest-possible-commit))) - (unless (memq relation '(ancestor self)) - (raise (formatted-message - (G_ "cannot travel past commit `~a' from May 1st, 2019") - (string-take %oldest-possible-commit 12)))))) - (when command-line (let* ((directory (with-store store @@ -197,6 +191,8 @@ (define-command (guix-time-machine . args) (set-build-options-from-command-line store opts) (cached-channel-instance store channels #:authenticate? authenticate? + #:reference-channels + %reference-channels #:validate-channels validate-guix-channel))))) (executable (string-append directory "/bin/guix"))) -- 2.41.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 28 10:09:46 2023 Received: (at 66793) by debbugs.gnu.org; 28 Oct 2023 14:09:46 +0000 Received: from localhost ([127.0.0.1]:39303 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qwk0Y-0001fV-7D for submit@debbugs.gnu.org; Sat, 28 Oct 2023 10:09:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48104) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qwk0Q-0001en-2k for 66793@debbugs.gnu.org; Sat, 28 Oct 2023 10:09:38 -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 1qwjzo-0000Jx-QD; Sat, 28 Oct 2023 10:09:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=562Qx4GRpp6tFHumc69gjq/M8IM2P/MZH3fl/0Xj6u0=; b=i009dA+EStvaX4Y9WKzy 3qK8Cl5/VMgPCzr9b05xuNxdwddZwF6fPRWSif2QfF/7xSzyRMcXNrjSUPnC2CQy2C+16XSqs124j 1PIaodbz0M6xqaB6UGKez9RrTt/49t7hZDV+d6r3T+o5fkFC3jJluPGN/VLLbKS3l0QAgPR5ewUkW VHpDMIZ4fEq42ahQBqeARWJ+LBV6iKVTHx6hgzh3SEKXWtuudb56khqd50BhF3zIV6pp0Nx/cHZ4R gTnIecJfb1UuaYtj2V8xS+IstX3pZUox2NoFbqQvAkBOVg7xusyDvZzXqa13eL6R4G7T6J+N9UKSG U8TPFHv4t7CsqQ==; From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: 66793@debbugs.gnu.org Subject: [PATCH 3/3] time-machine: Warn when no command is given. Date: Sat, 28 Oct 2023 16:08:35 +0200 Message-ID: X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 X-Debbugs-Cc: Christopher Baines , Josselin Poiret , Ludovic Courtès , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 66793 Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * guix/scripts/time-machine.scm (guix-time-machine): Emit a warning when COMMAND-LINE is false. Change-Id: I26e6b608915ecaf6d9372f9b03dc5ebd1b4c68f9 --- guix/scripts/time-machine.scm | 37 ++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/guix/scripts/time-machine.scm b/guix/scripts/time-machine.scm index bd64364fa2..2c30fe7cfd 100644 --- a/guix/scripts/time-machine.scm +++ b/guix/scripts/time-machine.scm @@ -179,21 +179,22 @@ (define-command (guix-time-machine . args) (ref (assoc-ref opts 'ref)) (substitutes? (assoc-ref opts 'substitutes?)) (authenticate? (assoc-ref opts 'authenticate-channels?))) - (when command-line - (let* ((directory - (with-store store - (with-status-verbosity (assoc-ref opts 'verbosity) - (with-build-handler (build-notifier #:use-substitutes? - substitutes? - #:verbosity - (assoc-ref opts 'verbosity) - #:dry-run? #f) - (set-build-options-from-command-line store opts) - (cached-channel-instance store channels - #:authenticate? authenticate? - #:reference-channels - %reference-channels - #:validate-channels - validate-guix-channel))))) - (executable (string-append directory "/bin/guix"))) - (apply execl (cons* executable executable command-line)))))))) + (if command-line + (let* ((directory + (with-store store + (with-status-verbosity (assoc-ref opts 'verbosity) + (with-build-handler (build-notifier #:use-substitutes? + substitutes? + #:verbosity + (assoc-ref opts 'verbosity) + #:dry-run? #f) + (set-build-options-from-command-line store opts) + (cached-channel-instance store channels + #:authenticate? authenticate? + #:reference-channels + %reference-channels + #:validate-channels + validate-guix-channel))))) + (executable (string-append directory "/bin/guix"))) + (apply execl (cons* executable executable command-line))) + (warning (G_ "no command specified; nothing to do~%"))))))) -- 2.41.0 From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 31 11:07:12 2023 Received: (at 66793) by debbugs.gnu.org; 31 Oct 2023 15:07:12 +0000 Received: from localhost ([127.0.0.1]:48975 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qxqKl-00076u-TP for submit@debbugs.gnu.org; Tue, 31 Oct 2023 11:07:12 -0400 Received: from mail-oo1-xc30.google.com ([2607:f8b0:4864:20::c30]:60916) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qxqKg-00076P-Q7 for 66793@debbugs.gnu.org; Tue, 31 Oct 2023 11:07:10 -0400 Received: by mail-oo1-xc30.google.com with SMTP id 006d021491bc7-581edcde26cso3508066eaf.1 for <66793@debbugs.gnu.org>; Tue, 31 Oct 2023 08:06:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698764787; x=1699369587; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=AuU2ZFNfUoDYuRnukQym7Yd/VOZOOldBSMLeQsJ2sU0=; b=gCwANNv+AYE7+MedpKq1HOPossInuEentlORP+znwNEpcMIMHSLyglzFhUPkLD+qdS Rl6oDqfHd9oQuxpRD86BB+/TJ1k5BiG7x9DRXdXlkkJvuuzPU177C6VvFR5RspPQ2tzn NiWl1vf05Mrb1aq9MsexsB7lvcIw0qPoR2rdEKe6Z+wNZ2OkCB+ax76fAaSDEqQugSip 6TOlyfWzymscn5ND7Y2q9O6RYaq1D77H5+3TjPxlsz6IwxIApyITuBN6JPzvtCw46eng BKi8wpgfmKos9wrYn1GJiFYyIpO4dp9UWLwX5EJo5FeTlFaK0OYw4nBXIHphd1e4I5Um tNAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698764787; x=1699369587; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=AuU2ZFNfUoDYuRnukQym7Yd/VOZOOldBSMLeQsJ2sU0=; b=HCkNShJZq5MGib3qTxQMkLMAxNaaB5moEGjDzm2pHnzhCikC5Qv+BX/kc19RuKWkLI 0+TciO1NqgRC87b6/O0VwBf99EzjcHnBpwA9mQyIzDOvXSFi15KnCElkKkLT0+ej0cvI wR9qq2Y8hWcDEZIl0PplhdOwxnHxsCRSX9GEAzyyFJDc7+Ab/9EEbmjhK6MDKT2o1keq CMQHEzVzWh+nJWTDaCO3aCMBrIFz4X0UZv3nG3d2UmaP1Arn/f3tzhGAynXIOnLY1Fer tRBjmN28plbrB33OKnIkJKWfxWxsdD0qyTaKbpNxBHUpwx/j+wu2OPZoB5ZFEHXZ9p5v p1iw== X-Gm-Message-State: AOJu0YzWsuu38BaE0RUwJwyMcNbhaoZ6JpK3fcOq0Pezv2J4NZ0JFrW9 O9YcgBefpA0MuYR9UfilTr5l7thqrTM= X-Google-Smtp-Source: AGHT+IFx0M8x+Et7+D9aSUdOBzEY+v1stRaR+MHIl5rSuG47riAlS7OaLqWps5ixeIn1vh3EWmsSXw== X-Received: by 2002:a05:6358:e496:b0:168:f602:d61 with SMTP id by22-20020a056358e49600b00168f6020d61mr10997336rwb.32.1698764786907; Tue, 31 Oct 2023 08:06:26 -0700 (PDT) Received: from hurd (dsl-10-128-239.b2b2c.ca. [72.10.128.239]) by smtp.gmail.com with ESMTPSA id c4-20020a0ceb44000000b0066d5220d860sm603896qvq.18.2023.10.31.08.06.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 08:06:26 -0700 (PDT) From: Maxim Cournoyer To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: [bug#66793] [PATCH 1/3] tests: Make =?utf-8?Q?=E2=80=98guix?= =?utf-8?Q?_time-machine=E2=80=99?= test effective. In-Reply-To: ("Ludovic =?utf-8?Q?Court=C3=A8s=22's?= message of "Sat, 28 Oct 2023 16:08:33 +0200") References: Date: Tue, 31 Oct 2023 11:06:25 -0400 Message-ID: <877cn2sufi.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 66793 Cc: 66793@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, Ludovic Court=C3=A8s writes: > The test as added in 79ec651a286c71a3d4c72be33a1f80e76a560031 had no > effect: first because =E2=80=98guix time-machine --commit=3DX=E2=80=99, n= ot followed by a > command, does nothing, and second because the =E2=80=9C! COMMAND=E2=80=9D= shell stanza > does not have the desired effect (see = ). Interesting. I had tested it, but I guess not with that script :-). [...] > -guix time-machine --version > +if [ -d "$abs_top_srcdir/.git" ] \ > + || guile -c '(getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV)' 2> /dev= /null > +then > + guix time-machine --version > +else > + echo "This test requires networking or a local Git checkout; skippin= g." >&2 > + exit 77 > +fi >=20=20 > -# Visiting a commit older than v1.0.0 fails. > -! guix time-machine --commit=3Dv0.15.0 > +if [ -d "$abs_top_srcdir/.git" ] > +then > + EXTRA_OPTIONS=3D"--url=3D$abs_top_srcdir" Should the --url valE here be prefixed with "file://", just to make it extra clear we are cloning from a local file? > +else > + EXTRA_OPTIONS=3D"" > +fi >=20=20 > -exit 0 > +# Visiting a commit older than v1.0.0 must fail (this test is expensive > +# because it clones the whole repository). > +guix time-machine -q --commit=3Dv0.15.0 $EXTRA_OPTIONS -- describe && fa= lse > + > +true Otherwise LGTM. --=20 Thanks, Maxim From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 31 11:15:49 2023 Received: (at 66793) by debbugs.gnu.org; 31 Oct 2023 15:15:49 +0000 Received: from localhost ([127.0.0.1]:48979 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qxqT6-0007O5-Vm for submit@debbugs.gnu.org; Tue, 31 Oct 2023 11:15:49 -0400 Received: from mail-qk1-x733.google.com ([2607:f8b0:4864:20::733]:42197) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qxqT0-0007Nd-PL for 66793@debbugs.gnu.org; Tue, 31 Oct 2023 11:15:46 -0400 Received: by mail-qk1-x733.google.com with SMTP id af79cd13be357-7789cc5c8ccso469324685a.0 for <66793@debbugs.gnu.org>; Tue, 31 Oct 2023 08:15:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698765303; x=1699370103; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4buaYj1AkhVQyvt81I9lBJBjauHyd5xrE8QRYrfget0=; b=cmF5lnISrRColHcRvIDa1/ax4PtxpiXgjxxy7LGU87j8xhLivtJHk/rBXZqVSvWMwv GWOyjXAlG6sdc4tqGlpNP4X35OUaomoxFKWlzJBMKIcy4M9+pdzjfd5iYk+eusn3gG27 AHNnoV9TLUCphBGznRMMFZwkIFliUbCvPAsI8KKko5fmfgY20Df3zYeX0j8VFwJLBVs/ j3dK6bFT7qlKgzWDqvPqCC+F1w4QbCA9nIRsJB+bzh9L9d59R6JO2TQP2C8eaytpJH5y T5TvGOE2C6ILrDc6LhQmOnIFpQ39RkkkPJr24BkmIwySsfthE4uVoJ/j9hFNqePI6e2X 0Eug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698765303; x=1699370103; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=4buaYj1AkhVQyvt81I9lBJBjauHyd5xrE8QRYrfget0=; b=E1P+eFQAK6olRfR8oJAoSdECz5tZ/PAkXNMT766NgEiUyW60ZTezP5dRnW/FjMkc6y W7A2I5rGKSHpkUWeDVsXbEluL+0GCRIsYSRhSvBDF/8lZ+5Z5dooUDp6uj8TAjpgsL6f IS//TtPrgk/ivWT6B4HwudxVz9rNnUDqf1EfKvpwvIuWqoKtJluUgkguHEXLOvlUGVEw gh8UNVhf9QUnh9fRu0Ejx2BBlOr6D8XRQRHWtCSpLuGuDoSZmkXrc15u/mZ/t0CDC4yQ ZXSdvhksaIfvbvLoS2/L60WZp0C72I45z1Zw4zc0FpKurGIVV0cuS3RGPPVzDDqmGsvl JqzQ== X-Gm-Message-State: AOJu0YxrBq7UPbsjdq9ZZ+cz+3TTTETi58oKqneGS3b1rPU+TsD6TBD2 pxbicBPvjYmrbkOdNyFSEh4= X-Google-Smtp-Source: AGHT+IFB5ywO8BVjNw3akWzxp7+PNG8N3Zw8u1N2IiR8E/05EJdLz/cEZA6qphMx9cmdrWOIXxBucg== X-Received: by 2002:a05:620a:2886:b0:774:2470:6797 with SMTP id j6-20020a05620a288600b0077424706797mr4544626qkp.21.1698765303015; Tue, 31 Oct 2023 08:15:03 -0700 (PDT) Received: from hurd (dsl-10-128-239.b2b2c.ca. [72.10.128.239]) by smtp.gmail.com with ESMTPSA id d3-20020a05620a240300b007756c0853a5sm576082qkn.58.2023.10.31.08.15.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 08:15:02 -0700 (PDT) From: Maxim Cournoyer To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: [bug#66793] [PATCH 2/3] time-machine: Make target commit check cheaper. In-Reply-To: <648020c38a11915d2d147c4b05da682b011b593e.1698501649.git.ludo@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22's?= message of "Sat, 28 Oct 2023 16:08:34 +0200") References: <648020c38a11915d2d147c4b05da682b011b593e.1698501649.git.ludo@gnu.org> Date: Tue, 31 Oct 2023 11:15:01 -0400 Message-ID: <8734xqsu16.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 66793 Cc: Josselin Poiret , Simon Tournier , Mathieu Othacehe , Tobias Geerinckx-Rice , 66793@debbugs.gnu.org, Ricardo Wurmus , Christopher Baines X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, Ludovic Court=C3=A8s writes: > Commit 79ec651a286c71a3d4c72be33a1f80e76a560031 introduced a check to > error out when attempting to use =E2=80=98time-machine=E2=80=99 to travel= to a commit > before =E2=80=98v1.0.0=E2=80=99. > > This commit fixes a performance issue with the strategy used in > 79ec651a286c71a3d4c72be33a1f80e76a560031 (the repository was opened, > updated, and traversed a second time by =E2=80=98validate-guix-channel=E2= =80=99) as well > as a user interface issue (=E2=80=9CUpdating channel=E2=80=9D messages wo= uld be printed > too late). > > This patch reimplements the check in terms of the existing #:validate-pull > mechanism, which is designed to avoid extra repository operations. > > Fixes . > > * guix/inferior.scm (cached-channel-instance): Change default value > of #:validate-channels. Remove call to VALIDATE-CHANNELS; pass it > as #:validate-pull to =E2=80=98latest-channel-instances=E2=80=99. > * guix/scripts/time-machine.scm (%reference-channels): New variable. > (validate-guix-channel): New procedure. > (guix-time-machine)[validate-guix-channel]: Remove. Nitpick: I'd say the proc was moved and simplified to ease traceability for the reader; same for %oldest-possible-commit (not mentioned in changelog). Otherwise LGTM! --=20 Thanks, Maxim From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 31 11:17:13 2023 Received: (at 66793) by debbugs.gnu.org; 31 Oct 2023 15:17:13 +0000 Received: from localhost ([127.0.0.1]:48983 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qxqUT-0007R2-Eq for submit@debbugs.gnu.org; Tue, 31 Oct 2023 11:17:13 -0400 Received: from mail-qt1-x836.google.com ([2607:f8b0:4864:20::836]:53592) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qxqUS-0007Qj-54 for 66793@debbugs.gnu.org; Tue, 31 Oct 2023 11:17:12 -0400 Received: by mail-qt1-x836.google.com with SMTP id d75a77b69052e-41cc7379b23so36054641cf.3 for <66793@debbugs.gnu.org>; Tue, 31 Oct 2023 08:16:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698765392; x=1699370192; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Y/eAnj2cfxfudRTGPjREJEQYWQFqEhyFz4bgh5hPztM=; b=jJ96Abke3oi4nRVVn8CJayziGp6Myx6HI3vh1nOWasNShBVB0TJuEf5W6YInYFZ8Ch pb5YK1Z2qxFH5CSZ84mxIKAjCq4rTfruulMs2TmrWgpSVAK5RDBrNbiFO8okt05WzDoS m9eNllRvjaBCLmINjGw5bD9+DzYh1PCi1CYeA1/UK5vSYS06yAaoRfg1Aj3ww2Av6piT N9wb1RFAdhAj1hmL89NqK1oNLIW3vIiW1LblLESscnA2a3AO4fhXt/E2lXhnvZoPK/sS 2ov0ajV/+5UwN5f1ZdSAruj8Rl5yXzpQFXOE06V+euF/G+hMgMhB1LQiN1Scg8k5uHKt Lj3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698765392; x=1699370192; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Y/eAnj2cfxfudRTGPjREJEQYWQFqEhyFz4bgh5hPztM=; b=T1Ygaj60ThQha24nguiV72i2BHZMLfQR2AF9wjuwrOW+8XWO92ftqQGWx1FF1bFCtm 2qZ8vKZFwENLW/b8Aw6aZD/ckdu9Bl56IOhzasZmZ9GFdPDQPuNoxFg7oTLmZCGvVMGE oCLBYnbLZrn4bgnJSAQRVF6WOTteC4wBYClw9rpXQjtgHy0fXgNirWmHXxoAqOLgXaAu wGGFvuunqjZsbD0qr5dlxDMilppCvriyWhi6R82AUpqm5wwbq2dUx5j/xjpBLhwZL38p gaF8p0T+8CCRlWf2bfyd/hrzdghtaF0cBHUYax2MWjWmxCpN+Pf8/BiqszoqG3/zc/zk Qbpw== X-Gm-Message-State: AOJu0YwtAruD8dKTLZIZsRvBw5acyQQa0MFdMtULtlR6EiIuDtJA/GnH GlXUJFcR0lXKunVZ67At+7A= X-Google-Smtp-Source: AGHT+IEfBZLdG9Ex0MPGAqcA6Y2CI9nylPj5GqCDvpOzEkfig96Zc29ns2y5ihTkyr2FXKeZXsS7Bg== X-Received: by 2002:ac8:5a91:0:b0:403:b645:86fa with SMTP id c17-20020ac85a91000000b00403b64586famr16263542qtc.24.1698765392694; Tue, 31 Oct 2023 08:16:32 -0700 (PDT) Received: from hurd (dsl-10-128-239.b2b2c.ca. [72.10.128.239]) by smtp.gmail.com with ESMTPSA id o23-20020ac841d7000000b00403cce833eesm570732qtm.27.2023.10.31.08.16.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 08:16:32 -0700 (PDT) From: Maxim Cournoyer To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: [bug#66793] [PATCH 3/3] time-machine: Warn when no command is given. In-Reply-To: ("Ludovic =?utf-8?Q?Court=C3=A8s=22's?= message of "Sat, 28 Oct 2023 16:08:35 +0200") References: Date: Tue, 31 Oct 2023 11:16:31 -0400 Message-ID: <87y1firfe8.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 66793 Cc: Josselin Poiret , Simon Tournier , Mathieu Othacehe , Tobias Geerinckx-Rice , 66793@debbugs.gnu.org, Ricardo Wurmus , Christopher Baines X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Ludo, Ludovic Court=C3=A8s writes: > * guix/scripts/time-machine.scm (guix-time-machine): Emit a warning when > COMMAND-LINE is false. [...] > + (if command-line > + (let* ((directory > + (with-store store > + (with-status-verbosity (assoc-ref opts 'verbosity) > + (with-build-handler (build-notifier #:use-substit= utes? > + substitutes? > + #:verbosity > + (assoc-ref op= ts 'verbosity) > + #:dry-run? #f) > + (set-build-options-from-command-line store opts) > + (cached-channel-instance store channels > + #:authenticate? authen= ticate? > + #:reference-channels > + %reference-channels > + #:validate-channels > + validate-guix-channel)= )))) > + (executable (string-append directory "/bin/guix"))) > + (apply execl (cons* executable executable command-line))) > + (warning (G_ "no command specified; nothing to do~%"))))))) LGTM. --=20 Thanks, Maxim From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 05 15:49:53 2023 Received: (at 66793) by debbugs.gnu.org; 5 Nov 2023 20:49:53 +0000 Received: from localhost ([127.0.0.1]:38265 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzk49-0006pB-7z for submit@debbugs.gnu.org; Sun, 05 Nov 2023 15:49:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43658) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzk47-0006ow-E1 for 66793@debbugs.gnu.org; Sun, 05 Nov 2023 15:49:51 -0500 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 1qzk3R-00081S-3y; Sun, 05 Nov 2023 15:49:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=EcFLkfFQd0PE6MzTLx5tr+EdkMRxjtzVj6w41dzVgdA=; b=ryiVOu/ZbgexMA94jiwz XdnvBxeZQHL8vExgZqq37DjVoMtFXra3rK/OfW56YYwam0wdBtSPKQV8MfyxWHmVzekCrsWdpXp/C /CUXPKaw3NgBn/cBAsAMlt9/1CdRtiYOIrlOsj+ngmrIAvN7bpmsaNPGlI/syACU9D0tk+Pqj7pEJ IEkwnWznWKBqFPokoF818Rofj5+ZJ4akxGRQ8XC72GHvgDyywLunoh9XFLNaguACbWLP3IhBp2OjU cCuRQRXQmlBpeKgZFO0oUBXibF7n9exemiO98dVrTv/Lq37TTFBjiR2xGX2nbVPjjIJv9Lu/eJIBt xk7mrsq6CYXBPw==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Maxim Cournoyer Subject: Re: [bug#66793] [PATCH 1/3] tests: Make =?utf-8?Q?=E2=80=98guix?= =?utf-8?Q?_time-machine=E2=80=99?= test effective. In-Reply-To: <877cn2sufi.fsf@gmail.com> (Maxim Cournoyer's message of "Tue, 31 Oct 2023 11:06:25 -0400") References: <877cn2sufi.fsf@gmail.com> Date: Sun, 05 Nov 2023 21:49:06 +0100 Message-ID: <87cywoylh9.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 66793 Cc: 66793@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Maxim Cournoyer skribis: >> +if [ -d "$abs_top_srcdir/.git" ] \ >> + || guile -c '(getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV)' 2> /de= v/null >> +then >> + guix time-machine --version >> +else >> + echo "This test requires networking or a local Git checkout; skippi= ng." >&2 >> + exit 77 >> +fi >>=20=20 >> -# Visiting a commit older than v1.0.0 fails. >> -! guix time-machine --commit=3Dv0.15.0 >> +if [ -d "$abs_top_srcdir/.git" ] >> +then >> + EXTRA_OPTIONS=3D"--url=3D$abs_top_srcdir" > > Should the --url valE here be prefixed with "file://", just to make it > extra clear we are cloning from a local file? To my surprise, the test (which does little more than cloning the repo) runs in 5s without file:// and in 30mn otherwise! So I left the file:// prefix out and added a comment. Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 05 17:29:13 2023 Received: (at 66793-done) by debbugs.gnu.org; 5 Nov 2023 22:29:13 +0000 Received: from localhost ([127.0.0.1]:38308 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzlcG-0003P8-Qk for submit@debbugs.gnu.org; Sun, 05 Nov 2023 17:29:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51332) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzlcE-0003Ov-5P for 66793-done@debbugs.gnu.org; Sun, 05 Nov 2023 17:29:10 -0500 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 1qzlbW-000070-5j; Sun, 05 Nov 2023 17:28:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=WZVO8SWpK/1aUQJnesuHnWR3L0Gttg++MvWpR9yYaeE=; b=cM0N+67mgdqStspKZknL H40ogPICXTRop5QmN3KJh5WHEzNf5NQKbQbLS5uCJq64TMvPa6KMGN3Vy/aiUSm72/XQwWx/w77vA 2I61+qa3+ltJ+jXJgRtrhDW6dB9r3ZEAuxdgx8bfk3ixBy02iTcCohVqMQDatO68qwDvjPnjIENoJ EuGM6B+jK6j04mw6OfRtKFhfO21LirjV0Sp2eX5OzbZbwlMS5fQ0KdgUnPtNMS7N6xcyr+z5NuKQV s6RfbxCK3TaPBteOzkRX/T7d8g6k5mbYwfBbkT6an5SwaO+CZUJj8YgdNR3JXY3BM2iJHe3bWQMWi 4sqIKJSBY1F5pA==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Maxim Cournoyer Subject: Re: [bug#66793] [PATCH 2/3] time-machine: Make target commit check cheaper. In-Reply-To: <8734xqsu16.fsf@gmail.com> (Maxim Cournoyer's message of "Tue, 31 Oct 2023 11:15:01 -0400") References: <648020c38a11915d2d147c4b05da682b011b593e.1698501649.git.ludo@gnu.org> <8734xqsu16.fsf@gmail.com> Date: Sun, 05 Nov 2023 23:28:22 +0100 Message-ID: <8734xjzvg9.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 66793-done Cc: Josselin Poiret , Simon Tournier , Mathieu Othacehe , Tobias Geerinckx-Rice , 66793-done@debbugs.gnu.org, Ricardo Wurmus , Christopher Baines X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Maxim Cournoyer skribis: > Ludovic Court=C3=A8s writes: > >> Commit 79ec651a286c71a3d4c72be33a1f80e76a560031 introduced a check to >> error out when attempting to use =E2=80=98time-machine=E2=80=99 to trave= l to a commit >> before =E2=80=98v1.0.0=E2=80=99. >> >> This commit fixes a performance issue with the strategy used in >> 79ec651a286c71a3d4c72be33a1f80e76a560031 (the repository was opened, >> updated, and traversed a second time by =E2=80=98validate-guix-channel= =E2=80=99) as well >> as a user interface issue (=E2=80=9CUpdating channel=E2=80=9D messages w= ould be printed >> too late). >> >> This patch reimplements the check in terms of the existing #:validate-pu= ll >> mechanism, which is designed to avoid extra repository operations. >> >> Fixes . >> >> * guix/inferior.scm (cached-channel-instance): Change default value >> of #:validate-channels. Remove call to VALIDATE-CHANNELS; pass it >> as #:validate-pull to =E2=80=98latest-channel-instances=E2=80=99. >> * guix/scripts/time-machine.scm (%reference-channels): New variable. >> (validate-guix-channel): New procedure. >> (guix-time-machine)[validate-guix-channel]: Remove. > > Nitpick: I'd say the proc was moved and simplified to ease traceability > for the reader; same for %oldest-possible-commit (not mentioned in > changelog). Indeed; I clarified that =E2=80=98validate-guix-channel=E2=80=99 was moved = but didn=E2=80=99t write anything about =E2=80=98%oldest-possible-commit=E2=80=99 because it= =E2=80=99s actually unchanged (just moved a few lines below). I pushed the result: 331d858e21 time-machine: Warn when no command is given. ab13e2be69 time-machine: Make target commit check cheaper. 9f05fbb67d tests: Make =E2=80=98guix time-machine=E2=80=99 test effective. Thanks for reviewing! Ludo=E2=80=99. From unknown Fri Sep 19 14:23:28 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 04 Dec 2023 12:24:11 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator