From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id EFuELr7yI2XINAEAG6o9tA:P1 (envelope-from ) for ; Mon, 09 Oct 2023 14:31:59 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id EFuELr7yI2XINAEAG6o9tA (envelope-from ) for ; Mon, 09 Oct 2023 14:31:58 +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 55297771E2 for ; Mon, 9 Oct 2023 14:31:58 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=FUHvTc24; dmarc=none; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1696854718; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=c7MQRouC39swwzSJOLzPZNKeabvVCaYDMDwUiBff6u8=; b=EqUwTu1oKgmevaAfrUVyN31CbD5+OEvZia2t3jyz24RrG90uy9+DQS4IVRdIOeqToP9pIB RZ2PZnUUE1A3G81RcaVJpbHT/y+pHHZ0y1aekPor1d1b2LMIiRmNICCwcePIkV9T1cjjY/ tATbT9E2H+hE4fv9FpPaz7m0bN8usNrwjyYtZ1NptZXnmk2TqBpckw6Qh/imvomkwceXL4 EBcg244Xy4jLKIaE35duczYAyw6CICJYL+Yw7U+gbGWSt9SItX4xEyoKmefu0zatHosOab G9WYtC0QP4PViJq76+Nqtei12WSgeTrB9P98oiwn3nuTCg1Sn7nrb9Qlz4ajSA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1696854718; a=rsa-sha256; cv=none; b=BdqkrVZNsdtcafsH76CZ6gyROkrFBo9Xx3TLVicdtlBfbmfJS/1BFG4xbQYxmOwiptEQle 3uL6fv4LraVwopvluTqFsqvKrN2QdfDJ2MB/H4yPwV+ylIgxKM07pgtsR4Q2SUvdjypxna 1IPpWN78yqTxesRJJ1JptiOBc8i7to0ricU96nJdaS/ztiGN505eE8dT5mlQ0kuIyRS7bQ o4kkqUUxz3XPx/ClD3OrjuZVNOntxMyA7POIb+kdfLlRDg3RxgTA9WFXsRSbZrqtsLx+6K blu+ZCWLq2vQH5JLVV1TCRxpwFMRQSpkCIG3b3Z4aNryRiDia8SCY3zmcBDlHw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=FUHvTc24; dmarc=none; 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" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qppQG-0003Dz-CF; Mon, 09 Oct 2023 08:31:44 -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 1qppQE-0003Db-F4 for guix-patches@gnu.org; Mon, 09 Oct 2023 08:31:42 -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 1qppQE-0004HP-7A for guix-patches@gnu.org; Mon, 09 Oct 2023 08:31:42 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qppQY-0003f9-DC; Mon, 09 Oct 2023 08:32:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#66421] [PATCH] guix: import: Don't import yanked rust crates. Resent-From: Efraim Flashner Original-Sender: "Debbugs-submit" Resent-CC: efraim@flashner.co.il, guix-patches@gnu.org Resent-Date: Mon, 09 Oct 2023 12:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 66421 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 66421@debbugs.gnu.org Cc: Efraim Flashner , Efraim Flashner X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: Efraim Flashner Received: via spool by submit@debbugs.gnu.org id=B.169685468314018 (code B ref -1); Mon, 09 Oct 2023 12:32:02 +0000 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 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 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-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-Migadu-Scanner: mx0.migadu.com X-Migadu-Spam-Score: -4.21 X-Spam-Score: -4.21 X-Migadu-Queue-Id: 55297771E2 X-TUID: HY43apzXpKGv * 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