From unknown Fri Jun 13 11:07:10 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50878] [PATCH] union: Resolve collisions by stable-sort'ing them. Resent-From: Attila Lendvai Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 28 Sep 2021 21:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 50878 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50878@debbugs.gnu.org Cc: Attila Lendvai X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16328654664183 (code B ref -1); Tue, 28 Sep 2021 21:45:02 +0000 Received: (at submit) by debbugs.gnu.org; 28 Sep 2021 21:44:26 +0000 Received: from localhost ([127.0.0.1]:47217 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVKtm-00015P-4U for submit@debbugs.gnu.org; Tue, 28 Sep 2021 17:44:26 -0400 Received: from lists.gnu.org ([209.51.188.17]:32802) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVKtj-00015G-IO for submit@debbugs.gnu.org; Tue, 28 Sep 2021 17:44:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43598) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mVKtj-0005F8-Ar for guix-patches@gnu.org; Tue, 28 Sep 2021 17:44:23 -0400 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]:38762) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mVKth-00035M-Oh for guix-patches@gnu.org; Tue, 28 Sep 2021 17:44:23 -0400 Received: by mail-ed1-x529.google.com with SMTP id dj4so561465edb.5 for ; Tue, 28 Sep 2021 14:44:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Qr5R52rHMqO4ZCWXfxGqaXGgIsdYxTsy6aODkPEG9fc=; b=aVSdrgDC29acA5/eux1+btEJ5MyCh3UVHTnnpdc9vqpnV8YNeV0s7C6VOh2sb8fXeu TLuZb92vb1Yk5akxeXWhyHpcX5dEGc7JKvHKgaF92ikgi8DkJZTEKS8sXBHe30adDGrz ZWN4O5mygryqP7eNMG3JV/ixxGnaOZsMWvHyGifBnr5HrQ41C+dW028wMbdm+zRk0CYs +RIE/5MPh5LsrX8CZBkrjZR+YYnN3breIOIUgeOgYBJRzzyAx+R11Y97yKzAxMaxCOQ2 dFOr7JpEEMznmNKmheaLm0PSeZHPwpUnrxILH6vOvD19YDxYI1l7+uUCj0vzhkBaajq+ ZujQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=Qr5R52rHMqO4ZCWXfxGqaXGgIsdYxTsy6aODkPEG9fc=; b=C8baJs8p5WC9A/UB6v+3CV3aWLo1T/P4m11CY0axb/6gikj9Nkx6T5qEH/YbzE0YnL Q/Y0MhpEoZm9LHkYon+tYfKW1Bm0dzGXYrS6dZ5nOG5xW6muT6LZWAQDtoWEIFZidC42 MoLUZN4ZSggqUxDPOtCknYh4Ynfq3WKTYQev9i1SSekIp+SvtuChqnUnXwG4BTweTG7s KjGn4F29+uDzrOSmMLaxAAh9YNu76HY4sKTHKyQYRFvTbs4QQYW69Na0mooQfp+OwynT Zz5Mf5ZVsqfz3OPQ/MThAZrJ5qf2MKOCcQ9MP/fLjXQWyF0RMBg3riFSq4Rwyd5qM+DX eQCA== X-Gm-Message-State: AOAM532vC39syKBehrAwVWIdhirSRsAhgccwAw12gop5ewGKDC//2l5P sO4iK+bMoGrSaJcGfveUzAYu+E86Pzo= X-Google-Smtp-Source: ABdhPJxDuE4qnt4HAybDm/dde6TmTyfexO+3SdrRzce06iKM8wois9DODJVrrKsci1siVqINrFR8gg== X-Received: by 2002:a50:d8c2:: with SMTP id y2mr10334092edj.360.1632865459410; Tue, 28 Sep 2021 14:44:19 -0700 (PDT) Received: from lelap.lan (catv-213-222-131-28.catv.broadband.hu. [213.222.131.28]) by smtp.gmail.com with ESMTPSA id c11sm173913edk.68.2021.09.28.14.44.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Sep 2021 14:44:18 -0700 (PDT) From: Attila Lendvai Date: Tue, 28 Sep 2021 23:40:45 +0200 Message-Id: <20210928214044.437-1-attila@lendvai.name> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::529; envelope-from=attila.lendvai@gmail.com; helo=mail-ed1-x529.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -0.8 (/) 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.8 (-) * guix/build/union.scm (resolve-collision/alphanumeric-last): New function. (warn-about-collision): Renamed to default-collision-resolver. --- this should work, but i cannot test it, because srfi-43 seems not to be available on the build side: unpacking bootstrap Guile to '/home/alendvai/workspace/guix/guix/test-tmp/store/qky0jf68rr7pnsvmhj0ay42rzh4qk6r9-guile-bootstrap-2.0'... [...] output without sfri-43.go and then unsurprisingly: "no code for module (srfi srfi-43)" is tis only a peculiarity of the test environment? can you please advise how to proceed? guix/build/union.scm | 26 ++++++++++++++++++++------ guix/gexp.scm | 2 +- tests/union.scm | 9 +++++++++ 3 files changed, 30 insertions(+), 7 deletions(-) diff --git a/guix/build/union.scm b/guix/build/union.scm index 961ac3298b..747902ec6c 100644 --- a/guix/build/union.scm +++ b/guix/build/union.scm @@ -23,11 +23,12 @@ #:use-module (ice-9 format) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) + #:use-module (srfi srfi-43) #:use-module (rnrs bytevectors) #:use-module (rnrs io ports) #:export (union-build - warn-about-collision + default-collision-resolver relative-file-name symlink-relative)) @@ -102,10 +103,23 @@ identical, #f otherwise." ;; applications via 'glib-or-gtk-build-system'. '("icon-theme.cache" "gschemas.compiled")) -(define (warn-about-collision files) - "Handle the collision among FILES by emitting a warning and choosing the -first one of THEM." - (let ((file (first files))) +(define (resolve-collision/alphanumeric-last files) + ;; Let's do a stable-sort at least, so that multiple foo-1.2.3/bin/foo + ;; variants will predictably resolve to the highest versioned one. + (let* ((original-files (list->vector files)) + (count (vector-length original-files)) + (stripped-files (vector-map (lambda (_ el) + (strip-store-file-name el)) + original-files)) + (indices (vector-unfold values count))) + (stable-sort! indices + (lambda (a b) + (string> (vector-ref stripped-files a) + (vector-ref stripped-files b)))) + (vector-ref original-files (vector-ref indices 0)))) + +(define (default-collision-resolver files) + (let ((file (resolve-collision/alphanumeric-last files))) (unless (member (basename file) %harmless-collisions) (format (current-error-port) "~%warning: collision encountered:~%~{ ~a~%~}" @@ -117,7 +131,7 @@ first one of THEM." #:key (log-port (current-error-port)) (create-all-directories? #f) (symlink symlink) - (resolve-collision warn-about-collision)) + (resolve-collision default-collision-resolver)) "Build in the OUTPUT directory a symlink tree that is the union of all the INPUTS, using SYMLINK to create symlinks. As a special case, if CREATE-ALL-DIRECTORIES?, creates the subdirectories in the output directory to diff --git a/guix/gexp.scm b/guix/gexp.scm index f3d278b3e6..32e8748443 100644 --- a/guix/gexp.scm +++ b/guix/gexp.scm @@ -1983,7 +1983,7 @@ This yields an 'etc' directory containing these two files." (define* (directory-union name things #:key (copy? #f) (quiet? #f) - (resolve-collision 'warn-about-collision)) + (resolve-collision 'default-collision-resolver)) "Return a directory that is the union of THINGS, where THINGS is a list of file-like objects denoting directories. For example: diff --git a/tests/union.scm b/tests/union.scm index a8387edf42..cbf8840793 100644 --- a/tests/union.scm +++ b/tests/union.scm @@ -204,4 +204,13 @@ ("/a/b" "/a/b/c/d" => "c/d") ("/a/b/c" "/a/d/e/f" => "../../d/e/f"))) +(test-assert "resolve-collision/alphanumeric-last sorts alphanumerically" + (string= + ((@@ (guix build union) resolve-collision/alphanumeric-last) + (list "/gnu/store/c0000000000000000000000000000000-idris-0.0.0/bin/idris" + "/gnu/store/60000000000000000000000000000000-idris-2.0.0/bin/idris" + "/gnu/store/z0000000000000000000000000000000-idris-1.3.5/bin/idris" + "/gnu/store/00000000000000000000000000000000-idris-1.3.3/bin/idris")) + "/gnu/store/60000000000000000000000000000000-idris-2.0.0/bin/idris")) + (test-end) -- 2.33.0 From unknown Fri Jun 13 11:07:10 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50878] [PATCH] union: Resolve collisions by stable-sort'ing them. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 29 Sep 2021 13:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50878 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Attila Lendvai , 50878@debbugs.gnu.org Received: via spool by 50878-submit@debbugs.gnu.org id=B50878.163292330410376 (code B ref 50878); Wed, 29 Sep 2021 13:49:02 +0000 Received: (at 50878) by debbugs.gnu.org; 29 Sep 2021 13:48:24 +0000 Received: from localhost ([127.0.0.1]:48092 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVZwe-0002hI-9K for submit@debbugs.gnu.org; Wed, 29 Sep 2021 09:48:24 -0400 Received: from xavier.telenet-ops.be ([195.130.132.52]:39744) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVZwa-0002h7-Je for 50878@debbugs.gnu.org; Wed, 29 Sep 2021 09:48:22 -0400 Received: from ptr-bvsjgyjmffd7q9timvx.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d]) by xavier.telenet-ops.be with bizsmtp id zpoJ250050mfAB401poJ6v; Wed, 29 Sep 2021 15:48:18 +0200 Message-ID: <530e2ad39a865b57f4a0049e862af0d23ac4c592.camel@telenet.be> From: Maxime Devos Date: Wed, 29 Sep 2021 15:48:00 +0200 In-Reply-To: <20210928214044.437-1-attila@lendvai.name> References: <20210928214044.437-1-attila@lendvai.name> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-WosXeC3PWMLCGJ8a82mj" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1632923298; bh=S7QhvUaZ5zUo3LmHKNo0wvMJOk3S9qcEkp2Tj4ZN3jM=; h=Subject:From:To:Date:In-Reply-To:References; b=pBeecuH2V/cuL5fnlmiwQpHnFTDhe3I/EP4GNkqjS1Pbhueewc8tmIJUsN2tvCxK2 F2KY+9IHYMnXYI9ZliliTjRu8YAAKfwh2gIehqR41fRTZAQjN4uJ1mmCkNlbY5ipk+ aRiJX8fMVyygxfzm2et9Sr9IZMjcgToSJac3/4GT0s294BW/ZYScouWgJzmdqN1A+b yWBf/8IXpqfMcv1y/avVla2amD0OYRGSgqFGOz7mkU2P8DbbwZzNE5l5PniRnf7/Mc tfwh+A7xz02LxR88m2NlY3epCnjriyxGLInu5OO4cQ+5+HX0NgqR8U5TK0SBtFksrL 9fdic1F+kr2dg== X-Spam-Score: -0.7 (/) 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.7 (-) --=-WosXeC3PWMLCGJ8a82mj Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attila Lendvai schreef op di 28-09-2021 om 23:40 [+0200]: > * guix/build/union.scm (resolve-collision/alphanumeric-last): New functio= n. > (warn-about-collision): Renamed to default-collision-resolver. > --- >=20 > this should work, but i cannot test it, because srfi-43 seems not to be > available on the build side: >=20 > unpacking bootstrap Guile to '/home/alendvai/workspace/guix/guix/test-tmp= /store/qky0jf68rr7pnsvmhj0ay42rzh4qk6r9-guile-bootstrap-2.0'... > [...] output without sfri-43.go >=20 > and then unsurprisingly: "no code for module (srfi srfi-43)" SRFI-43 is in Guile since Guile 2.0.10, according to Guile's NEWS. The bootstrap guile is older: $(guix build -e '(@@ (gnu packages bootstrap) %bootstrap-guile)')/bin/guile= --version guile (GNU Guile) 2.0.9 [...] Greetings, Maxime. --=-WosXeC3PWMLCGJ8a82mj Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYVRukRccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7poCAQDxE3F4TznHt8S4PHyqKy7V51Zu gQtLUeR/EZB7Z2gb5QEApzobTsrjrUXE+4/c/ottb9IKTu9xLda0X1gSctJNfQ8= =xEFr -----END PGP SIGNATURE----- --=-WosXeC3PWMLCGJ8a82mj-- From unknown Fri Jun 13 11:07:10 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50878] [PATCH] union: Resolve collisions by stable-sort'ing them. Resent-From: Attila Lendvai Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 29 Sep 2021 16:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50878 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxime Devos Cc: 50878@debbugs.gnu.org Reply-To: Attila Lendvai Received: via spool by 50878-submit@debbugs.gnu.org id=B50878.163293140618948 (code B ref 50878); Wed, 29 Sep 2021 16:04:02 +0000 Received: (at 50878) by debbugs.gnu.org; 29 Sep 2021 16:03:26 +0000 Received: from localhost ([127.0.0.1]:49963 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVc3K-0004vY-JJ for submit@debbugs.gnu.org; Wed, 29 Sep 2021 12:03:26 -0400 Received: from mail2.protonmail.ch ([185.70.40.22]:64839) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVc3F-0004vE-V3 for 50878@debbugs.gnu.org; Wed, 29 Sep 2021 12:03:25 -0400 Date: Wed, 29 Sep 2021 16:03:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lendvai.name; s=protonmail2; t=1632931394; bh=HvgA87kGByUcCLym+9+hwuv/UXyhLP75+WqcyF5tHZo=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=uo6olleD9hJxN4azPzocbKGNsXzQu6XQbYx6AWtwGTc18BT1zQ+NjTBjWSNV1R0GE CtMFBQ/Cz5xlRD64YMIBC3m2taQ2e7UYaHldSwkR22l8MJ0D80EwX3hAoBSuK0vZna CnMVkH/7k/H2bUxEBadFMZlpQJx8nB7sgKoH2lBpIE88q8coQkKBaTUqJm3OcK0sQ9 /Ny09Y3RJjUC1NfQdMRyAYsxd7vxVJhOwwl65vbB/JjnhbAeHKxgCpGAg2JMG2K/8A OgPlHgqPAeK3FpOdwrjyqdA2c1SE1vGk9iTmLOH8ABmjM+1mAs4vfEQbK9Vm9RiVZn h5+18nKI1eoUA== From: Attila Lendvai Message-ID: <9gdtvXBJqCfaLCQswTjsN95-pmgfMzqlELlgJEH0o2n_WyWE8LTncnQCIMTEnjFiKO1gKSBMukitcmbQv5FNWRVUc6PLbLBIdQDype7SDLk=@lendvai.name> In-Reply-To: <530e2ad39a865b57f4a0049e862af0d23ac4c592.camel@telenet.be> References: <20210928214044.437-1-attila@lendvai.name> <530e2ad39a865b57f4a0049e862af0d23ac4c592.camel@telenet.be> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch X-Spam-Score: -0.0 (/) 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 (-) > SRFI-43 is in Guile since Guile 2.0.10, according to Guile's NEWS. > The bootstrap guile is older: > > $(guix build -e '(@@ (gnu packages bootstrap) %bootstrap-guile)')/bin/gui= le --version > > guile (GNU Guile) 2.0.9 thank you for the analysis! is it easy and desirable to upgrade it to 2.0.10 or newer? shall i try to do it, or advocate for it if it's not trivial, by e.g. opening an issue? - attila PGP:=C2=A05D5F 45C7 DFCD 0A39 From unknown Fri Jun 13 11:07:10 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50878] [PATCH] union: Resolve collisions by stable-sort'ing them. Resent-From: Liliana Marie Prikler Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 29 Sep 2021 17:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50878 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Attila Lendvai , 50878@debbugs.gnu.org Received: via spool by 50878-submit@debbugs.gnu.org id=B50878.163293738730593 (code B ref 50878); Wed, 29 Sep 2021 17:44:02 +0000 Received: (at 50878) by debbugs.gnu.org; 29 Sep 2021 17:43:07 +0000 Received: from localhost ([127.0.0.1]:50129 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVdbn-0007xN-85 for submit@debbugs.gnu.org; Wed, 29 Sep 2021 13:43:07 -0400 Received: from mail-wr1-f53.google.com ([209.85.221.53]:39592) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVdbl-0007wn-36 for 50878@debbugs.gnu.org; Wed, 29 Sep 2021 13:43:05 -0400 Received: by mail-wr1-f53.google.com with SMTP id d26so5609748wrb.6 for <50878@debbugs.gnu.org>; Wed, 29 Sep 2021 10:43:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=G916XrlrGaXMyLnraJ1g/0J6/icsrjzBUinph+KTLMI=; b=OlQP/dqGZ1Mve8uTNJzsWAdRKw42d2r8ITFFdylU+U6Ya77NTHplW4dAFz8PFNQ7Jv FR7Y9O7fMP0gDek0xBQx8phz7O6P8LSEsyUnO/8slutP5+06F1dPDe46WJDJoy/OLFmV TEg6MXF1ELoKLO3B68tNnzxqvo1rwGQ3VslNCe2lVMbJ0BboAZx5zTKLTzAuNhoU5gmr LMrmHkkzStRP1Ht9SIUFZzgmz2Ws0ltwYosOvihnuzWeYibimCzrpxm9Zk1i+ZLyLt2E kOru9bvjsBkp0FzmGbfrs4T5vDEY84GDhBDwoHiDWTSRGkcPagFMJL1QjHLlUVTmBbkr K5fA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=G916XrlrGaXMyLnraJ1g/0J6/icsrjzBUinph+KTLMI=; b=Y4t+ij8VEYRFubsZZsP8O5R9zeiOUpfo16hiBcpqcuTgn36FAgfA6S+7XTJAEwkdGf QrmrQ3Bbx5KD/hn0CYy92DJT4Eybn4fM/HThdxQS/nYJWlI3yqt31GBlk/tpLlNm4cPq PEWCAh5WuFAmfTOcNnSK+YUCTLPdrSQM2FMGV/y9OyPhcI7B7xAV8HW8R8r3pilRvBac OM/DPEuVuf+EFTkMOmPXOcMTFsbJ5DsQslNP2po+4/DfTrysMzz79wF/WLF5vozZyva2 l0bZ+0eVCFdKBQPGk2xI9lSflPSkyHyJefiILmV0oMHtrjRZAOiEwAyfHdQ3mYFb4IST roJQ== X-Gm-Message-State: AOAM5331MgEoxaS9Ph4f0AHk7+M+Aaf7FYruSeBztqZdJgzQQ95iBcEL aO8OwtKSdzUWioktYpOiZ70ZaU1lcc0= X-Google-Smtp-Source: ABdhPJwyIWRi7isoaNyeZXs/Tnl/J+Nx7liiwkN8Qhllw8gMODikAJPYkwbKKHPMNRe9S/VB67VzOA== X-Received: by 2002:adf:a10f:: with SMTP id o15mr1430476wro.286.1632937379468; Wed, 29 Sep 2021 10:42:59 -0700 (PDT) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id 10sm2162288wmi.1.2021.09.29.10.42.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Sep 2021 10:42:58 -0700 (PDT) Message-ID: <57f1435fd83da8c0e0acaef64d5f08e4ca7b3404.camel@gmail.com> From: Liliana Marie Prikler Date: Wed, 29 Sep 2021 19:42:57 +0200 In-Reply-To: <20210928214044.437-1-attila@lendvai.name> References: <20210928214044.437-1-attila@lendvai.name> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) 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, Am Dienstag, den 28.09.2021, 23:40 +0200 schrieb Attila Lendvai: > [...] > index 961ac3298b..747902ec6c 100644 > --- a/guix/build/union.scm > +++ b/guix/build/union.scm > @@ -23,11 +23,12 @@ > #:use-module (ice-9 format) > #:use-module (srfi srfi-1) > #:use-module (srfi srfi-26) > + #:use-module (srfi srfi-43) > #:use-module (rnrs bytevectors) > #:use-module (rnrs io ports) > #:export (union-build > > - warn-about-collision > + default-collision-resolver > > relative-file-name > symlink-relative)) > @@ -102,10 +103,23 @@ identical, #f otherwise." > ;; applications via 'glib-or-gtk-build-system'. > '("icon-theme.cache" "gschemas.compiled")) > > -(define (warn-about-collision files) > - "Handle the collision among FILES by emitting a warning and > choosing the > -first one of THEM." > - (let ((file (first files))) > +(define (resolve-collision/alphanumeric-last files) > + ;; Let's do a stable-sort at least, so that multiple foo- > 1.2.3/bin/foo > + ;; variants will predictably resolve to the highest versioned one. > + (let* ((original-files (list->vector files)) > + (count (vector-length original-files)) > + (stripped-files (vector-map (lambda (_ el) > + (strip-store-file-name el)) > + original-files)) > + (indices (vector-unfold values count))) > + (stable-sort! indices > + (lambda (a b) > + (string> (vector-ref stripped-files a) > + (vector-ref stripped-files b)))) > + (vector-ref original-files (vector-ref indices 0)))) Instead of stable-sort!-ing the indices of a vector, what about stable- sort!-ing (map strip-store-file-name original-files) in more or less one go? > +(define (default-collision-resolver files) > + (let ((file (resolve-collision/alphanumeric-last files))) > (unless (member (basename file) %harmless-collisions) > (format (current-error-port) > "~%warning: collision encountered:~%~{ ~a~%~}" > @@ -117,7 +131,7 @@ first one of THEM." > #:key (log-port (current-error-port)) > (create-all-directories? #f) > (symlink symlink) > - (resolve-collision warn-about-collision)) > + (resolve-collision default-collision- > resolver)) > "Build in the OUTPUT directory a symlink tree that is the union of > all the > INPUTS, using SYMLINK to create symlinks. As a special case, if > CREATE-ALL-DIRECTORIES?, creates the subdirectories in the output > directory to I don't think the default collision resolver ought to sort the files. The rationale behind ignoring certain collisions, e.g. icon caches relies on the fact that Guix will use the correct files because they are put first in the manifest. The hooks themselves have no special names that could put them "always first" and profiles are themselves union-built. I do however support the addition of sorting methods as collision resolvers in general and would welcome a way of doing so for profiles pre-hook. Regards, Liliana From unknown Fri Jun 13 11:07:10 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50878] [PATCH] union: Resolve collisions by stable-sort'ing them. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 29 Sep 2021 21:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50878 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Attila Lendvai Cc: 50878@debbugs.gnu.org Received: via spool by 50878-submit@debbugs.gnu.org id=B50878.163294921026974 (code B ref 50878); Wed, 29 Sep 2021 21:01:01 +0000 Received: (at 50878) by debbugs.gnu.org; 29 Sep 2021 21:00:10 +0000 Received: from localhost ([127.0.0.1]:50456 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVggT-00070z-P3 for submit@debbugs.gnu.org; Wed, 29 Sep 2021 17:00:09 -0400 Received: from michel.telenet-ops.be ([195.130.137.88]:52368) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVggR-0006zr-9Z for 50878@debbugs.gnu.org; Wed, 29 Sep 2021 17:00:08 -0400 Received: from ptr-bvsjgyjmffd7q9timvx.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d]) by michel.telenet-ops.be with bizsmtp id zx052500a0mfAB406x05k5; Wed, 29 Sep 2021 23:00:06 +0200 Message-ID: <297b9f7f0924f14fa52dcd3689b233edd5d45275.camel@telenet.be> From: Maxime Devos Date: Wed, 29 Sep 2021 23:00:05 +0200 In-Reply-To: <9gdtvXBJqCfaLCQswTjsN95-pmgfMzqlELlgJEH0o2n_WyWE8LTncnQCIMTEnjFiKO1gKSBMukitcmbQv5FNWRVUc6PLbLBIdQDype7SDLk=@lendvai.name> References: <20210928214044.437-1-attila@lendvai.name> <530e2ad39a865b57f4a0049e862af0d23ac4c592.camel@telenet.be> <9gdtvXBJqCfaLCQswTjsN95-pmgfMzqlELlgJEH0o2n_WyWE8LTncnQCIMTEnjFiKO1gKSBMukitcmbQv5FNWRVUc6PLbLBIdQDype7SDLk=@lendvai.name> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-hwUjvhdmv8rR/eNInDOG" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1632949206; bh=M6OJBvW0xbXePLTDrNnffmcOK4VKmn9rSfNDYSTPIiA=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=KZ/QgWL72Dp4RepKBkdelizYAQClKZBEBYxmR0w1yW2RmqJ5k353ZFQheeiGGs54Q jPpkZ71YJbkZ+Oxp7sY+hlGNYI8z+fVPh+CoMP/x7bFJYBxRe0/O0F7U22iqT57/r0 sk83qTKAeHf/hS9KqL2VnCsxr8uCBw/zZIlyBeAVGFp344qt5zAFKuEHYWQTvypi8Z dMAdsfdPNSaqAEdFNk7k/ihpsbE21YUqW1LqI7m6w93sLUQmeuY2aEavlEJL1a7V+u JL8kr8kvqlHllyC9YM1SJaQZcDev9oL7YNdhAHxhAR+G8T0hvoLb9dI0qOgnmi8k30 Ut7hlRRoiu7FA== X-Spam-Score: -0.7 (/) 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.7 (-) --=-hwUjvhdmv8rR/eNInDOG Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attila Lendvai schreef op wo 29-09-2021 om 16:03 [+0000]: > > SRFI-43 is in Guile since Guile 2.0.10, according to Guile's NEWS. > > The bootstrap guile is older: > >=20 > > $(guix build -e '(@@ (gnu packages bootstrap) %bootstrap-guile)')/bin/g= uile --version > >=20 > > guile (GNU Guile) 2.0.9 >=20 > thank you for the analysis! >=20 > is it easy and desirable to upgrade it to 2.0.10 or newer? It's possible by modifying 'bootstrap-guile-url-path' and 'bootstrap-guile-hash'. Apparently, some architectures already use a newer guile. E.g., aarch64 has 2.0.14. However, this probably would entail a world-rebuild I think, so this probably needs to be done on core-updates. Why limit to guile 2.0.10, why not go for guile 3.0.7 instead? I don't kow how one would go about updating the bootstrap binaries though. Anyway, there have been quite a few bug fixes and new features since 2.0.9, and updating to guile 3.0.? would allow dropping some compatibility code in various guix/build/, so I wouldn't be opposed to such a change. Greetings, Maxime --=-hwUjvhdmv8rR/eNInDOG Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYVTT1RccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7pDQAQCiV7aq9RbNZ050FH3VqRfGp2WO PBE/9H9es+hsEGXYmAD+Kz7uoug5EwS84emjdNlrbiS1ePi7/engCydav8gNEg4= =S5ee -----END PGP SIGNATURE----- --=-hwUjvhdmv8rR/eNInDOG-- From unknown Fri Jun 13 11:07:10 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50878] [PATCH] union: Resolve collisions by stable-sort'ing them. Resent-From: Attila Lendvai Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 30 Sep 2021 08:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50878 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Liliana Marie Prikler Cc: 50878@debbugs.gnu.org Reply-To: Attila Lendvai Received: via spool by 50878-submit@debbugs.gnu.org id=B50878.163298946822485 (code B ref 50878); Thu, 30 Sep 2021 08:12:02 +0000 Received: (at 50878) by debbugs.gnu.org; 30 Sep 2021 08:11:08 +0000 Received: from localhost ([127.0.0.1]:51392 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVr9o-0005qb-HK for submit@debbugs.gnu.org; Thu, 30 Sep 2021 04:11:08 -0400 Received: from mail-40133.protonmail.ch ([185.70.40.133]:51442) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVr9j-0005q5-RD for 50878@debbugs.gnu.org; Thu, 30 Sep 2021 04:11:08 -0400 Date: Thu, 30 Sep 2021 08:10:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lendvai.name; s=protonmail2; t=1632989453; bh=IgR4Xdxn9r8J2ggAbxf6UomV9BVRdHITHMDsyhpKxoU=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=AL1Eh3atoNKMEv9OlSrE2MSbbip1rrbturLy2Gw7Epv/NSDz2I1mNOjl4HxfjYPaa S2IMKd2x5mbhJ252tB8uaH+XImwZbbtJmAkFLjB87DNi/TUAgieEvDg1WlZbCb+ydM qkxmwgipoLYPNJqM3JZBbb6/3OSPelQXIdqRKSFogrT5bGbhiGqsNuTaCyGcXlxpiF udWlI6HwFMD1oA8yqlR70bHLatqAEzma48jRxc2ikHCLzbYCYgbDnIl0IRgXP3Ae7N ePQKlb7QLPDy8KZQqC1MckWJyAEbUbmpkoShnhkRu+ZVvyqbJzi0b6BC0u3HvC6NI5 VJd3CAzuZyJVA== From: Attila Lendvai Message-ID: In-Reply-To: <57f1435fd83da8c0e0acaef64d5f08e4ca7b3404.camel@gmail.com> References: <20210928214044.437-1-attila@lendvai.name> <57f1435fd83da8c0e0acaef64d5f08e4ca7b3404.camel@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch X-Spam-Score: -0.0 (/) 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 (-) > > - (let* ((original-files (list->vector files)) > > - (count (vector-length original-files)) > > - (stripped-files (vector-map (lambda (_ el) > > - (strip-store-file-name el)) > > - original-files)) > > - (indices (vector-unfold values count))) > > > > - (stable-sort! indices > > - (lambda (a b) > > - (string> (vector-ref stripped-files a) > > - (vector-ref stripped-files b)))) > > - (vector-ref original-files (vector-ref indices 0)))) > > Instead of stable-sort!-ing the indices of a vector, what about stable- > sort!-ing (map strip-store-file-name original-files) in more or less > one go? the hash also needs to be dropped from the path for sorting to be useful, but the return value must be the full path, hence the complexity with sorting the indices, pointing both to the full paths and the cut parts. > I don't think the default collision resolver ought to sort the files. > > The rationale behind ignoring certain collisions, e.g. icon caches > relies on the fact that Guix will use the correct files because they > are put first in the manifest. The hooks themselves have no special > names that could put them "always first" and profiles are themselves > union-built. > > I do however support the addition of sorting methods as collision > resolvers in general and would welcome a way of doing so for profiles > pre-hook. please note that i almost completely lack the knowledge of the relevant internals. with that in mind, do i read you right? this should add a new exported resolver funtion, and leave the default one as it was? and use the new resolver somewhere (where?) that will affect only the union of profiles, i.e. user visible effecs when installing software? (because DIRECTORY-UNION is called in other contexts also?) thanks for the insights! i'd appreciate a bit more higher level guidance, and then i'll resend the patch accordingly. - attila PGP:=C2=A05D5F 45C7 DFCD 0A39 From unknown Fri Jun 13 11:07:10 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50878] [PATCH] union: Resolve collisions by stable-sort'ing them. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 30 Sep 2021 08:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50878 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Attila Lendvai , Liliana Marie Prikler Cc: 50878@debbugs.gnu.org Received: via spool by 50878-submit@debbugs.gnu.org id=B50878.163299133725418 (code B ref 50878); Thu, 30 Sep 2021 08:43:01 +0000 Received: (at 50878) by debbugs.gnu.org; 30 Sep 2021 08:42:17 +0000 Received: from localhost ([127.0.0.1]:51430 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVrdw-0006bu-Kn for submit@debbugs.gnu.org; Thu, 30 Sep 2021 04:42:16 -0400 Received: from andre.telenet-ops.be ([195.130.132.53]:40926) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVrdv-0006bl-7p for 50878@debbugs.gnu.org; Thu, 30 Sep 2021 04:42:15 -0400 Received: from ptr-bvsjgyjmffd7q9timvx.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d]) by andre.telenet-ops.be with bizsmtp id 08iD2600b0mfAB4018iD1H; Thu, 30 Sep 2021 10:42:13 +0200 Message-ID: <9ab183637e8cd645267a37ba0f05319f8b3c72ff.camel@telenet.be> From: Maxime Devos Date: Thu, 30 Sep 2021 10:42:13 +0200 In-Reply-To: References: <20210928214044.437-1-attila@lendvai.name> <57f1435fd83da8c0e0acaef64d5f08e4ca7b3404.camel@gmail.com> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-xAkXBPzk4Ga+/IzCabQk" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1632991333; bh=Ini9LBTP75/Jt2IlI6aq3aUFrnHRvArVWYGm2CbcfQg=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=GEoDf3TEEEkwW/G/8Yxi7ENkDK7keVkjC72uRSRuEqfz5gtj9OOnXSZ3Mhqus+nq1 mI3sji6YJM7FI1L2S/lL0G7QI2uFI1FF2UHUPg9dbVH4MsACyMq3txnJsSK+YfEYU1 t7fpBXuL3ZbDo3B6tJT8DcScwg7VQZuqD2T+zwtGJJhgqj7isgCLSdSVI9xsbWF6s2 IRK3pPZPyrZvAPYh6gMf6J5g/2og2bSvdmsnuRinShocuyx9xVP/5OPutwS05EHv3G jncjq7S49L3/kN83J3ihFjTT80be7F9mPrjmJ6NEmuwsJ95EtJlo7GtuiDBslGds0k JZGdp6lfL8gjQ== X-Spam-Score: -0.7 (/) 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.7 (-) --=-xAkXBPzk4Ga+/IzCabQk Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attila Lendvai schreef op do 30-09-2021 om 08:10 [+0000]: > > > - (let* ((original-files (list->vector files)) > > > - (count (vector-length original-files)) > > > - (stripped-files (vector-map (lambda (_ el) > > > - (strip-store-file-name el)) > > > - original-files)) > > > - (indices (vector-unfold values count))) > > >=20 > > > - (stable-sort! indices > > > - (lambda (a b) > > > - (string> (vector-ref stripped-files a) > > > - (vector-ref stripped-files b)))) > > > - (vector-ref original-files (vector-ref indices 0)))) > >=20 > > Instead of stable-sort!-ing the indices of a vector, what about stable- > > sort!-ing (map strip-store-file-name original-files) in more or less > > one go? >=20 > the hash also needs to be dropped from the path for sorting to be > useful, but the return value must be the full path, hence the > complexity with sorting the indices, pointing both to the full paths > and the cut parts. You can replace the 'less' argument of 'stable-sort'. Example sorting by the second character of a string: (sort '("za" "yb" "xc") (lambda (x y) (char>? (string-ref x 1) (string-ref y 1))))) IIUC, you would need to replace char>? by string> and string-ref by strip-store-file-name. Greetings, Maxime. --=-xAkXBPzk4Ga+/IzCabQk Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYVV4ZRccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7vNkAQDAgk7tcyMnnpquDZroTaTWfQMD JhFccN39qFLYapM/UAD+MMzwqIvnbNtf/Qq88FMnBVURdP/RP3pIvMBpx77xmwE= =YJvu -----END PGP SIGNATURE----- --=-xAkXBPzk4Ga+/IzCabQk-- From unknown Fri Jun 13 11:07:10 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50878] [PATCH] union: Resolve collisions by stable-sort'ing them. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 30 Sep 2021 14:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50878 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxime Devos Cc: Attila Lendvai , Liliana Marie Prikler , 50878@debbugs.gnu.org Received: via spool by 50878-submit@debbugs.gnu.org id=B50878.16330104492752 (code B ref 50878); Thu, 30 Sep 2021 14:01:01 +0000 Received: (at 50878) by debbugs.gnu.org; 30 Sep 2021 14:00:49 +0000 Received: from localhost ([127.0.0.1]:53565 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVwcD-0000iK-8T for submit@debbugs.gnu.org; Thu, 30 Sep 2021 10:00:49 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37498) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVwcA-0000i3-W6 for 50878@debbugs.gnu.org; Thu, 30 Sep 2021 10:00:47 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:47270) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mVwc4-0002hZ-KA; Thu, 30 Sep 2021 10:00:40 -0400 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=60506 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mVwby-00006w-PH; Thu, 30 Sep 2021 10:00:39 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20210928214044.437-1-attila@lendvai.name> <57f1435fd83da8c0e0acaef64d5f08e4ca7b3404.camel@gmail.com> <9ab183637e8cd645267a37ba0f05319f8b3c72ff.camel@telenet.be> Date: Thu, 30 Sep 2021 16:00:32 +0200 In-Reply-To: <9ab183637e8cd645267a37ba0f05319f8b3c72ff.camel@telenet.be> (Maxime Devos's message of "Thu, 30 Sep 2021 10:42:13 +0200") Message-ID: <87czoq40zj.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) 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, Maxime Devos skribis: > Attila Lendvai schreef op do 30-09-2021 om 08:10 [+0000]: >> > > - (let* ((original-files (list->vector files)) >> > > - (count (vector-length original-files)) >> > > - (stripped-files (vector-map (lambda (_ el) >> > > - (strip-store-file-name el)) >> > > - original-files)) >> > > - (indices (vector-unfold values count))) >> > >=20 >> > > - (stable-sort! indices >> > > - (lambda (a b) >> > > - (string> (vector-ref stripped-files a) >> > > - (vector-ref stripped-files b)))) >> > > - (vector-ref original-files (vector-ref indices 0)))) >> >=20 >> > Instead of stable-sort!-ing the indices of a vector, what about stable- >> > sort!-ing (map strip-store-file-name original-files) in more or less >> > one go? >>=20 >> the hash also needs to be dropped from the path for sorting to be >> useful, but the return value must be the full path, hence the >> complexity with sorting the indices, pointing both to the full paths >> and the cut parts. > > You can replace the 'less' argument of 'stable-sort'. > Example sorting by the second character of a string: > > (sort '("za" "yb" "xc") (lambda (x y) > (char>? (string-ref x 1) > (string-ref y 1))))) > > IIUC, you would need to replace char>? by string> and string-ref > by strip-store-file-name. Agreed. I=E2=80=99d advice using this strategy rather than resorting to SRFI-43; it should have the desired effect. BTW, because TeX Live packages rely on =E2=80=98union-build=E2=80=99, this = patch triggers a lot of rebuilds, but we can try to squeeze it in the upcoming =E2=80=98core-updates-frozen=E2=80=99 rebuild. Thanks, Ludo=E2=80=99. From unknown Fri Jun 13 11:07:10 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50878] [PATCH] union: Resolve collisions by stable-sort'ing them. Resent-From: Attila Lendvai Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 30 Sep 2021 14:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50878 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxime Devos Cc: Liliana Marie Prikler , 50878@debbugs.gnu.org Reply-To: Attila Lendvai Received: via spool by 50878-submit@debbugs.gnu.org id=B50878.16330111644130 (code B ref 50878); Thu, 30 Sep 2021 14:13:01 +0000 Received: (at 50878) by debbugs.gnu.org; 30 Sep 2021 14:12:44 +0000 Received: from localhost ([127.0.0.1]:53582 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVwnj-00014X-Lg for submit@debbugs.gnu.org; Thu, 30 Sep 2021 10:12:43 -0400 Received: from mail1.protonmail.ch ([185.70.40.18]:21316) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVwnf-00014A-8O for 50878@debbugs.gnu.org; Thu, 30 Sep 2021 10:12:42 -0400 Date: Thu, 30 Sep 2021 14:12:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lendvai.name; s=protonmail2; t=1633011152; bh=Duif9VAc48Siy2q8Q+EzT/v0Rg0DydqD0AKXWosJQLQ=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=Apm/84eFU7jyg7BNXgX19qs5Gok9V5s3reHnHZxxPyToA8TO51gXW1tkpjhGy7T+Y Ji6k0Nqjit9yQHogafxwRtrn10SESpZf43fkb35JnsfgEVScL0Eyqr8KiQwRJ1r9Wf 57iFcetccNFvBiCGGaSOk6xTAqigIsLkkzNYUtIsKnRqxzKTX78k4vhBo7Wt8D2Spo aGCoiIorYQxno6mArF/VipJlEthanioBDvHpXJDQ754zGP2TnIhO3jI/SqeDzgUMna qcpgjQbbar8zEYgzxapQzcF/nT3bo3qNqr/GAaWK91Ez30HZ89lJu72S3sJpPUMZcF iGSdk23ZE3nbA== From: Attila Lendvai Message-ID: In-Reply-To: <9ab183637e8cd645267a37ba0f05319f8b3c72ff.camel@telenet.be> References: <20210928214044.437-1-attila@lendvai.name> <57f1435fd83da8c0e0acaef64d5f08e4ca7b3404.camel@gmail.com> <9ab183637e8cd645267a37ba0f05319f8b3c72ff.camel@telenet.be> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch X-Spam-Score: -0.0 (/) 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 (-) > > the hash also needs to be dropped from the path for sorting to be > > useful, but the return value must be the full path, hence the > > complexity with sorting the indices, pointing both to the full paths > > and the cut parts. > > You can replace the 'less' argument of 'stable-sort'. > Example sorting by the second character of a string: > > (sort '("za" "yb" "xc") (lambda (x y) > (char>? (string-ref x 1) > (string-ref y 1))))) i don't know about the expected size of the collision list here, but that would cons much more, because that would cons up two substrings at each comparison, i.e. O(n^2) vs O(n) at least in GC load, probably in time also. i think it's not worth it, but let me know, and then i can simplify the code somewhat at the cost of more consing. sorting lists is probably also much slower than sorting vectors, but there may be some tricks i don't know about. random note: civodul said on IRC that there's a certain reluctancy to update the opaque binary blobs, and the bootstrap guile will be replaced by mes anyway. so, if we want to have this merged, then we will need to give up on testing it until mes becomes the bootstrap scheme (and assuming it will have srfi vectors). in the lights of the above, i think i'll stop pursuing this patch, but i'd be happy to implement something if you can give me highlevel guidance. with the above pointed out, are you still happy with the list sorting? i'd love to have idris packaged so that it has bin/idris symlinked to bin/idris-1.2.3, and installing multiple versions of it would pick the newest one for bin/idris. -- =E2=80=A2 attila lendvai =E2=80=A2 PGP: 963F 5D5F 45C7 DFCD 0A39 -- =E2=80=9CHave the courage to take your own thoughts seriously, for they wil= l shape you.=E2=80=9D =09=E2=80=94 Albert Einstein (1879=E2=80=931955) From unknown Fri Jun 13 11:07:10 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50878] [PATCH] union: Resolve collisions by stable-sort'ing them. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 30 Sep 2021 15:19:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50878 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Attila Lendvai Cc: Liliana Marie Prikler , 50878@debbugs.gnu.org Received: via spool by 50878-submit@debbugs.gnu.org id=B50878.163301509511794 (code B ref 50878); Thu, 30 Sep 2021 15:19:03 +0000 Received: (at 50878) by debbugs.gnu.org; 30 Sep 2021 15:18:15 +0000 Received: from localhost ([127.0.0.1]:53697 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVxp9-00034A-8S for submit@debbugs.gnu.org; Thu, 30 Sep 2021 11:18:15 -0400 Received: from laurent.telenet-ops.be ([195.130.137.89]:43168) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVxp5-00033v-Nt for 50878@debbugs.gnu.org; Thu, 30 Sep 2021 11:18:13 -0400 Received: from ptr-bvsjgyjmffd7q9timvx.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d]) by laurent.telenet-ops.be with bizsmtp id 0FJ72600T0mfAB401FJ71K; Thu, 30 Sep 2021 17:18:08 +0200 Message-ID: <57b644a0b8accceed5d390cd82b2f69d427c464d.camel@telenet.be> From: Maxime Devos Date: Thu, 30 Sep 2021 17:18:01 +0200 In-Reply-To: References: <20210928214044.437-1-attila@lendvai.name> <57f1435fd83da8c0e0acaef64d5f08e4ca7b3404.camel@gmail.com> <9ab183637e8cd645267a37ba0f05319f8b3c72ff.camel@telenet.be> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-Tb+QToDZe9NWCxyVSq+H" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1633015088; bh=7cEcr6W7Xkd82MyN3gwMKBA8g7Bs/FzS1HoC3O3T18M=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=roaJpoY0OsyHSNhN/cNP7ATgflN1zZn9y+Zs3IkAzOvyBZKnK88eixQe9zT8LhRpn ywmwzccU/Lq/WKxUyNXjU0zw37s8B4+lx+Uf984uKiuK3WUPZ63NJQMii5B0jFInVA 9603TC4rtg4zv8xloSCPBCSMPfIO99krqhYfhZGX8t2vb9BZs14Jb+TvLW0hx9XErM OPsOPTtBiVCVW94djriN9rbyaSdq4l1lMhn1YWm5yYPUVuZUfojrD9c07xgkD2trpl 3TeMtFB7p2+xnxRq0ZjYFPYq7FRzdpp5Wqd50Om1CD6KAsTwMtKz3jwUIOl16pX4n2 gavEI3SWhV6Sw== X-Spam-Score: -0.7 (/) 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.7 (-) --=-Tb+QToDZe9NWCxyVSq+H Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attila Lendvai schreef op do 30-09-2021 om 14:12 [+0000]: > > > the hash also needs to be dropped from the path for sorting to be > > > useful, but the return value must be the full path, hence the > > > complexity with sorting the indices, pointing both to the full paths > > > and the cut parts. > >=20 > > You can replace the 'less' argument of 'stable-sort'. > > Example sorting by the second character of a string: > >=20 > > (sort '("za" "yb" "xc") (lambda (x y) > > (char>? (string-ref x 1) > > (string-ref y 1))))) >=20 > i don't know about the expected size of the collision list here, but > that would cons much more, because that would cons up two substrings > at each comparison, i.e. O(n^2) vs O(n) at least in GC load, probably > in time also. I don't see any consing here, or any increase in complexity? > i think it's not worth it, but let me know, and then i can simplify > the code somewhat at the cost of more consing. >=20 > sorting lists is probably also much slower than sorting vectors, but > there may be some tricks i don't know about. I was suggesting replacing the 'less' procedure with a procedure like (lambda (x y) (char>? (string-ref x 1) (string-ref y 1))) instead of doing the sorting in two steps. I wasn't suggesting using lists. The '("za" "yb" "xc") was only for demonstration, a vector should work as well. Greetings, Maxime. --=-Tb+QToDZe9NWCxyVSq+H Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYVXVKRccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7rNpAPkBGWGqP2ymoSNiKlKJoulyD6Xg Q7oOtq5wD8Vl66WSBgD+Nv17xzGCSTdKpY0nRg+mxye2gatFPRikpgIwMdAZUg0= =8wo9 -----END PGP SIGNATURE----- --=-Tb+QToDZe9NWCxyVSq+H-- From unknown Fri Jun 13 11:07:10 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50878] [PATCH] union: Resolve collisions by stable-sort'ing them. Resent-From: Liliana Marie Prikler Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 30 Sep 2021 18:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50878 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxime Devos , Attila Lendvai Cc: 50878@debbugs.gnu.org Received: via spool by 50878-submit@debbugs.gnu.org id=B50878.16330256397050 (code B ref 50878); Thu, 30 Sep 2021 18:14:02 +0000 Received: (at 50878) by debbugs.gnu.org; 30 Sep 2021 18:13:59 +0000 Received: from localhost ([127.0.0.1]:53960 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mW0ZC-0001pe-Sp for submit@debbugs.gnu.org; Thu, 30 Sep 2021 14:13:59 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:55241) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mW0ZB-0001pR-IW for 50878@debbugs.gnu.org; Thu, 30 Sep 2021 14:13:57 -0400 Received: by mail-wm1-f66.google.com with SMTP id s24so5367955wmh.4 for <50878@debbugs.gnu.org>; Thu, 30 Sep 2021 11:13:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=OLYKcBGpQ+I5WRTfS04SBFonATGzEi/IQ+vs8raiO7w=; b=L7waezu5rB4TUEQZ6GpshImvqoo3fv2h58hmYDjb7F8/FLK/VZHKeuL7s4FaosAzia vYRWeldYrpcYXfZCZfOIYMimtGQcN6tneyQ0ohJORXLT+Hp5/dWtLyR7P4qp7H48UhhU MglzbX2uHyCaTo6cWo9m4grH5BD9XMv9FBf96ei2YxtkOIF/GUMza434znELZReK2ju4 KmHEKG54x3kQP0hjnHyIj5W+2hcNDczZOmetx9Ou2uFQ+uj4TR/t8U2s9AXnPwQomw6j 0hzGtDKmbyj5fbapQGFpwuyj5QDE1Mz+ffXyKisA//OFHqNe7Www6Fa/ODs+2XpduOSw A/RQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=OLYKcBGpQ+I5WRTfS04SBFonATGzEi/IQ+vs8raiO7w=; b=pWTJ4MKVatoN2jmsFLNbctmQJwbWY/9pWURm5itwhOLuBdE6wNQqfwZDp9Hi4QzIC9 sbo2euqNic+VGohgH9a1u5xe/Kb/0tTtMazIuelC5pHqs/t4u9eoqWjmTA08BV3tImMk /ZsLEJeduZPGbL2TotM9JB6XQl18LdqnASsHMsWDpQCIpZi0/mO/fGamemunDAshfwau EhNMka5eLmOtthod7tI7Pj+12KsFCgntCz0zNSuXzCVLbqEwjrSeas7/ojKTBwVvqskq N6ZAFjeK8IoyIwXx9LYuv2Cf60cPaF7hHSbYUdd9+qx5bXohYPbv4/oUlPKPdI5paN/z 3qMw== X-Gm-Message-State: AOAM531Fr6e315kojlcrL4BQm+0GEptFNAh7s5VIlajFfh4k745WmK8E KE6PWVKv+piECUm6Mj+ZmOg= X-Google-Smtp-Source: ABdhPJxMzw/1WjFiUBB3QDbJl4guGhovw8dH+nHMb3k96C+azT/3u2hiOxhaaAXsKfxjReRJ8r+JUQ== X-Received: by 2002:a7b:c1d2:: with SMTP id a18mr666737wmj.28.1633025631774; Thu, 30 Sep 2021 11:13:51 -0700 (PDT) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id a18sm2088934wrw.0.2021.09.30.11.13.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 11:13:51 -0700 (PDT) Message-ID: From: Liliana Marie Prikler Date: Thu, 30 Sep 2021 20:13:49 +0200 In-Reply-To: <9ab183637e8cd645267a37ba0f05319f8b3c72ff.camel@telenet.be> References: <20210928214044.437-1-attila@lendvai.name> <57f1435fd83da8c0e0acaef64d5f08e4ca7b3404.camel@gmail.com> <9ab183637e8cd645267a37ba0f05319f8b3c72ff.camel@telenet.be> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) 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 (-) Am Donnerstag, den 30.09.2021, 10:42 +0200 schrieb Maxime Devos: > Attila Lendvai schreef op do 30-09-2021 om 08:10 [+0000]: > > > > - (let* ((original-files (list->vector files)) > > > > - (count (vector-length original-files)) > > > > - (stripped-files (vector-map (lambda (_ el) > > > > - (strip-store-file- > > > > name el)) > > > > - original-files)) > > > > - (indices (vector-unfold values count))) > > > > > > > > - (stable-sort! indices > > > > - (lambda (a b) > > > > - (string> (vector-ref stripped-files a) > > > > - (vector-ref stripped-files > > > > b)))) > > > > - (vector-ref original-files (vector-ref indices 0)))) > > > > > > Instead of stable-sort!-ing the indices of a vector, what about > > > stable- > > > sort!-ing (map strip-store-file-name original-files) in more or > > > less > > > one go? > > > > the hash also needs to be dropped from the path for sorting to be > > useful, but the return value must be the full path, hence the > > complexity with sorting the indices, pointing both to the full > > paths > > and the cut parts. > > You can replace the 'less' argument of 'stable-sort'. > Example sorting by the second character of a string: > > (sort '("za" "yb" "xc") (lambda (x y) > (char>? (string-ref x 1) > (string-ref y 1))))) > > IIUC, you would need to replace char>? by string> and string-ref > by strip-store-file-name. You could also store a mapping of long file name to stripped file name in a hash table for fast lookup, so as to not compute (strip-store- file-name) over and over. That way you can stable-sort! the long names, but don't forget to list-copy them at least for functional purity. Greetings, Liliana From unknown Fri Jun 13 11:07:10 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50878] [PATCH] union: Resolve collisions by stable-sort'ing them. Resent-From: Liliana Marie Prikler Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 30 Sep 2021 18:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50878 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Attila Lendvai Cc: 50878@debbugs.gnu.org Received: via spool by 50878-submit@debbugs.gnu.org id=B50878.163302796810806 (code B ref 50878); Thu, 30 Sep 2021 18:53:02 +0000 Received: (at 50878) by debbugs.gnu.org; 30 Sep 2021 18:52:48 +0000 Received: from localhost ([127.0.0.1]:53993 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mW1Al-0002oC-4h for submit@debbugs.gnu.org; Thu, 30 Sep 2021 14:52:48 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:42966) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mW1Ac-0002ns-M1 for 50878@debbugs.gnu.org; Thu, 30 Sep 2021 14:52:45 -0400 Received: by mail-wm1-f68.google.com with SMTP id q127-20020a1ca785000000b0030cb71ea4d1so5088722wme.1 for <50878@debbugs.gnu.org>; Thu, 30 Sep 2021 11:52:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=pJjNtnT/5UuSplnBkGR5L34KNoNlTDd97jc1nOwmIiY=; b=SyReTgiqaZ+N7RaX7i59pTmsyu6G20dD2cr/HaPgFgOgY0zZU3onhJJsUhNUlqkkyg fa/XNVewFpm5iljwaj3LzTGm27BvZ+BPEmva2RHQGVVf2d6ZM47uNPfIbgFfyrNIKr5j Fwz9OQeQ3uk1hQv3lNyYWRguA+FuCShuINEqjFT7+RoJB6uBcQPN5GF2wjQrelMJvP31 hmNOezT30K/OA4thjxAdOiUi0PNDIKuVeLdjTL8x7XtHHI6CZKq1Nv2Ef3DyJ7sMBHPt LWTcci7Dgdqth8Jk54S8BEoHQ1Ar6x4xw0VPtQA6Sl3RsDkAZsYwUlU888Wivn2bZZiJ +XdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=pJjNtnT/5UuSplnBkGR5L34KNoNlTDd97jc1nOwmIiY=; b=qDvHuY6+qoOo6aLIM7Uj20+T5DqQ7oK7R8k8m847+oNUIrPfpKNVIiJvBd/pmwqOB/ Zl7/cZrLvKuhBbIyyo3WeVMXh4a4DWFfAA+GDHEBnLwrtjdH2L2mrc+oNQQjT9Yu/N6F UYdnn00FJaXf2yfm77xdg9ErosBvd5OFjlo8LT6tZjaBkIDKm7GG85Db7xi+17zevhdv MIpjAuorF2XtsT3LXhopb6j9iy0gVPFXIUq31CDyhKkSccd+1S6LzCrYve+Rk5SLb9WQ Ts41Rgdkro+etF1Wf/8Zkz/N5exRB0BAklqAxE8pACUgcKIt3GkfXE9qgqlXYEqn4h9P 6nZQ== X-Gm-Message-State: AOAM533T60SD58pGGL+6wHq5MtNv9c+J1OVbYNNXw6UxmWNPkkDpyyRL 0oh7v07hrn9M/ac/LXrnDOo= X-Google-Smtp-Source: ABdhPJyKAILyPT36HF57MbRD3qTniu+71stM1X6dhmMaBUCx88iq8agJZSY5jIe5N1qGQHekrdBvwQ== X-Received: by 2002:a05:600c:3b87:: with SMTP id n7mr682436wms.93.1633027952786; Thu, 30 Sep 2021 11:52:32 -0700 (PDT) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id k17sm3781353wrq.7.2021.09.30.11.52.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 11:52:32 -0700 (PDT) Message-ID: <93c0bb40dcf98c72b896b837b8be6b06f71161bb.camel@gmail.com> From: Liliana Marie Prikler Date: Thu, 30 Sep 2021 20:52:30 +0200 In-Reply-To: References: <20210928214044.437-1-attila@lendvai.name> <57f1435fd83da8c0e0acaef64d5f08e4ca7b3404.camel@gmail.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) 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 Attila Am Donnerstag, den 30.09.2021, 08:10 +0000 schrieb Attila Lendvai: > > > - (let* ((original-files (list->vector files)) > > > - (count (vector-length original-files)) > > > - (stripped-files (vector-map (lambda (_ el) > > > - (strip-store-file-name > > > el)) > > > - original-files)) > > > - (indices (vector-unfold values count))) > > > > > > - (stable-sort! indices > > > - (lambda (a b) > > > - (string> (vector-ref stripped-files a) > > > - (vector-ref stripped-files b)))) > > > - (vector-ref original-files (vector-ref indices 0)))) > > > > Instead of stable-sort!-ing the indices of a vector, what about > > stable-sort!-ing (map strip-store-file-name original-files) in more > > or less one go? > > the hash also needs to be dropped from the path for sorting to be > useful, but the return value must be the full path, hence the > complexity with sorting the indices, pointing both to the full paths > and the cut parts. This thing has received some replies already to which I already dropped a comment, so I'll try not to repeat myself here. If something is still unclear, go down the sub-thread started by Maxime. > > I don't think the default collision resolver ought to sort the > > files. > > > > The rationale behind ignoring certain collisions, e.g. icon caches > > relies on the fact that Guix will use the correct files because > > they are put first in the manifest. The hooks themselves have no > > special names that could put them "always first" and profiles are > > themselves union-built. > > > > I do however support the addition of sorting methods as collision > > resolvers in general and would welcome a way of doing so for > > profiles > > pre-hook. > > please note that i almost completely lack the knowledge of the > relevant internals. > > with that in mind, do i read you right? this should add a new > exported resolver funtion, and leave the default one as it was? Yes, I think that is safer than actually overriding the default for now at least. > and use the new resolver somewhere (where?) that will affect only the > union of profiles, i.e. user visible effecs when installing software? > (because DIRECTORY-UNION is called in other contexts also?) > > thanks for the insights! i'd appreciate a bit more higher level > guidance, and then i'll resend the patch accordingly. I must admit, I'm at a loss of knowledge myself here. Perhaps someone else can jive in and tell you which union-build is done without hooks, but I fear there might also be none. For now, simply having the resolver is in my opinion enough if we don't find the right location as well. We can default it later with "first-come-first-serve" exceptions where needed. Cheers From unknown Fri Jun 13 11:07:10 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50878] [PATCH 1/4] guix: build: Promote local define-inline to a define-constant util. References: <20210928214044.437-1-attila@lendvai.name> In-Reply-To: <20210928214044.437-1-attila@lendvai.name> Resent-From: Attila Lendvai Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 03 Oct 2021 12:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50878 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50878@debbugs.gnu.org Cc: Attila Lendvai Received: via spool by 50878-submit@debbugs.gnu.org id=B50878.163326501724164 (code B ref 50878); Sun, 03 Oct 2021 12:44:01 +0000 Received: (at 50878) by debbugs.gnu.org; 3 Oct 2021 12:43:37 +0000 Received: from localhost ([127.0.0.1]:33096 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mX0q9-0006Hf-AP for submit@debbugs.gnu.org; Sun, 03 Oct 2021 08:43:37 -0400 Received: from mail-wr1-f41.google.com ([209.85.221.41]:44812) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mX0q4-0006HQ-In for 50878@debbugs.gnu.org; Sun, 03 Oct 2021 08:43:37 -0400 Received: by mail-wr1-f41.google.com with SMTP id d6so24926620wrc.11 for <50878@debbugs.gnu.org>; Sun, 03 Oct 2021 05:43:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=MusHtuw/9wxb7MJDhJo1+iJh4W7M+pquI/8vKYVGtnU=; b=iX8Yu9Xz5MqNsHrLnFZBf/PrN4JlFOBC52gJ554F4mf1JQqR1MMyU5ok/vAeaVMJ06 igDCPuUBCtlLB6KwKgXYlr5/nkm2IwDImDx1+DDD0rvlKPrYxTnkJLWsGLLVplJUYYYV weUPKiLihvkpYNEwGUrJt5MuaPSRLLQvYqqLqZ7GLH8mO7FMiOLlSACQ/EOclsDhmCp1 lNy/WSn1ShzHL2O9ML9+nIzOEYIqIw+W5+29rG4k0Io+i5vl2J4Fh44/jJT5wjtrXenE z6pFlK6R0ndlCJbSYxYXySxUGB22ZJLi7oCYBflJZ0zPD0joF0f9E+sVdgKsy3fQ+zfk QqHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=MusHtuw/9wxb7MJDhJo1+iJh4W7M+pquI/8vKYVGtnU=; b=GYKYeBV805LE6pCkWQwDueILt6PjLPK8fp9m+KCbuGfChNyebnueQTmpXtKHkdNTOA vv8aL/7zC6k77fvUo4ciXsnc+jgmn8+GLiaeo35i1rbueVM+bQZjUyXL0w47b0IXNDW9 xSOjmb0rd8UOGb+xDWafsQTg398EabRj6krdTv+JlJXXNbxz/YkLdZ4ozdJVvB5Z5d2z PAITY/LpL9aMEU+PkZ3R7WgGy5v55GQE75qyyLpYWTwV10D1yT2T4wR5Krv4hXmfdckF KPavOyhp6ieEkZhEM7uZEiCjYKaUZEWDOKdPkoZAgigeB0aULPDJF/GmaQUbf9PnDK3s U7OQ== X-Gm-Message-State: AOAM533Enp+TGFmO7QxGdNKWlCOsXsjUux6+ju/Af2D5g8Ct1unUZqDD U1dStA3Qfhol8Xa5AyrZLqAE8V3a6Oo= X-Google-Smtp-Source: ABdhPJyYCqNGouxSTvCxEGVNLRPoM1vIPRe5mNjpvtJiN234GqIIvBF2oxN5cZLKfq8D+3IQ/KyHOQ== X-Received: by 2002:a05:6000:168b:: with SMTP id y11mr8346313wrd.350.1633265006473; Sun, 03 Oct 2021 05:43:26 -0700 (PDT) Received: from lelap.lan (catv-213-222-131-28.catv.broadband.hu. [213.222.131.28]) by smtp.gmail.com with ESMTPSA id v10sm11800474wri.29.2021.10.03.05.43.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Oct 2021 05:43:25 -0700 (PDT) From: Attila Lendvai Date: Sun, 3 Oct 2021 14:43:00 +0200 Message-Id: <20211003124303.8277-1-attila@lendvai.name> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.5 (/) 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: -0.5 (/) * guix/build/utils.scm: Moved/renamed define-inline from grafts.scm to an exported define-constant util. --- guix/build/graft.scm | 5 +---- guix/build/utils.scm | 12 ++++++++++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/guix/build/graft.scm b/guix/build/graft.scm index f04c35fa74..daac958d4f 100644 --- a/guix/build/graft.scm +++ b/guix/build/graft.scm @@ -44,10 +44,7 @@ ;;; ;;; Code: -(define-syntax-rule (define-inline name val) - (define-syntax name (identifier-syntax val))) - -(define-inline hash-length 32) +(define-constant hash-length 32) (define nix-base32-char? (cute char-set-contains? diff --git a/guix/build/utils.scm b/guix/build/utils.scm index 419c10195b..f3d913aa70 100644 --- a/guix/build/utils.scm +++ b/guix/build/utils.scm @@ -73,6 +73,8 @@ list->search-path-as-string which + define-constant + every* alist-cons-before alist-cons-after @@ -112,6 +114,16 @@ locale-category->string)) + +;;; +;;; Syntax +;;; + +;; Note that in its current form VAL doesn't get evaluated, just simply +;; inlined. TODO? +(define-syntax-rule (define-constant name val) + (define-syntax name (identifier-syntax val))) + ;;; ;;; Guile 2.0 compatibility later. -- 2.33.0 From unknown Fri Jun 13 11:07:10 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50878] [PATCH 2/4] guix: build: Avoid using magic literals in the code for hash length. Resent-From: Attila Lendvai Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 03 Oct 2021 12:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50878 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50878@debbugs.gnu.org Cc: Attila Lendvai Received: via spool by 50878-submit@debbugs.gnu.org id=B50878.163326502124180 (code B ref 50878); Sun, 03 Oct 2021 12:44:02 +0000 Received: (at 50878) by debbugs.gnu.org; 3 Oct 2021 12:43:41 +0000 Received: from localhost ([127.0.0.1]:33099 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mX0qD-0006Hw-Jp for submit@debbugs.gnu.org; Sun, 03 Oct 2021 08:43:41 -0400 Received: from mail-wr1-f49.google.com ([209.85.221.49]:42705) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mX0qB-0006HX-P2 for 50878@debbugs.gnu.org; Sun, 03 Oct 2021 08:43:40 -0400 Received: by mail-wr1-f49.google.com with SMTP id v17so24963354wrv.9 for <50878@debbugs.gnu.org>; Sun, 03 Oct 2021 05:43:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uqZpcjgK26RLLT/WLa+olTb/Q4pV96js45ePYWQnTfI=; b=bg+EurDb+8CLS73wQ4Fk1O94z2VCyl03Nhwc1wXSK+gNRIXo2jJy2FUZxxrI1AqTJm kT2KgHV8GRSNcH0q6PMKAyKrpP62b7ZL4EZFgk90m9ccVC5RAoK9syne9RRyhYlz0B3l AGtkAqsvW6cLLjdwhqOgqqrlDusWMiHCTv+X0/JRGJm5orlJUSCwhJZgFLRNtx0VCZPx cVxFWCWFc0O/1qhV4K98w1la/N2L1jn1cHdAPqEWQD0iC2TPUCq9Cldb9duGZypeP5Jj nDicRe5ZCWmCrksrwjaDkz8FHVT9EVRO+57xj+gN44hmI1yPPG0uKVnPdaqdNq2MV11b Go0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=uqZpcjgK26RLLT/WLa+olTb/Q4pV96js45ePYWQnTfI=; b=0wIU1o+20TekbNVaH37vqCkVAHawY290lugRgImd/gtJfzQ8CIRjNMLSdYnpM3+y4T bRoCjrRR1Dt4mB9+5AVXVc0kAbXzQD3zL4o+7jNRgJ4sPOQj95F1YsdLkqIZW6T2vjy6 e2G6+BS6Mxueold3MXS3hYvxo1ACy6mXlG0dhmNgD4xO2Cmkdp/IMcnsutiL+d6CP5mC fzgZZ6WWxdzmxRlC3oO3PnGJYacl0gYd1H5aqZElacUITii6vsruZSINS8jagrKYvUDt 42QjA7TNl+BHK7Nu+fbRpMVal8baCG9bNwDl4AxgUJq51D4cr+2s6X6Rrd/z92t1/FAX 8Mnw== X-Gm-Message-State: AOAM531pgBVCrjJKfVrOZYavgQius/bIzJ1Jxs5f5HRW7aVph5E957AU zU0carup4d/dBcQ268sCS+blehtEhCk= X-Google-Smtp-Source: ABdhPJwyD56BtOvKHklNLHykixhFxgNsdsIgCPWYcqy0aLJ3NAP7jv0OPYXkBgRHmBSszPOV5mnElw== X-Received: by 2002:a5d:49c5:: with SMTP id t5mr8561843wrs.295.1633265014109; Sun, 03 Oct 2021 05:43:34 -0700 (PDT) Received: from lelap.lan (catv-213-222-131-28.catv.broadband.hu. [213.222.131.28]) by smtp.gmail.com with ESMTPSA id v10sm11800474wri.29.2021.10.03.05.43.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Oct 2021 05:43:33 -0700 (PDT) From: Attila Lendvai Date: Sun, 3 Oct 2021 14:43:01 +0200 Message-Id: <20211003124303.8277-2-attila@lendvai.name> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211003124303.8277-1-attila@lendvai.name> References: <20211003124303.8277-1-attila@lendvai.name> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.5 (/) 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: -0.5 (/) * guix/build/utils.scm (%store-hash-string-length): New constant. (store-path-prefix-length): Factor out the calculation of the total store prefix length. * guix/build/graft.scm (hash-length): Use it. --- guix/build/graft.scm | 2 +- guix/build/utils.scm | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/guix/build/graft.scm b/guix/build/graft.scm index daac958d4f..281dbaba6f 100644 --- a/guix/build/graft.scm +++ b/guix/build/graft.scm @@ -44,7 +44,7 @@ ;;; ;;; Code: -(define-constant hash-length 32) +(define-constant hash-length %store-hash-string-length) (define nix-base32-char? (cute char-set-contains? diff --git a/guix/build/utils.scm b/guix/build/utils.scm index f3d913aa70..4009c137b8 100644 --- a/guix/build/utils.scm +++ b/guix/build/utils.scm @@ -44,6 +44,7 @@ ;; . delete) #:export (%store-directory + %store-hash-string-length store-file-name? strip-store-file-name package-name->name+version @@ -154,15 +155,21 @@ (or (getenv "NIX_STORE") "/gnu/store")) +(define-constant %store-hash-string-length 32) + (define (store-file-name? file) "Return true if FILE is in the store." (string-prefix? (%store-directory) file)) +(define (store-path-prefix-length) + (+ 2 ; the slash after %store-directory, and the dash after the hash + (string-length (%store-directory)) + %store-hash-string-length)) + (define (strip-store-file-name file) "Strip the '/gnu/store' and hash from FILE, a store file name. The result is typically a \"PACKAGE-VERSION\" string." - (string-drop file - (+ 34 (string-length (%store-directory))))) + (string-drop file (store-path-prefix-length))) (define (package-name->name+version name) "Given NAME, a package name like \"foo-0.9.1b\", return two values: -- 2.33.0 From unknown Fri Jun 13 11:07:10 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50878] [PATCH 3/4] guix: build: Factor out and export default-collision-resolver. Resent-From: Attila Lendvai Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 03 Oct 2021 12:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50878 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50878@debbugs.gnu.org Cc: Attila Lendvai Received: via spool by 50878-submit@debbugs.gnu.org id=B50878.163326502824202 (code B ref 50878); Sun, 03 Oct 2021 12:44:02 +0000 Received: (at 50878) by debbugs.gnu.org; 3 Oct 2021 12:43:48 +0000 Received: from localhost ([127.0.0.1]:33102 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mX0qJ-0006II-Sb for submit@debbugs.gnu.org; Sun, 03 Oct 2021 08:43:48 -0400 Received: from mail-wr1-f45.google.com ([209.85.221.45]:34628) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mX0qI-0006Hv-B0 for 50878@debbugs.gnu.org; Sun, 03 Oct 2021 08:43:46 -0400 Received: by mail-wr1-f45.google.com with SMTP id t8so25060566wri.1 for <50878@debbugs.gnu.org>; Sun, 03 Oct 2021 05:43:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cocJj1Sw5JY/LTYomCQ01cjJM+cMkLPQpUHzTmM6/lM=; b=orergwOWwXIfFEXiJS+Dc1q4HcO1hwW77wvoVh3750UnU51QU/ArdIEEqHFnSI5c1K ZloCRq4j1av1gmZp3UlexjXjUewQ/wFTDyF6MkMXIb8BKwJ5TexPD0tiztOWDxJ4uXax X2CeuIUV36LWIi81hRUevB7GlgCf+wnnAEKuODOQxfTOLkxMZDnpxHnetHaFYbqqCLkB ddbCGpcn/g+JG+2BEx1mALYmxKc2V6AhdfmWV9QWJs1DuCTUlI/vYjBksM4K4T7tB9LR FyKyoFzFDzSPC8hF4dMTR5tVFTNgeb/fLFZPrabstaYQakU8dOIGWxWJySgxLbxFwANh 9bxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=cocJj1Sw5JY/LTYomCQ01cjJM+cMkLPQpUHzTmM6/lM=; b=tffNXr1z6lQvdgsglzCmH08o3aqrsYHlrVuEI56v5PedMtdVCItg9vCy5hPayTkXJa PeDHne9a4MrmrkEsd9r+BsJ2YM9LY/HGVZWZsv5ybCkIBACQ/W5niVqdxnMrjNbAvlcV aYLTblQFINwfrGrxVNDjTax6ARUiNpVEeJwPqUhwFA27g6a1acCAJpRXMwCxZhMrEz1P vn7VZUytYEpBBvR9dME23/94GPeXppZfm1zwdoK5+aAu0U6r14DafBFMvNVodALQab28 ibS0hoM7evbOndWK8+ubzaJMFxhf1drehLahWwChU5bZGGMjnyOy7lDgV3BqedNxJaep zy+w== X-Gm-Message-State: AOAM533OQet2xcz3tnfXxoLiehwjNvsoLJ/jARh6O1D+bMS5GC7oK1gj CXhTVrRKZvdeWCSfn0XaRAI0T4odZhY= X-Google-Smtp-Source: ABdhPJy9tZZe+A/b1PximlwVCnvyKvvJz9+P+o2owihwdYFbY1A8GZ44t2O13UBVRX6gTUEYd9OwEA== X-Received: by 2002:adf:9bd3:: with SMTP id e19mr8569555wrc.167.1633265020705; Sun, 03 Oct 2021 05:43:40 -0700 (PDT) Received: from lelap.lan (catv-213-222-131-28.catv.broadband.hu. [213.222.131.28]) by smtp.gmail.com with ESMTPSA id v10sm11800474wri.29.2021.10.03.05.43.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Oct 2021 05:43:40 -0700 (PDT) From: Attila Lendvai Date: Sun, 3 Oct 2021 14:43:02 +0200 Message-Id: <20211003124303.8277-3-attila@lendvai.name> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211003124303.8277-1-attila@lendvai.name> References: <20211003124303.8277-1-attila@lendvai.name> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.5 (/) 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: -0.5 (/) This prepares the stage for new collision resolvers, but no semantic changes. * guix/build/union.scm (resolve-collision/pick-first): New function. (resolve-collision-and-maybe-warn): New function. (default-collision-resolver): New function. --- guix/build/union.scm | 16 ++++++++++------ guix/gexp.scm | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/guix/build/union.scm b/guix/build/union.scm index 961ac3298b..9e8c2af4f5 100644 --- a/guix/build/union.scm +++ b/guix/build/union.scm @@ -27,7 +27,7 @@ #:use-module (rnrs io ports) #:export (union-build - warn-about-collision + default-collision-resolver relative-file-name symlink-relative)) @@ -102,10 +102,11 @@ identical, #f otherwise." ;; applications via 'glib-or-gtk-build-system'. '("icon-theme.cache" "gschemas.compiled")) -(define (warn-about-collision files) - "Handle the collision among FILES by emitting a warning and choosing the -first one of THEM." - (let ((file (first files))) +(define (resolve-collision/pick-first files) + (first files)) + +(define (resolve-collision-and-maybe-warn files resolver) + (let ((file (resolver files))) (unless (member (basename file) %harmless-collisions) (format (current-error-port) "~%warning: collision encountered:~%~{ ~a~%~}" @@ -113,11 +114,14 @@ first one of THEM." (format (current-error-port) "warning: choosing ~a~%" file)) file)) +(define (default-collision-resolver files) + (resolve-collision-and-maybe-warn files resolve-collision/pick-first)) + (define* (union-build output inputs #:key (log-port (current-error-port)) (create-all-directories? #f) (symlink symlink) - (resolve-collision warn-about-collision)) + (resolve-collision default-collision-resolver)) "Build in the OUTPUT directory a symlink tree that is the union of all the INPUTS, using SYMLINK to create symlinks. As a special case, if CREATE-ALL-DIRECTORIES?, creates the subdirectories in the output directory to diff --git a/guix/gexp.scm b/guix/gexp.scm index f3d278b3e6..32e8748443 100644 --- a/guix/gexp.scm +++ b/guix/gexp.scm @@ -1983,7 +1983,7 @@ This yields an 'etc' directory containing these two files." (define* (directory-union name things #:key (copy? #f) (quiet? #f) - (resolve-collision 'warn-about-collision)) + (resolve-collision 'default-collision-resolver)) "Return a directory that is the union of THINGS, where THINGS is a list of file-like objects denoting directories. For example: -- 2.33.0 From unknown Fri Jun 13 11:07:10 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50878] [PATCH 4/4] WIP guix: build: Add resolve-collision/alphanumeric-last for union. Resent-From: Attila Lendvai Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 03 Oct 2021 12:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50878 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50878@debbugs.gnu.org Cc: Attila Lendvai Received: via spool by 50878-submit@debbugs.gnu.org id=B50878.163326524824647 (code B ref 50878); Sun, 03 Oct 2021 12:48:02 +0000 Received: (at 50878) by debbugs.gnu.org; 3 Oct 2021 12:47:28 +0000 Received: from localhost ([127.0.0.1]:33108 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mX0ts-0006PS-EC for submit@debbugs.gnu.org; Sun, 03 Oct 2021 08:47:28 -0400 Received: from mail-wm1-f47.google.com ([209.85.128.47]:46691) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mX0tq-0006OW-0m for 50878@debbugs.gnu.org; Sun, 03 Oct 2021 08:47:26 -0400 Received: by mail-wm1-f47.google.com with SMTP id o4-20020a05600c510400b0030d55d6449fso3932974wms.5 for <50878@debbugs.gnu.org>; Sun, 03 Oct 2021 05:47:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GULd65ZGeXU31ROJ5+3A5vd+eTGKJ4KXxxwFe/EnGGg=; b=j0hX+CrdGUn20LCb+BYmBEGATyHKLo5kHfU66/u4SBt1qlMSsU3I65mLssIMCAfjxi +1294+RUivegwps6G5xURObn5AUpHsvWPJltL2o/87JKSuBtf6zJwMRCp5NGguO1UNsc UgQ+UNZmTMiFM7ewCPbSmjYJGu38EfTMGsJLtShnC+C+ZtB4fAs3awVyPngDsQlOJjVm /clidIip+WAFsyrxnolotOfnlVTl/8NACasmikEjq4F/a+2Fhy5o3j93Y0b9mhf4LXKl 9mnqi7wJYxwQ8d15OZEcKgcjpeO7Xwrdz4hB2X4jPVIYMjZZAT0oGwvyUsABKRe0GTfP TFMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=GULd65ZGeXU31ROJ5+3A5vd+eTGKJ4KXxxwFe/EnGGg=; b=DV/A8JErtgQw3Bo3GSRa6l78Mwy2TCTmeSh9oyCkTwiZINMRUxYu7qiT6tqP3zyAWu 3MatYpnSxAWyJ7Esv0GrpYnMDZgt7WRtQ0qQwh2btkbg/BiMFUyNknpB3g7wVDhZuCVN 71Yj5L8wd/cRmpF/y/wg1kkgbTamzCC7vPMtNrj5r/5ycVv1eRoWS3uBQsQxnLrvqtod tKCOb2pJut0aa9z2OahIV9btqZistl625KEv0YrgI2mtxUisbt/2rGzD8cgQX7cFMvSM tlKxHA9Fge0VvtyUyQWD+O/2JMPqY9fbcfpQo/msDTe24rzM4t9YNpcYdrYOHVmNvanP hFvw== X-Gm-Message-State: AOAM531226kEqNSqfSwAdla2lFciGWJVcFsFqrqKzJcztuS37xd7oxtd PHJsJSn8mZfZjRIf64rdYh2m/PN4y/4= X-Google-Smtp-Source: ABdhPJw1u9Ld71yE/z01fLWezRth9tOpqDXWQZZB/MogblmXFv/4qkgaJdTp3M8yRuL0hOOXFaYx0w== X-Received: by 2002:a7b:c048:: with SMTP id u8mr13514436wmc.113.1633265240097; Sun, 03 Oct 2021 05:47:20 -0700 (PDT) Received: from lelap.lan (catv-213-222-131-28.catv.broadband.hu. [213.222.131.28]) by smtp.gmail.com with ESMTPSA id v10sm11800474wri.29.2021.10.03.05.47.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Oct 2021 05:47:19 -0700 (PDT) From: Attila Lendvai Date: Sun, 3 Oct 2021 14:43:04 +0200 Message-Id: <20211003124303.8277-4-attila@lendvai.name> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211003124303.8277-1-attila@lendvai.name> References: <20211003124303.8277-1-attila@lendvai.name> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.5 (/) 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: -0.5 (/) It is currently not used anywhere, only exported. The tests are boken, because guile is too old in the test environment, at least on 'x86_64-linux' (guile 2.0.9 doesn't have srfi-43, aka vectors). Probably it's also broken because testing errors with `no code for module (guix build utils)`. * guix/build/union.scm (resolve-collision/alphanumeric-last): New function. * guix/build/utils.scm (compare-strings-ignoring-store-path-prefix): New function. --- I think the previous 3 patches in this patchset are worthy of inclusion, but this one is more of a good idea than a worked out change, to be picked up later, if at all. The primary issue is that the test framework uses a guile that is too old, but it's also not used anywhere. It would be nice if this was used for resolving conflicts for profiles, i.e. for the user's bin/ directory. guix/build/union.scm | 12 ++++++++++++ guix/build/utils.scm | 27 +++++++++++++++++++++++++++ tests/union.scm | 9 +++++++++ 3 files changed, 48 insertions(+) diff --git a/guix/build/union.scm b/guix/build/union.scm index 9e8c2af4f5..339af7576c 100644 --- a/guix/build/union.scm +++ b/guix/build/union.scm @@ -19,15 +19,18 @@ ;;; along with GNU Guix. If not, see . (define-module (guix build union) + #:use-module (guix build utils) #:use-module (ice-9 match) #:use-module (ice-9 format) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) + #:use-module (srfi srfi-43) #:use-module (rnrs bytevectors) #:use-module (rnrs io ports) #:export (union-build default-collision-resolver + resolve-collision/alphanumeric-last relative-file-name symlink-relative)) @@ -102,6 +105,15 @@ identical, #f otherwise." ;; applications via 'glib-or-gtk-build-system'. '("icon-theme.cache" "gschemas.compiled")) +(define (resolve-collision/alphanumeric-last files) + ;; Let's do a stable-sort, so that multiple foo-1.2.3/bin/foo variants will + ;; predictably resolve to the highest versioned one. + (let ((files-vector (list->vector files))) + (stable-sort! files-vector + (lambda (a b) + (> 0 (compare-strings-ignoring-store-path-prefix a b)))) + (vector-ref files-vector 0))) + (define (resolve-collision/pick-first files) (first files)) diff --git a/guix/build/utils.scm b/guix/build/utils.scm index 4009c137b8..1ae0244b04 100644 --- a/guix/build/utils.scm +++ b/guix/build/utils.scm @@ -47,6 +47,7 @@ %store-hash-string-length store-file-name? strip-store-file-name + compare-strings-ignoring-store-path-prefix package-name->name+version parallel-job-count @@ -171,6 +172,32 @@ is typically a \"PACKAGE-VERSION\" string." (string-drop file (store-path-prefix-length))) +(define (compare-strings-ignoring-store-path-prefix a b) + (let ((a-length (string-length a)) + (b-length (string-length b))) + (do ((i (store-path-prefix-length) (+ i 1))) + ((not (and (< i a-length) + (< i b-length) + (char=? (string-ref a i) + (string-ref b i)))) + (cond + ((= a-length b-length) + (if (= i a-length) ; we reached the end without any difference + 0 + (- (char->integer (string-ref a i)) + (char->integer (string-ref b i))))) + ((> a-length b-length) + (if (= i b-length) ; we reached the end of B without a difference + 1 + (- (char->integer (string-ref a i)) + (char->integer (string-ref b i))))) + (else ; i.e. (< a-length b-length) + (if (= i a-length) ; we reached the end of A without a difference + -1 + (- (char->integer (string-ref a i)) + (char->integer (string-ref b i))))))) + '()))) + (define (package-name->name+version name) "Given NAME, a package name like \"foo-0.9.1b\", return two values: \"foo\" and \"0.9.1b\". When the version part is unavailable, NAME and diff --git a/tests/union.scm b/tests/union.scm index a8387edf42..cbf8840793 100644 --- a/tests/union.scm +++ b/tests/union.scm @@ -204,4 +204,13 @@ ("/a/b" "/a/b/c/d" => "c/d") ("/a/b/c" "/a/d/e/f" => "../../d/e/f"))) +(test-assert "resolve-collision/alphanumeric-last sorts alphanumerically" + (string= + ((@@ (guix build union) resolve-collision/alphanumeric-last) + (list "/gnu/store/c0000000000000000000000000000000-idris-0.0.0/bin/idris" + "/gnu/store/60000000000000000000000000000000-idris-2.0.0/bin/idris" + "/gnu/store/z0000000000000000000000000000000-idris-1.3.5/bin/idris" + "/gnu/store/00000000000000000000000000000000-idris-1.3.3/bin/idris")) + "/gnu/store/60000000000000000000000000000000-idris-2.0.0/bin/idris")) + (test-end) -- 2.33.0 From unknown Fri Jun 13 11:07:10 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50878] (No Subject) References: <20210928214044.437-1-attila@lendvai.name> In-Reply-To: <20210928214044.437-1-attila@lendvai.name> Resent-From: Attila Lendvai Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 03 Oct 2021 13:00:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50878 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: "50878@debbugs.gnu.org" <50878@debbugs.gnu.org> Reply-To: Attila Lendvai Received: via spool by 50878-submit@debbugs.gnu.org id=B50878.163326596726047 (code B ref 50878); Sun, 03 Oct 2021 13:00:01 +0000 Received: (at 50878) by debbugs.gnu.org; 3 Oct 2021 12:59:27 +0000 Received: from localhost ([127.0.0.1]:33128 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mX15T-0006m3-Fj for submit@debbugs.gnu.org; Sun, 03 Oct 2021 08:59:27 -0400 Received: from mail-40134.protonmail.ch ([185.70.40.134]:39228) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mX15N-0006ll-Oo for 50878@debbugs.gnu.org; Sun, 03 Oct 2021 08:59:25 -0400 Date: Sun, 03 Oct 2021 12:59:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lendvai.name; s=protonmail2; t=1633265951; bh=f8o6tqzBuYI3vZ6bRgRoTB+CPdzc5KjboMJT6xmlF38=; h=Date:To:From:Reply-To:Subject:From; b=Z0WRyIsqVXkww3sc2QIorQ+cS/6ELDIXJvB0MlTbmIcIq41kUkVvrs/+siladnvEI 5Kp/yA8lYZHBKVuDXetwHT9cRpkg7pWLUxdJz/3nw9HAUY2LtPN/SSbAk4+Av8iEPp c3Oj9HDw6Mby1nB4hXV1zwAqSMtteEi7AIKbR3YByfeAgvMSa+KUezEDaTRsjNJ1CB 8GFDOjqFbJr2E96k+uXbLjivXr8fJ3DCjqyftb2LEgmRAllY2rVd9/JrrbGRMr4sjk SzNOXfeWpIK+IzCWxzaZ/XVn6ZWO83h3iOhCyWZgGyMPxVPicviN52hCjmMyrpF68Y tkppaRhkVfGtQ== From: Attila Lendvai Message-ID: <4ULxo0ijtifihUKvZWxBWjvn5e59PpVKYoAa5-rYM5yw2zswQAeUhdrkWoTfG1k3PP5gPjVulxe4xTTGy7XgK_Mc--PMemsFhHzvh25cf4w=@lendvai.name> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="b1_yVZuVQQSMsA6fpcJ7pXgkMfPlTiNoNgEeALqzKaIyUY" X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HTML_MESSAGE shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: sorry for being slow with understanding the suggested solution. i have automatically dismissed everything with leaky abstractions, and that made me blind to it. i didn't realize that i could either introduce constants for the hash length, and the store path, or straight out export a special comparator function to be used. Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 2.0 SLIGHTLY_BAD_SUBJECT Subject contains something slightly spammy -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [185.70.40.134 listed in wl.mailspike.net] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.0 HTML_MESSAGE BODY: HTML included in message -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders 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 (+) This is a multi-part message in MIME format. --b1_yVZuVQQSMsA6fpcJ7pXgkMfPlTiNoNgEeALqzKaIyUY Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: base64 c29ycnkgZm9yIGJlaW5nIHNsb3cgd2l0aCB1bmRlcnN0YW5kaW5nIHRoZSBzdWdnZXN0ZWQgc29s dXRpb24uIGkgaGF2ZSBhdXRvbWF0aWNhbGx5IGRpc21pc3NlZCBldmVyeXRoaW5nIHdpdGggbGVh a3kgYWJzdHJhY3Rpb25zLCBhbmQgdGhhdCBtYWRlIG1lIGJsaW5kIHRvIGl0LgoKaSBkaWRuJ3Qg cmVhbGl6ZSB0aGF0IGkgY291bGQgZWl0aGVyIGludHJvZHVjZSBjb25zdGFudHMgZm9yIHRoZSBo YXNoIGxlbmd0aCwgYW5kIHRoZSBzdG9yZSBwYXRoLCBvciBzdHJhaWdodCBvdXQgZXhwb3J0IGEg c3BlY2lhbCBjb21wYXJhdG9yIGZ1bmN0aW9uIHRvIGJlIHVzZWQuCgplaXRoZXIgd2F5LCBpIGhh dmUgb3JnYW5pemVkIHRoZSBwYXRjaGVzIHNvIHRoYXQgdGhlIGZpcnN0IDMgYXJlIHVzZWZ1bCwg YW5kIHRoZSA0dGggb25lIGlzIG1vcmUgb2YgYSBkZW1vL2luc3BpcmF0aW9uIGZvciBwcm9zcGVy aXR5LgoKYXBwbHkgMS0zIGFzIHlvdSBzZWUgZml0LCBhbmQgaWdub3JlIG9yIGZpbmlzaCB0aGUg NHRoLgoKLSBhdHRpbGEKUEdQOiA1RDVGIDQ1QzcgREZDRCAwQTM5 --b1_yVZuVQQSMsA6fpcJ7pXgkMfPlTiNoNgEeALqzKaIyUY Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: base64 PGRpdj5zb3JyeSBmb3IgYmVpbmcgc2xvdyB3aXRoIHVuZGVyc3RhbmRpbmcgdGhlIHN1Z2dlc3Rl ZCBzb2x1dGlvbi4gaSBoYXZlIGF1dG9tYXRpY2FsbHkgZGlzbWlzc2VkIGV2ZXJ5dGhpbmcgd2l0 aCBsZWFreSBhYnN0cmFjdGlvbnMsIGFuZCB0aGF0IG1hZGUgbWUgYmxpbmQgdG8gaXQuPGJyPjwv ZGl2PjxkaXY+PGJyPjwvZGl2PjxkaXY+aSBkaWRuJ3QgcmVhbGl6ZSB0aGF0IGkgY291bGQgZWl0 aGVyIGludHJvZHVjZSBjb25zdGFudHMgZm9yIHRoZSBoYXNoIGxlbmd0aCwgYW5kIHRoZSBzdG9y ZSBwYXRoLCBvciBzdHJhaWdodCBvdXQgZXhwb3J0IGEgc3BlY2lhbCBjb21wYXJhdG9yIGZ1bmN0 aW9uIHRvIGJlIHVzZWQuPGJyPjwvZGl2PjxkaXY+PGJyPjwvZGl2PjxkaXY+ZWl0aGVyIHdheSwg aSBoYXZlIG9yZ2FuaXplZCB0aGUgcGF0Y2hlcyBzbyB0aGF0IHRoZSBmaXJzdCAzIGFyZSB1c2Vm dWwsIGFuZCB0aGUgNHRoIG9uZSBpcyBtb3JlIG9mIGEgZGVtby9pbnNwaXJhdGlvbiBmb3IgcHJv c3Blcml0eS48YnI+PC9kaXY+PGRpdj48YnI+PC9kaXY+PGRpdj5hcHBseSAxLTMgYXMgeW91IHNl ZSBmaXQsIGFuZCBpZ25vcmUgb3IgZmluaXNoIHRoZSA0dGguPC9kaXY+PGRpdj48YnI+PC9kaXY+ PGRpdiBjbGFzcz0icHJvdG9ubWFpbF9zaWduYXR1cmVfYmxvY2siPjxkaXYgY2xhc3M9InByb3Rv bm1haWxfc2lnbmF0dXJlX2Jsb2NrLXVzZXIiPjxkaXY+LSBhdHRpbGE8YnI+PC9kaXY+PGRpdj5Q R1A6Jm5ic3A7NUQ1RiA0NUM3IERGQ0QgMEEzOTxicj48L2Rpdj48L2Rpdj48ZGl2IGNsYXNzPSJw cm90b25tYWlsX3NpZ25hdHVyZV9ibG9jay1wcm90b24gcHJvdG9ubWFpbF9zaWduYXR1cmVfYmxv Y2stZW1wdHkiPjwvZGl2PjwvZGl2PjxkaXY+PGJyPjwvZGl2Pg== --b1_yVZuVQQSMsA6fpcJ7pXgkMfPlTiNoNgEeALqzKaIyUY-- From unknown Fri Jun 13 11:07:10 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50878] (No Subject) Resent-From: Liliana Marie Prikler Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 02 Sep 2022 16:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50878 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Attila Lendvai , "50878@debbugs.gnu.org" <50878@debbugs.gnu.org> Received: via spool by 50878-submit@debbugs.gnu.org id=B50878.16621346502137 (code B ref 50878); Fri, 02 Sep 2022 16:05:01 +0000 Received: (at 50878) by debbugs.gnu.org; 2 Sep 2022 16:04:10 +0000 Received: from localhost ([127.0.0.1]:47516 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oU99O-0000YP-C6 for submit@debbugs.gnu.org; Fri, 02 Sep 2022 12:04:10 -0400 Received: from mail-ed1-f65.google.com ([209.85.208.65]:33705) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oU99M-0000YC-HP for 50878@debbugs.gnu.org; Fri, 02 Sep 2022 12:04:08 -0400 Received: by mail-ed1-f65.google.com with SMTP id w2so3370762edc.0 for <50878@debbugs.gnu.org>; Fri, 02 Sep 2022 09:04:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date; bh=emfYSj8padevdk388xf7qZPpawAtvXcPg8DAKevsN18=; b=oUHoQuZzTh19oY61x5UvdTCrctMpBWAxF5dmjzLIxlrnr8GEdYS5n5dB+3OftxlCTC ycgC4my+MVUTS50bWaT+lskNXHLfa0BVKyWVibb7nf4ZMdxKblHQ+G68Xa4XDFabWTEe FNSd8mlkKg85aqA+6N27dWn+lwdmVz0g8OOlqHcHLeSjvOigv7uvqms1ad2eG4X8jwR1 bFktrxcvp3CBN+l8pKgBLR49soT2ZMrdkebFECh/N12xMg3j267xA3KZ5G6pee2UiDyX q6GuMs5Hx27xKz/tPQoIAqRuaAf8D/yQDT4IItkUTw+vhcvZoy84NhOf8J50yqDoFPTi tXvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date; bh=emfYSj8padevdk388xf7qZPpawAtvXcPg8DAKevsN18=; b=YrOizQ8nq8x3jJ+KcCNhn/cGa6r1+Pd1wDtrEUiUoARCG+NSyYtKwztG06hJHY/Hcq c4i6Uu4GLCSOkf/bho+H++Y6QkFQ/3PqCVU/GmiaJ5Q6Sxi8bJSli2KwevFKumaM8FXL ATw9zciDVdflGxGQUlJWrU1JRsxCV4xh4f+/7MA5cEMaXspNQHRewZzMAiiPVL3fFHOG vYA6U+BFSx868X8xhJXQ13CyYqW53xenkax+pnLY5OqRTprqYZ/i1EwhpbHdtU49C4L7 nrrMDtusQJnA1HnAtAlFRfE001Oi+P3xxLN3j1X+iUIwJaRgUOHPSCpaBegX5Rv8uzTW JB9w== X-Gm-Message-State: ACgBeo25V7jNK3e/OfzIEMu8AsuhXJyZTrdc9av/CAWtzfQ76hSrGBFw FUQx9PwtjDZUsqysHeM+Wj4= X-Google-Smtp-Source: AA6agR6VdOj6rd4ecnwolhnMDKWuMfv9/00uFUBPR89nTYthYBLJ7zCNpI6HZV4zJaV84M7R+tqvtg== X-Received: by 2002:aa7:c6d4:0:b0:448:ecc4:ec59 with SMTP id b20-20020aa7c6d4000000b00448ecc4ec59mr13158501eds.197.1662134642354; Fri, 02 Sep 2022 09:04:02 -0700 (PDT) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id l18-20020a1709063d3200b00722e50dab2csm1448135ejf.109.2022.09.02.09.04.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Sep 2022 09:04:01 -0700 (PDT) Message-ID: <46391cab734019b5715d33cf48e7d11d92b1d28f.camel@gmail.com> From: Liliana Marie Prikler Date: Fri, 02 Sep 2022 18:04:00 +0200 In-Reply-To: <4ULxo0ijtifihUKvZWxBWjvn5e59PpVKYoAa5-rYM5yw2zswQAeUhdrkWoTfG1k3PP5gPjVulxe4xTTGy7XgK_Mc--PMemsFhHzvh25cf4w=@lendvai.name> References: <4ULxo0ijtifihUKvZWxBWjvn5e59PpVKYoAa5-rYM5yw2zswQAeUhdrkWoTfG1k3PP5gPjVulxe4xTTGy7XgK_Mc--PMemsFhHzvh25cf4w=@lendvai.name> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Ho Attila, sorry for the long wait. Am Sonntag, dem 03.10.2021 um 12:59 +0000 schrieb Attila Lendvai: > sorry for being slow with understanding the suggested solution. i > have automatically dismissed everything with leaky abstractions, [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 2.0 SLIGHTLY_BAD_SUBJECT Subject contains something slightly spammy 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (liliana.prikler[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.208.65 listed in wl.mailspike.net] 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 (+) Ho Attila, sorry for the long wait. Am Sonntag, dem 03.10.2021 um 12:59 +0000 schrieb Attila Lendvai: > sorry for being slow with understanding the suggested solution. i > have automatically dismissed everything with leaky abstractions, and > that made me blind to it. > > i didn't realize that i could either introduce constants for the hash > length, and the store path, or straight out export a special > comparator function to be used. > > either way, i have organized the patches so that the first 3 are > useful, and the 4th one is more of a demo/inspiration for prosperity. > > apply 1-3 as you see fit, and ignore or finish the 4th. I've applied 1-3 with some changes to core-updates (particularly reducing the number of indirections in the third patch). I verified that gcc-toolchain builds and the collision is still resolved as-is. If you still wish to stable-sort things, go ahead. Cheers