From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id UOn+IbgqNWUtvAAAauVa8A:P1 (envelope-from ) for ; Sun, 22 Oct 2023 15:59:20 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id UOn+IbgqNWUtvAAAauVa8A (envelope-from ) for ; Sun, 22 Oct 2023 15:59:20 +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 0F4C061876 for ; Sun, 22 Oct 2023 15:59:20 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=aPw+yE0g; 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=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1697983160; 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:resent-to: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=Ng0XmTweRTcMH7maLpvA0Iiig+fzbDAy5wDNrCz8b6Y=; b=soHw0M5fnU7bCGGFRH3ZQxjkwj9iptN1BpG7ZASyF5ZO/yavgwJcuO9X95HCNsdum/9xnB 28VWI3kDNpWisO2knwHpBbURdY6HRVSBWLyGauk/MWQWmS/gcmjr5D4jbb2MFNZh9oi8XJ UojMKV+4UZo/QcVI+YtaSXYHfEumNw0Jansv/QjPr38MJZmVjc1WxqWIs0lFzxQqNExuNm X5e5ohCG+n5P0/r+to+sR0uPxWE8QzGjb7dIn7KuWl24wKX2Gs7pLL8AFG1yUik6s/6ZhF K0HQPVS18G3CCiaAJ3PoE7SMNGS9pM9Rw2fOWfjWcR6mrIyGKzVqJehueTUKag== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1697983160; a=rsa-sha256; cv=none; b=Rdi7sjRm/Vc7lWFADQ1nNKpbWVO9SGwc5ClEOp2LeZoKYf6ELcXPFy6D+/gwLcRYjzSbD5 TgSQsJtp8SRwLFkGKQSWxWcV7vVSRiXRZBCtjI+g0z8tS+lIxzo2u45m/qwe7dgSFKDt8P dGRlt8vc8LYc93ZqBp/3DQQPUAzfE6gG2CC0gV+nYlSUhyhRT1IEvvICnjUjms3UnU9mRK dlS3LuoH3Qe1cyLPX29W7EHwQHLPxYmdoTmT8ayTlnOlvBShzdxiGb3l6NYqlNq/F3LP3W P1Rl2kOWw72ROd8b/3mRYfoCaJGa0ozNjbTWgPRD+6tJIo7zdomrgP22P2fVew== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=aPw+yE0g; 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=none Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1quYyT-0006Yo-9n; Sun, 22 Oct 2023 09:58:37 -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 1quYyQ-0006Y6-Cp for guix-patches@gnu.org; Sun, 22 Oct 2023 09:58:35 -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 1quYyQ-0006Me-4m for guix-patches@gnu.org; Sun, 22 Oct 2023 09:58:34 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1quYys-0001fw-Ga for guix-patches@gnu.org; Sun, 22 Oct 2023 09:59:02 -0400 Subject: bug#66421: [PATCH] guix: import: Don't import yanked rust crates. Resent-From: Efraim Flashner Original-Sender: "Debbugs-submit" Resent-To: guix-patches@gnu.org Resent-Date: Sun, 22 Oct 2023 13:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 66421 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxim Cournoyer Cc: 66421-done@debbugs.gnu.org Received: via spool by 66421-done@debbugs.gnu.org id=D66421.16979831146395 (code D ref 66421); Sun, 22 Oct 2023 13:59:02 +0000 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 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-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-Flow: FLOW_IN X-Migadu-Country: US X-Spam-Score: -3.72 X-Migadu-Queue-Id: 0F4C061876 X-Migadu-Scanner: mx0.migadu.com X-Migadu-Spam-Score: -3.72 X-TUID: WVclpRarbZ9O --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--