From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id mBgVNbGTMGW96QAA9RJhRA:P1 (envelope-from ) for ; Thu, 19 Oct 2023 04:25:53 +0200 Received: from aspmx1.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id mBgVNbGTMGW96QAA9RJhRA (envelope-from ) for ; Thu, 19 Oct 2023 04:25:53 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 7E5EC326E7 for ; Thu, 19 Oct 2023 04:25:53 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=SUrJKsZK; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1697682353; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=su2U3EtRw12pkyY0c+25aRavdQdEO7UX7NBKIZZ6reQ=; b=Ax+tnKpKHqIlggD/PZZRrLdO3c9bnwcXOjA6iwWGXOvxNedkipDEM8daDdal7P+J674lIy jE3ciZdaHV3RdPTszdSsz8iWdJOi6RvE7pUzPiW54WdVLm7ag1ksM0k8BzlLbcby9ScoQU w0fgTfCgpoG4xUyQcDaP86RIyReMSiGROOPrkjGhNCOsrxl0KJXRXIqtYNKbeTPqAx0T7C hInQ9/8k6D8NzYSrUuEJS4im6RIjoChfrUWDuUDAkW3kaPepJurC55zlVwHaR1Kxnm0tc1 yPskDt1d4JnAWnWk2f8OkbJUfH2yip+c/Mg+2u4kKkktRogkxjrIrSFLhf0wLw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=SUrJKsZK; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1697682353; a=rsa-sha256; cv=none; b=NxDPE8I/ra7SxX831FBQ8l20h+pWbAOPVvcCafs2qjCxyKJ12ln+YDkkzDSpD8/ztDuBEY sLosDZm9F0Lifb79Gy47XeDNvj4BJVion3zE91GqoirJh9C4Nxl2hr+buwLMSjbR35zlJW JWirJTUr5mAXqvRr2fPwLC4j3Df8ct37GmwCHSBj+eAQ2ea/aUeMtYFFoK94AW3PJo9Jy9 SqJR21gaBSh8VoD+qm9/Ega06+FgBZEnQMD0OP+ZZnwzAh8MpUuR2k6goMaCWlpKVMf2wE 0gZL5Z3yesACg/uxlurTW69RZjSFtf5LMF5BSmlh5NVOpGtn/3KLjnHPe3sjyg== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtIjD-0002Tg-2V; Wed, 18 Oct 2023 22:25:39 -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 1qtIj9-0002TV-Um for guix-patches@gnu.org; Wed, 18 Oct 2023 22:25:36 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtIj9-000600-Mg for guix-patches@gnu.org; Wed, 18 Oct 2023 22:25:35 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qtIjZ-0001d1-Mc for guix-patches@gnu.org; Wed, 18 Oct 2023 22:26:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#66421] [PATCH] guix: import: Don't import yanked rust crates. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 19 Oct 2023 02:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66421 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Efraim Flashner Cc: 66421@debbugs.gnu.org Received: via spool by 66421-submit@debbugs.gnu.org id=B66421.16976823366222 (code B ref 66421); Thu, 19 Oct 2023 02:26:01 +0000 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 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: 2.87 X-Spam-Score: 2.87 X-Migadu-Queue-Id: 7E5EC326E7 X-Migadu-Scanner: mx2.migadu.com X-TUID: TVd1Iy8FbB1a 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