From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 09 08:31:23 2023 Received: (at submit) by debbugs.gnu.org; 9 Oct 2023 12:31:23 +0000 Received: from localhost ([127.0.0.1]:59475 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qppPu-0003e1-PA for submit@debbugs.gnu.org; Mon, 09 Oct 2023 08:31:23 -0400 Received: from lists.gnu.org ([2001:470:142::17]:42816) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qppPr-0003dY-Bi for submit@debbugs.gnu.org; Mon, 09 Oct 2023 08:31:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qppPA-0002Ke-W7 for guix-patches@gnu.org; Mon, 09 Oct 2023 08:30:40 -0400 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qppP7-00047o-JH for guix-patches@gnu.org; Mon, 09 Oct 2023 08:30:35 -0400 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-9b29186e20aso767220266b.2 for ; Mon, 09 Oct 2023 05:30:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696854631; x=1697459431; darn=gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:from:to:cc:subject:date:message-id:reply-to; bh=c7MQRouC39swwzSJOLzPZNKeabvVCaYDMDwUiBff6u8=; b=FUHvTc2487S2QGoRHjETYIHJSrb5f49S87UGyUw/3ZAw2tmiKSSQ/QkvHov7vyzKMp kK+A2221NAwwL489F1+NZ5sMgSG1QnOqiEWTpCEGNkkBx6+YxBXzpuOueEeYXXcGMlf2 Mh5haD9KrKI2vtZSDxEmrYH3B+MJSp8UnjpbTVZILOaxsJFqRvOyJKupEAhCniy9p4xp icRay6tor+iH5BNrqyLY37Ytad36ZC6bCwpaUO7LYz0PL7xmySqGOCUhrY4hVF8hMxDW dIZs6Atxge62lGT8bhg3YeAtK0XZHzjgzKco4B2U2mRfT8vEs+Ueqf3Ox7qVJ76i2zQ0 lEEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696854631; x=1697459431; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=c7MQRouC39swwzSJOLzPZNKeabvVCaYDMDwUiBff6u8=; b=Jk/37WpcjE7iFEVsHtrx8N/6IXmZNg/cNkUkQ6iVYtS4gZ4QWOAZX2fxojZj/JnaZd I0BraCEm1Un5+tfynGrZXtEwUqf3QX1a1qZr97GxXN5U0L17KtGdLQfzn5hmrsMk7MDg PfTr290HI3+kQC3u8OyGOFKRJ1Hrr1ITtFHvS3Vx3YkSEWtyFzj9QpgfeebnHmIF/lEA KEQdQIGksy3kMSz5qpgD3ytXgI24tN65sJMm1Va6sUZhAmepqIqGsMWNe+wPGbq4pHFx zxsMVb8PECSa3Jx91vngt7fX0+J799zL6qu/RgJKX7Up3792HdZGYgd60g/00mkeq4hE u45Q== X-Gm-Message-State: AOJu0YyjwFp5nnflORmpjDUh5BNY24bf8/PIaoaNg3CxEhasHeUvnTIG iNV2CexciBbEjFGw68iIIw6gHtcOl6HuRw== X-Google-Smtp-Source: AGHT+IFMBiFL0JG2zzEuERZ9x0mREwECvCDw0/RAi1Kh/Y+gf9GffivQemCA/LO0b3OZVrrpzBEMLA== X-Received: by 2002:a17:906:8b:b0:9a5:846d:d823 with SMTP id 11-20020a170906008b00b009a5846dd823mr15011564ejc.45.1696854630890; Mon, 09 Oct 2023 05:30:30 -0700 (PDT) Received: from localhost ([2a02:ed3:916:6300:c3db:b80e:a694:a54f]) by smtp.gmail.com with ESMTPSA id z11-20020a170906074b00b00988f168811bsm6779198ejb.135.2023.10.09.05.30.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 05:30:30 -0700 (PDT) From: Efraim Flashner To: guix-patches@gnu.org Subject: [PATCH] guix: import: Don't import yanked rust crates. Date: Mon, 9 Oct 2023 15:28:01 +0300 Message-ID: <7e6cbc6b1b853dcc951ba85efc5f90a7443ff800.1696854438.git.efraim@flashner.co.il> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-Debbugs-Cc: Efraim Flashner Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::636; envelope-from=efraim.flashner@gmail.com; helo=mail-ej1-x636.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.25, 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: 1.5 (+) 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: * guix/import/crate.scm (): Add yanked? field. (crate->guix-package)[find-crate-version]: Remove versions which have been yanked. * tests/crate.scm: Adjust tests for new yanked? field. [...] Content analysis details: (1.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (efraim.flashner[at]gmail.com) -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different X-Debbugs-Envelope-To: submit Cc: Efraim Flashner 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/import/crate.scm (): Add yanked? field. (crate->guix-package)[find-crate-version]: Remove versions which have been yanked. * tests/crate.scm: Adjust tests for new yanked? field. --- Before this patch `guix import core-foundation-sys` would give 0.8.4 (the listed max version), `guix import core-foundation-sys@0.8` would give 0.8.5 (which was yanked but was higher than 0.8.4). Similarly, before `guix import core-foundation-sys@0.7` gave 0.7.2 and after 0.7.0. guix/import/crate.scm | 7 ++++++- tests/crate.scm | 40 +++++++++++++++++++++++++++------------- 2 files changed, 33 insertions(+), 14 deletions(-) diff --git a/guix/import/crate.scm b/guix/import/crate.scm index 6e10ebb5d4..a7eafb023e 100644 --- a/guix/import/crate.scm +++ b/guix/import/crate.scm @@ -5,6 +5,7 @@ ;;; Copyright © 2021 Nicolas Goaziou ;;; Copyright © 2022 Hartmut Goebel ;;; Copyright © 2023 Simon Tournier +;;; Copyright © 2023 Efraim Flashner ;;; ;;; This file is part of GNU Guix. ;;; @@ -82,6 +83,7 @@ (define-json-mapping make-crate-version crate-version? (match-lambda ('null #f) ((? string? str) str))) + (yanked? crate-version-yanked? "yanked") ;boolean (links crate-version-links)) ;alist ;; Crate dependency. Each dependency (each edge in the graph) is annotated as @@ -256,12 +258,15 @@ (define* (crate->guix-package crate-name #:key version include-dev-deps? (semver->string (last versions))))) ;; find the highest version of a crate that fulfills the semver + ;; and hasn't been yanked (define (find-crate-version crate range) (let* ((semver-range (string->semver-range range)) (versions (sort (filter (lambda (entry) - (semver-range-contains? semver-range (first entry))) + (and + (not (crate-version-yanked? (second entry))) + (semver-range-contains? semver-range (first entry)))) (map (lambda (ver) (list (string->semver (crate-version-number ver)) ver)) diff --git a/tests/crate.scm b/tests/crate.scm index 720fcb212c..5aea5efaf3 100644 --- a/tests/crate.scm +++ b/tests/crate.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2016 David Craven ;;; Copyright © 2019, 2020, 2022 Ludovic Courtès ;;; Copyright © 2020 Martin Becze +;;; Copyright © 2023 Efraim Flashner ;;; ;;; This file is part of GNU Guix. ;;; @@ -76,21 +77,24 @@ (define test-foo-crate \"license\": \"MIT OR Apache-2.0\", \"links\": { \"dependencies\": \"/api/v1/crates/foo/0.8.1/dependencies\" - } + }, + \"yanked\": false }, { \"id\": 234212, \"num\": \"1.0.0\", \"license\": \"MIT OR Apache-2.0\", \"links\": { \"dependencies\": \"/api/v1/crates/foo/1.0.0/dependencies\" - } + }, + \"yanked\": false }, { \"id\": 234214, \"num\": \"1.0.3\", \"license\": \"MIT OR Apache-2.0\", \"links\": { \"dependencies\": \"/api/v1/crates/foo/1.0.3/dependencies\" - } + }, + \"yanked\": false } ] } @@ -123,14 +127,16 @@ (define test-root-crate \"license\": \"MIT OR Apache-2.0\", \"links\": { \"dependencies\": \"/api/v1/crates/root/1.0.0/dependencies\" - } + }, + \"yanked\": false }, { \"id\": 234242, \"num\": \"1.0.4\", \"license\": \"MIT OR Apache-2.0\", \"links\": { \"dependencies\": \"/api/v1/crates/root/1.0.4/dependencies\" - } + }, + \"yanked\": false } ] } @@ -178,21 +184,24 @@ (define test-intermediate-a-crate \"license\": \"MIT OR Apache-2.0\", \"links\": { \"dependencies\": \"/api/v1/crates/intermediate-a/1.0.40/dependencies\" - } + }, + \"yanked\": false }, { \"id\": 234250, \"num\": \"1.0.42\", \"license\": \"MIT OR Apache-2.0\", \"links\": { \"dependencies\": \"/api/v1/crates/intermediate-a/1.0.42/dependencies\" - } + }, + \"yanked\": false }, { \"id\": 234252, \"num\": \"1.1.0-alpha.1\", \"license\": \"MIT OR Apache-2.0\", \"links\": { \"dependencies\": \"/api/v1/crates/intermediate-a/1.1.0-alpha.1/dependencies\" - } + }, + \"yanked\": false } ] } @@ -235,7 +244,8 @@ (define test-intermediate-b-crate \"license\": \"MIT OR Apache-2.0\", \"links\": { \"dependencies\": \"/api/v1/crates/intermediate-b/1.2.3/dependencies\" - } + }, + \"yanked\": false } ] } @@ -268,14 +278,16 @@ (define test-leaf-alice-crate \"license\": \"MIT OR Apache-2.0\", \"links\": { \"dependencies\": \"/api/v1/crates/leaf-alice/0.7.3/dependencies\" - } + }, + \"yanked\": false }, { \"id\": 234272, \"num\": \"0.7.5\", \"license\": \"MIT OR Apache-2.0\", \"links\": { \"dependencies\": \"/api/v1/crates/leaf-alice/0.7.5/dependencies\" - } + }, + \"yanked\": false } ] } @@ -302,7 +314,8 @@ (define test-leaf-bob-crate \"license\": \"MIT OR Apache-2.0\", \"links\": { \"dependencies\": \"/api/v1/crates/leaf-bob/3.0.1/dependencies\" - } + }, + \"yanked\": false } ] } @@ -597,7 +610,8 @@ (define test-doctool-crate \"license\": \"MIT OR Apache-2.0\", \"links\": { \"dependencies\": \"/api/v1/crates/doctool/2.2.2/dependencies\" - } + }, + \"yanked\": false } ] } base-commit: 9b77bd0b9b4f3de69390da0ba7db5b9dbc01e554 -- Efraim Flashner רנשלפ םירפא GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 18 22:25:36 2023 Received: (at 66421) by debbugs.gnu.org; 19 Oct 2023 02:25:36 +0000 Received: from localhost ([127.0.0.1]:35241 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtIjA-0001cI-8T for submit@debbugs.gnu.org; Wed, 18 Oct 2023 22:25:36 -0400 Received: from mail-qv1-xf29.google.com ([2607:f8b0:4864:20::f29]:60748) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtIj5-0001bu-1m for 66421@debbugs.gnu.org; Wed, 18 Oct 2023 22:25:34 -0400 Received: by mail-qv1-xf29.google.com with SMTP id 6a1803df08f44-66d09b6d007so48542766d6.1 for <66421@debbugs.gnu.org>; Wed, 18 Oct 2023 19:25:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697682299; x=1698287099; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=su2U3EtRw12pkyY0c+25aRavdQdEO7UX7NBKIZZ6reQ=; b=SUrJKsZK7/1v79u96C2Ll/2Drxlz9irpHwjO9AXbpn/g73Z3ybvge3yMq+10Yp3qud lJl7h5vdpD140Mwv+xGAa/4RhT2ignkRW+NvqVRSaSQ3GjhuyBiH8yrJvwzcB+L/Zun2 cENRmQ1gY+7o/Q+A8NwDpW6dRQXU1kAtntWPZwl9ALBbaMymdvkicY4lJkB9ODS9HSnT qcVm2UDvHQbEcVP3BYwGz8ah8rG2N+hRHedBgf6ktNm6nCsc6xPcPSnN9Y08DSrDW9a0 8Tx1JGnQqchR+N6XNw7GrwL/UcCbsmXORUkBCCmsQMIn25TNzzmoaGhWuzSIRJagMYAZ +oHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697682299; x=1698287099; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=su2U3EtRw12pkyY0c+25aRavdQdEO7UX7NBKIZZ6reQ=; b=dcLfhkNIUomsqs4BT7QXpaiaWA1M8OsiZejQC12d8EoekGnmP7tsj7pmhDBN6MmWoq kB1RMhdQ5BaIBRAX7fotIeQc8E14aJkhVYU6g4XCcD10ffcYpPiL2d6qETDQ4o4ws7Mj WZ9PpbYuL6NmbAtfCnDYgBbjmaB5qnmWvzIpWN9zuLLvw5xu0D2c9ET4opiikz3Bgwhn T0L3ivGYsbRE5aYMpSvRlcH+vLHNJv1BQGzgNzJr3Mw3EgzxmpsSWhi/v6/euiJQcxK2 PJ0pQcOFRcBqntpZlfhz2pri5tJpn000Ew1vTopfsXqUBgIz+GHZ8MACll2z5O6QuRlr cyGQ== X-Gm-Message-State: AOJu0YzPktSWN85ehOsVHY0wKcrk0PsAo7QcjKQqCRNFc4nQbvclLtGW 8/wOznjWwhoMms2FON/bwOkGVu3fc1I= X-Google-Smtp-Source: AGHT+IE5vk48B7lKMPV+xpgp8EvbFNOXVEWGUl0uL4GObCXTuc/rBkMGso1n7mu1ahvequP85KDdow== X-Received: by 2002:a0c:b41d:0:b0:66d:1ca1:cb86 with SMTP id u29-20020a0cb41d000000b0066d1ca1cb86mr938479qve.60.1697682298731; Wed, 18 Oct 2023 19:24:58 -0700 (PDT) Received: from hurd (dsl-155-177.b2b2c.ca. [66.158.155.177]) by smtp.gmail.com with ESMTPSA id q6-20020a0ce9c6000000b0066d15e2b73fsm428407qvo.145.2023.10.18.19.24.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 19:24:58 -0700 (PDT) From: Maxim Cournoyer To: Efraim Flashner Subject: Re: [bug#66421] [PATCH] guix: import: Don't import yanked rust crates. In-Reply-To: <7e6cbc6b1b853dcc951ba85efc5f90a7443ff800.1696854438.git.efraim@flashner.co.il> (Efraim Flashner's message of "Mon, 9 Oct 2023 15:28:01 +0300") References: <7e6cbc6b1b853dcc951ba85efc5f90a7443ff800.1696854438.git.efraim@flashner.co.il> Date: Wed, 18 Oct 2023 22:24:57 -0400 Message-ID: <87pm1bpcw6.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 66421 Cc: 66421@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Efraim, Efraim Flashner writes: > * guix/import/crate.scm (): Add yanked? field. > (crate->guix-package)[find-crate-version]: Remove versions which have > been yanked. > * tests/crate.scm: Adjust tests for new yanked? field. > --- > > Before this patch `guix import core-foundation-sys` would give 0.8.4 > (the listed max version), `guix import core-foundation-sys@0.8` would > give 0.8.5 (which was yanked but was higher than 0.8.4). Similarly, > before `guix import core-foundation-sys@0.7` gave 0.7.2 and after 0.7.0. > > guix/import/crate.scm | 7 ++++++- > tests/crate.scm | 40 +++++++++++++++++++++++++++------------- > 2 files changed, 33 insertions(+), 14 deletions(-) > > diff --git a/guix/import/crate.scm b/guix/import/crate.scm > index 6e10ebb5d4..a7eafb023e 100644 > --- a/guix/import/crate.scm > +++ b/guix/import/crate.scm > @@ -5,6 +5,7 @@ > ;;; Copyright =C2=A9 2021 Nicolas Goaziou > ;;; Copyright =C2=A9 2022 Hartmut Goebel > ;;; Copyright =C2=A9 2023 Simon Tournier > +;;; Copyright =C2=A9 2023 Efraim Flashner > ;;; > ;;; This file is part of GNU Guix. > ;;; > @@ -82,6 +83,7 @@ (define-json-mapping make-crate-version= crate-version? > (match-lambda > ('null #f) > ((? string? str) str))) > + (yanked? crate-version-yanked? "yanked") ;boolean > (links crate-version-links)) ;alist >=20=20 > ;; Crate dependency. Each dependency (each edge in the graph) is annota= ted as > @@ -256,12 +258,15 @@ (define* (crate->guix-package crate-name #:key vers= ion include-dev-deps? > (semver->string (last versions))))) >=20=20 > ;; find the highest version of a crate that fulfills the semver > + ;; and hasn't been yanked While touching this comment, it'd be nice to turn add punctuation (capitalize the first letter and add a period). > (define (find-crate-version crate range) > (let* ((semver-range (string->semver-range range)) > (versions > (sort > (filter (lambda (entry) > - (semver-range-contains? semver-range (first entry= ))) > + (and > + (not (crate-version-yanked? (second entry))) > + (semver-range-contains? semver-range (first ent= ry)))) > (map (lambda (ver) > (list (string->semver (crate-version-number = ver)) > ver)) LGTM. Related, but not in scope, could be to rewrite the above using a match-lambda instead of accessing the entry items via first second. --=20 Thanks, Maxim From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 22 09:58:34 2023 Received: (at 66421-done) by debbugs.gnu.org; 22 Oct 2023 13:58:34 +0000 Received: from localhost ([127.0.0.1]:47866 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quYyQ-0001f4-6D for submit@debbugs.gnu.org; Sun, 22 Oct 2023 09:58:34 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:54537) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quYyN-0001en-5f for 66421-done@debbugs.gnu.org; Sun, 22 Oct 2023 09:58:32 -0400 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-40859c464daso8828525e9.1 for <66421-done@debbugs.gnu.org>; Sun, 22 Oct 2023 06:58:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697983077; x=1698587877; darn=debbugs.gnu.org; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:sender:from:to :cc:subject:date:message-id:reply-to; bh=Ng0XmTweRTcMH7maLpvA0Iiig+fzbDAy5wDNrCz8b6Y=; b=aPw+yE0gI9M4Lk5Tfs/k5qQ5T4F8WfRN98fm/XILaLYMyOpA5C+rEohCvQkRqbNnpr +Gpu0xzl59SHq8J8gCSRp1xyCGsE15kihK2DRAP1RGfLRsUZ8MlVGryG3vzAXlRHCCew VFSzt9WC78g0tOP5QJf+hj/AoXVsM6K4XZBGHoXueqIthbJBwlajewsZXiRJWxSs5l0S PmkGRtVmrDtHvL141+t6gApqisf/co+TDcR8QM5Dcak/GnY+hrThSw2KLhire9L/kOsd ovWQib7Jf0v4j8RKTHhGxhwMX53IpC3ypIp6w+EautrMqxXy2I4ghD5kKxpt10f1an+2 RZEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697983077; x=1698587877; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:sender :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Ng0XmTweRTcMH7maLpvA0Iiig+fzbDAy5wDNrCz8b6Y=; b=kV7R0p7bTStrqr2VeG00WOD7R+cPHdfyG7kCUQ0LKBEegwO5N8G6SZ5iC8ogjQM2Fh +WGQoQkHk88nHVYzyT/x03fwg/xyTinGTZafs6Qi9vEmvu2Ttmu0Ihvnncu9wVdIfp6r YG4v5EomhtCOLRteYKeWD207qMx+x0Bte3LFGnIUyKVYW3QMbJSyL4FeKLwV5o7wfRJd eAOThlMx/aunKsR5bLSInBO02ogDdeBwRVBEoDj0buVlJe4pTwXIc/f/4KJe7Jz+YZdu jOpnkdo06Qae62mmWrIAlpAiUxCBDiYH+AgdrvL1YmK0QtlbQqoZMOscXMIsGUdqei1S Yw6g== X-Gm-Message-State: AOJu0YxfJ68UhNWpCW6/A0VJnUO3Jkb6yV9gTkkvO4TiS3dW7XkRnrFo TlNkMM8F7V+F47pICbUU6mU= X-Google-Smtp-Source: AGHT+IEM9Dd6SZfOqZI+Z8lTbbNMey7jpiUe0HcFyesY0it0tw47rtx5nkcklhqaxOg66aNIFg9YlQ== X-Received: by 2002:a05:600c:1e0d:b0:405:3d83:2b76 with SMTP id ay13-20020a05600c1e0d00b004053d832b76mr5407749wmb.13.1697983076676; Sun, 22 Oct 2023 06:57:56 -0700 (PDT) Received: from localhost ([2a02:ed3:910:1200:badd:9b4c:3cb7:2e46]) by smtp.gmail.com with ESMTPSA id bh9-20020a05600c3d0900b003feae747ff2sm11923237wmb.35.2023.10.22.06.57.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Oct 2023 06:57:56 -0700 (PDT) Date: Sun, 22 Oct 2023 16:57:54 +0300 From: Efraim Flashner To: Maxim Cournoyer Subject: Re: [bug#66421] [PATCH] guix: import: Don't import yanked rust crates. Message-ID: Mail-Followup-To: Efraim Flashner , Maxim Cournoyer , 66421-done@debbugs.gnu.org References: <7e6cbc6b1b853dcc951ba85efc5f90a7443ff800.1696854438.git.efraim@flashner.co.il> <87pm1bpcw6.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="yRaq5Veqpvm2sqip" Content-Disposition: inline In-Reply-To: <87pm1bpcw6.fsf@gmail.com> X-PGP-Key-ID: 0x41AAE7DCCA3D8351 X-PGP-Key: https://flashner.co.il/~efraim/efraim_flashner.asc X-PGP-Fingerprint: A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 66421-done Cc: 66421-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.5 (/) --yRaq5Veqpvm2sqip Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 18, 2023 at 10:24:57PM -0400, Maxim Cournoyer wrote: > Hi Efraim, >=20 > Efraim Flashner writes: >=20 > > * guix/import/crate.scm (): Add yanked? field. > > (crate->guix-package)[find-crate-version]: Remove versions which have > > been yanked. > > * tests/crate.scm: Adjust tests for new yanked? field. > > --- > > > > Before this patch `guix import core-foundation-sys` would give 0.8.4 > > (the listed max version), `guix import core-foundation-sys@0.8` would > > give 0.8.5 (which was yanked but was higher than 0.8.4). Similarly, > > before `guix import core-foundation-sys@0.7` gave 0.7.2 and after 0.7.0. > > > > guix/import/crate.scm | 7 ++++++- > > tests/crate.scm | 40 +++++++++++++++++++++++++++------------- > > 2 files changed, 33 insertions(+), 14 deletions(-) > > > > diff --git a/guix/import/crate.scm b/guix/import/crate.scm > > index 6e10ebb5d4..a7eafb023e 100644 > > --- a/guix/import/crate.scm > > +++ b/guix/import/crate.scm > > @@ -5,6 +5,7 @@ > > ;;; Copyright =C2=A9 2021 Nicolas Goaziou > > ;;; Copyright =C2=A9 2022 Hartmut Goebel > > ;;; Copyright =C2=A9 2023 Simon Tournier > > +;;; Copyright =C2=A9 2023 Efraim Flashner > > ;;; > > ;;; This file is part of GNU Guix. > > ;;; > > @@ -82,6 +83,7 @@ (define-json-mapping make-crate-versi= on crate-version? > > (match-lambda > > ('null #f) > > ((? string? str) str))) > > + (yanked? crate-version-yanked? "yanked") ;boolean > > (links crate-version-links)) ;alist > > =20 > > ;; Crate dependency. Each dependency (each edge in the graph) is anno= tated as > > @@ -256,12 +258,15 @@ (define* (crate->guix-package crate-name #:key ve= rsion include-dev-deps? > > (semver->string (last versions))))) > > =20 > > ;; find the highest version of a crate that fulfills the semver > > + ;; and hasn't been yanked >=20 > While touching this comment, it'd be nice to turn add punctuation > (capitalize the first letter and add a period). Done > > (define (find-crate-version crate range) > > (let* ((semver-range (string->semver-range range)) > > (versions > > (sort > > (filter (lambda (entry) > > - (semver-range-contains? semver-range (first ent= ry))) > > + (and > > + (not (crate-version-yanked? (second entry))) > > + (semver-range-contains? semver-range (first e= ntry)))) > > (map (lambda (ver) > > (list (string->semver (crate-version-numbe= r ver)) > > ver)) >=20 > LGTM. Related, but not in scope, could be to rewrite the above using a > match-lambda instead of accessing the entry items via first second. This I'm going to have to spend some more time on, I haven't used match-lambda much. --=20 Efraim Flashner =D7=A8=D7=A0=D7=A9=D7=9C=D7=A4 = =D7=9D=D7=99=D7=A8=D7=A4=D7=90 GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted --yRaq5Veqpvm2sqip Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmU1Kl8ACgkQQarn3Mo9 g1HhfA//SDcXKQuOpYupjQ0LswhOa5pY6gv1ActtBwAqyRPFdlr93RIF3f/puW4w JzTXPKx2GHgaqTp+gcsEEqTj76q5YtjJEl8kxEDlVd/ECQFv7HkINEgtHOvZy52U 8oLTlFSDD/bBkDg3XDPPH9VyWdwLYY8WS8GKWiDm21NM2PiN1IlVSdQUwnn93KBg 2ggNyRvvMMR6aOYksG2lvZCwMUEAMcbhOXCHhEZJOWMLx627VKAtYwkanzuX2RBc g9nCmCDDu4kLXXNJiMzii4u2s1bSLclY53OBEuQD37fS/uTg/hXbBX7gtjCBo2Yl OKZv6oZOCq9DEk3dwoWeeiZAqYeWPop0qP1hgyPvhcyPO6n9eRZxaPUs4RyyxlPW hID5bhlhtVPDyZfZUUR746zQWuLPU/IoWZ7uDxPqsNUULJB2OO9CA2Kt+kV6YIZa O6ya1hbpYwIpKcRozhQrMYFZPneuSNGzdaseqYMi0Uv145sul4TkElim3GjgeIP6 Ckuj4FMyyLh4WiJRkDdBPsZFeiI5JvQ0aZtP8ThsJZsc4rW2hLoKx9ekrV3KCcI1 gtr1wZjTSVW64Q7CI/4k4U0fYr1sxGvNUteehVIcmsNyTMhPwmQ3jK45/PsWSLOR LRAn9ECA3Ec6mFNZrHyfJ8vUF3Ff9vufAFySh64YWwPbPIx03p0= =Y3Hc -----END PGP SIGNATURE----- --yRaq5Veqpvm2sqip-- From unknown Tue Jun 17 01:46:15 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 20 Nov 2023 12:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator