From unknown Mon Aug 18 17:54:38 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#68346] [PATCH 0/2] semver aware cargo refresh Resent-From: Efraim Flashner Original-Sender: "Debbugs-submit" Resent-CC: efraim@flashner.co.il, guix-patches@gnu.org Resent-Date: Tue, 09 Jan 2024 13:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 68346 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 68346@debbugs.gnu.org Cc: David Elsing , Jaeme Sifat , 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.170480557512410 (code B ref -1); Tue, 09 Jan 2024 13:07:01 +0000 Received: (at submit) by debbugs.gnu.org; 9 Jan 2024 13:06:15 +0000 Received: from localhost ([127.0.0.1]:38646 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rNBo7-0003E5-14 for submit@debbugs.gnu.org; Tue, 09 Jan 2024 08:06:15 -0500 Received: from lists.gnu.org ([2001:470:142::17]:59306) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rNBo4-0003Dp-Gr for submit@debbugs.gnu.org; Tue, 09 Jan 2024 08:06:13 -0500 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 1rNBnq-0005C8-FC for guix-patches@gnu.org; Tue, 09 Jan 2024 08:05:58 -0500 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rNBno-0002iu-47 for guix-patches@gnu.org; Tue, 09 Jan 2024 08:05:57 -0500 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-3367601a301so2757129f8f.2 for ; Tue, 09 Jan 2024 05:05:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704805552; x=1705410352; 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=LXu+kcUSKPkDxwz6h4xhTofyXZIeg1eeYEo4Sdj8epw=; b=XOJHmpZoRKiGEofaInoYZRpWQRjJGjFkrEwdpA+4xRluJTqFWdE4Ji6wF999C72Wjl +WP9u6LZdMAONqprq58HRRJbSMsm8vRuVYUZmh6z1V29S4UVSi/RijI7D5Ug6VLfn5Je OYpeTeiL99YMJfIhdSoyjraySjsHYBOzmiEDpP+T1WgslrJ7JCjeCrvqlVZqmmlifMMS 7WzNfNuAyXWhFQJoAQLWMKDkSntdVB6GUS1Ie7v7p5slSqm71Baa3LtJVFS5BHnP2xk2 Tv7OQKl8MQg/sfbu98bNgrzNb8L+KSeVkDisvF9ok99N2jmTnmIrNOuEX2UfDu1fSiBN 6klA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704805552; x=1705410352; 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=LXu+kcUSKPkDxwz6h4xhTofyXZIeg1eeYEo4Sdj8epw=; b=wf3ics1Oil6144CPUbZf2b8Lht11Yac2w21RunbyspBSnTi7qGhFeOuoqUdmGka7cM hOtiR+vZmroCzPhVfqGBkD/v4jXk3vonwnqx8JBh2jEUiqC8tqZj66OLXwuYRUgwnpoK lKwmARQvGDwoK0eQULEhgbcl4PR6qSvkbUCFktk5/a4nw2HtBXqhzFz0U5hIoebhkye+ rwVciLJXuCiyYsl0DFrcsrnXnvoTljLex/iT9ybFgrZPBUF3tXu3DFZoMbFl0Vr3p+q+ u8r+m2xgFZ+Opusr3P0A0J/jyLo3FYdf8R0iS/FeDvuhYjqEj9SkC2Axj/r5jZcKd98R R0Dg== X-Gm-Message-State: AOJu0Yyd8JVJfsQw5+q24Hlcb6z0O6F6y3u5mfE/g4nThSuUp6fyNccZ UG6nwOLBJGtRvg3ETCZwrnikXTkRkVu9HA== X-Google-Smtp-Source: AGHT+IH6jTm60waB/pvu9QDUucykX8YQZA2B/DUXrFKAPQKSzlDkBE/a60ZBiWowcgFkBAhEyWOkNg== X-Received: by 2002:a5d:64c8:0:b0:336:5be9:adf4 with SMTP id f8-20020a5d64c8000000b003365be9adf4mr438534wri.179.1704805552201; Tue, 09 Jan 2024 05:05:52 -0800 (PST) Received: from localhost ([141.226.15.142]) by smtp.gmail.com with ESMTPSA id e30-20020adfa45e000000b003373ece28efsm2403380wra.29.2024.01.09.05.05.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 05:05:51 -0800 (PST) From: Efraim Flashner Date: Tue, 9 Jan 2024 15:05:45 +0200 Message-ID: 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::432; envelope-from=efraim.flashner@gmail.com; helo=mail-wr1-x432.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.248, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: These patches make 'guix refresh' take into account the semver of the crate and only suggest upgrading to one which still matches the semver constraints and isn't yanked. Then I went and used the func [...] 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) 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 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 -0.0 T_SCC_BODY_TEXT_LINE No description available. 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 (/) These patches make 'guix refresh' take into account the semver of the crate and only suggest upgrading to one which still matches the semver constraints and isn't yanked. Then I went and used the functions to factor out some of the other code. Efraim Flashner (2): import: crate: Update to latest semver version. import: crate: Simplify find-crate-version. guix/import/crate.scm | 59 +++++++++++++++++++++++++++---------------- 1 file changed, 37 insertions(+), 22 deletions(-) base-commit: b26926189e5bf253093050f9a73f2d9d7555cc3e -- 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 unknown Mon Aug 18 17:54:38 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#68346] [PATCH 1/2] import: crate: Update to latest semver version. Resent-From: Efraim Flashner Original-Sender: "Debbugs-submit" Resent-CC: efraim@flashner.co.il, guix-patches@gnu.org Resent-Date: Tue, 09 Jan 2024 13:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68346 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 68346@debbugs.gnu.org Cc: David Elsing , Jaeme Sifat , Efraim Flashner , Efraim Flashner X-Debbugs-Original-Xcc: Efraim Flashner Received: via spool by 68346-submit@debbugs.gnu.org id=B68346.170480568512655 (code B ref 68346); Tue, 09 Jan 2024 13:09:02 +0000 Received: (at 68346) by debbugs.gnu.org; 9 Jan 2024 13:08:05 +0000 Received: from localhost ([127.0.0.1]:38664 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rNBpt-0003I2-8r for submit@debbugs.gnu.org; Tue, 09 Jan 2024 08:08:05 -0500 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:51677) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rNBpr-0003HI-65 for 68346@debbugs.gnu.org; Tue, 09 Jan 2024 08:08:04 -0500 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-40e461c1f44so23066625e9.3 for <68346@debbugs.gnu.org>; Tue, 09 Jan 2024 05:07:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704805670; x=1705410470; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=dGdCCmKnAbyuiop/5p13zS4pouvBWcBYvN3OcEkbuFc=; b=N3+4S8Om+6LHE79H3h2IAdc3R8KXTfW6W3m3SQW9sZrA39N0mBinIF3bAxfKtFNnpq 9c+o6A+rTqVAwQTCsVI6NMuVQvrM4TgPoS/Ez0UlphbU4xA+Z0iHAD+HVQY6A91FgKGR VbxXl2iwpJvp3Cs6wKV/jOiJSU0DoOvfvC0okLTWipqyxJBUVqZBsKl62dqYMkFEXjss bgfSZbUoFmQ8L79zVifJAzHS//rBItUcWGijxfd+J34kkfzoxssjZ2w18dhJvLfwgz13 ByNWM4KEPFbWRtOlxCXMv53STlEZwb+Gg8Z1sli1x9KqU7d/kUJMdbLIWoWDX9xFqYEs LtSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704805670; x=1705410470; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=dGdCCmKnAbyuiop/5p13zS4pouvBWcBYvN3OcEkbuFc=; b=JHrW8RkHXNRepc6a6DnkJFLX/JViuXRv78+1PSoc97FnBd/pSgVOhi8mZeoN6pgIis WNA62XEGSualZmRLfCC3Ke6U/mNI/hBeVXU4ftGyVkr3pmJETvtDCExIcfiSkNva54s4 VLDQWzRk1R90z3ct3Ie47ce2cfz7JtA0U4vVG0ADFO0gXPRcTEsBBFrml6w1rd1h4RnD /Fbi+SZz7C9hZ+xrlssjBPhl79W5ed0cnrIgE5WsAJ3FSR8X3vgLizYS0mfTCjLdqigS o/Qd6MGmRt3zpRx9igNcJe/kvlyUgJ/B3DVdJxK021zIpipeNKDFRUJwWVRm9ixt/KOU rhCA== X-Gm-Message-State: AOJu0YwAtHLMQEOnIEdLDmtVs4/o+f1KCAmYrso8qKJxasNo+lRLXa/x SjlugTZFRNI5yYoFzrjMTaqAM8HTJoLsYQ== X-Google-Smtp-Source: AGHT+IFJp0GF1wf1O6WvcNuFIYz++ItyezYOL/XFtVeM8GcSDSskG2Fm4zFiyXabFmL4CF4zVkzbTg== X-Received: by 2002:a5d:678c:0:b0:336:5f5b:f0bb with SMTP id v12-20020a5d678c000000b003365f5bf0bbmr544861wru.69.1704805670174; Tue, 09 Jan 2024 05:07:50 -0800 (PST) Received: from localhost ([141.226.15.142]) by smtp.gmail.com with ESMTPSA id f16-20020adff450000000b0033664ffaf5dsm2373773wrp.37.2024.01.09.05.07.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 05:07:49 -0800 (PST) From: Efraim Flashner Date: Tue, 9 Jan 2024 15:07:36 +0200 Message-ID: <95ec7b98522617a6e033bfba98384b88c5535264.1704805408.git.efraim@flashner.co.il> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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/import/crate.scm (max-crate-version-of-semver, nonyanked-crate-versions): New procedures. (import-release)[version]: Update to the requested version or the newest semver-compatible version. Change-Id: I72b081147c4eb9faf482f159b7145aaaf9f91f29 --- guix/import/crate.scm | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/guix/import/crate.scm b/guix/import/crate.scm index c57bd0bc6a..43f80f3fb7 100644 --- a/guix/import/crate.scm +++ b/guix/import/crate.scm @@ -5,7 +5,7 @@ ;;; Copyright © 2021 Nicolas Goaziou ;;; Copyright © 2022 Hartmut Goebel ;;; Copyright © 2023 Simon Tournier -;;; Copyright © 2023 Efraim Flashner +;;; Copyright © 2023, 2024 Efraim Flashner ;;; Copyright © 2023 David Elsing ;;; ;;; This file is part of GNU Guix. @@ -233,6 +233,27 @@ (define (string->license string) 'unknown-license!))) (string-split string (string->char-set " /")))) +(define (max-crate-version-of-semver semver-range range) + "Returns a of the highest version within the semver range." + (let ((matching-crates + (sort + (filter (lambda (entry) + (semver-range-contains? + semver-range + (string->semver (crate-version-number entry)))) + range) + (lambda (entry1 entry2) + (version>? (crate-version-number entry1) + (crate-version-number entry2)))))) + (and (not (null-list? matching-crates)) + (first matching-crates)))) + +(define (nonyanked-crate-versions crate) + "Returns a list of s which are not yanked by upstream." + (filter (lambda (entry) + (not (crate-version-yanked? entry))) + (crate-versions crate))) + (define* (crate->guix-package crate-name #:key version include-dev-deps? allow-yanked? #:allow-other-keys) @@ -427,6 +448,7 @@ (define (guix-package->crate-name package) (define (crate-name->package-name name) (guix-name "rust-" name)) + ;;; ;;; Updater @@ -440,7 +462,12 @@ (define* (import-release package #:key (version #f)) include a VERSION string to fetch a specific version." (let* ((crate-name (guix-package->crate-name package)) (crate (lookup-crate crate-name)) - (version (or version (crate-latest-version crate))) + (version (or version + (crate-version-number + (max-crate-version-of-semver + (string->semver-range + (string-append "^" (package-version package))) + (nonyanked-crate-versions crate))))) (url (crate-uri crate-name version))) (upstream-source (package (package-name package)) -- 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 unknown Mon Aug 18 17:54:38 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#68346] [PATCH 2/2] import: crate: Simplify find-crate-version. Resent-From: Efraim Flashner Original-Sender: "Debbugs-submit" Resent-CC: efraim@flashner.co.il, guix-patches@gnu.org Resent-Date: Tue, 09 Jan 2024 13:09:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68346 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 68346@debbugs.gnu.org Cc: David Elsing , Jaeme Sifat , Efraim Flashner , Efraim Flashner X-Debbugs-Original-Xcc: Efraim Flashner Received: via spool by 68346-submit@debbugs.gnu.org id=B68346.170480568712664 (code B ref 68346); Tue, 09 Jan 2024 13:09:03 +0000 Received: (at 68346) by debbugs.gnu.org; 9 Jan 2024 13:08:07 +0000 Received: from localhost ([127.0.0.1]:38666 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rNBpu-0003IA-OT for submit@debbugs.gnu.org; Tue, 09 Jan 2024 08:08:07 -0500 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:52342) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rNBps-0003HK-M4 for 68346@debbugs.gnu.org; Tue, 09 Jan 2024 08:08:05 -0500 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-3374eb61cbcso2811908f8f.0 for <68346@debbugs.gnu.org>; Tue, 09 Jan 2024 05:07:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704805672; x=1705410472; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=g/W8nYDqFh679RVf0hdtXSW/H8wqarwhROdcPD8bo78=; b=kcKKQxEGsP/fKW1vpyygf7ARv73DVYFPWcACBgBnL1ltCZatgoLvxo/yniAoHVlwJQ WFBmmKjeyCGcyf3Ja99W4rARcdV9ygWZW1m5odTkDf42MLGDAn1SCrGA1QmkVi2bSKhZ dkUqFXUoauTOTpcKKaTgacsMXB1Fgq5xBx4AE+SfhleKUnhhdsDCQ5A9B801iRhOy5Uu tbWPIt0F3CKDRTo1miCbAOWLNhOIfaCNa/DISeI6fRWp+HBK3qPJ0qkGwzTCTtDQTlI/ cPr2CLTV6V87GZ21gsFuEVo5hVwrkDARQkmvdM/aqsPSGghohqnafEDQNiOF1sm0Ionh Y8CA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704805672; x=1705410472; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=g/W8nYDqFh679RVf0hdtXSW/H8wqarwhROdcPD8bo78=; b=mD3epZzxlyZoYXV5d37vdvpZfYhkHPv/m5WkXABLpTE9OEDeJQ/gCtwmN1H/nDYqOn VsCW2yXw+maE+rxK7e1/HIglHjE1smf8+U0q3OkzujZQBLmBRpR6jA8WkC+fdICL2dUM i1ZNhJwU5j0kHtp1rFerGkq3LhilE82h5o08TN2SNzIz7UI9dSyp29oZh29TR9IChVwL 7ovp6GKi8W+ik1AaXam38u7IJri4BndK1q53TXu4o9i4RD42zAnqZx1A2XnwhjqO56S7 hKm4Gjj54ChjOv7i64+tOWOxtZi9Xnhmue3UaAD5Njno1YKjYKmKwuJBwJ8rdsPbNi9V 8flA== X-Gm-Message-State: AOJu0Yx1qQefXoVyefkrLnsgsRgh00mi17AonQ7gAvJlwh9S/jtjg/YD 20dQtcNzdobfgouFD199Wf7vMOk98lIFLw== X-Google-Smtp-Source: AGHT+IFmzjk6JijvfxzBPAuYMMOuz30Dtqe33fLNB+/dxmVFJeQgXdYsWfJjczjxvMMbnBOXv+Rtzw== X-Received: by 2002:adf:e7c6:0:b0:336:81b:7b3e with SMTP id e6-20020adfe7c6000000b00336081b7b3emr675638wrn.84.1704805672077; Tue, 09 Jan 2024 05:07:52 -0800 (PST) Received: from localhost ([141.226.15.142]) by smtp.gmail.com with ESMTPSA id g8-20020a5d46c8000000b003372befd19bsm2369934wrs.104.2024.01.09.05.07.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 05:07:51 -0800 (PST) From: Efraim Flashner Date: Tue, 9 Jan 2024 15:07:37 +0200 Message-ID: <3caa53187f36dbc95f7b9ef982632cc284981e28.1704805408.git.efraim@flashner.co.il> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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/import/crate.scm (find-crate-version): Reuse nonyanked-crate-versions, max-crate-version-of-semver. Change-Id: I976a3b5a397f0d6a7d723804a98356544bfc7da3 --- guix/import/crate.scm | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/guix/import/crate.scm b/guix/import/crate.scm index 43f80f3fb7..ba2bc1573e 100644 --- a/guix/import/crate.scm +++ b/guix/import/crate.scm @@ -310,26 +310,14 @@ (define* (crate->guix-package ;; If no matching non-yanked version has been found and allow-yanked? is #t, ;; also consider yanked packages. (define (find-crate-version crate range) - (let* ((semver-range (string->semver-range range)) - (versions - (sort - (filter (lambda (entry) - (and - (or allow-yanked? - (not (crate-version-yanked? (second entry)))) - (semver-range-contains? semver-range (first entry)))) - (map (lambda (ver) - (list (string->semver (crate-version-number ver)) - ver)) - (crate-versions crate))) - (match-lambda* (((semver ver) ...) - (match-let (((yanked1 yanked2) - (map crate-version-yanked? ver))) - (or (and yanked1 (not yanked2)) - (and (eq? yanked1 yanked2) - (apply semversemver-range range)) + (versions (nonyanked-crate-versions crate))) + (or (and (not (null-list? versions)) + (max-crate-version-of-semver semver-range versions)) + (and allow-yanked? + (not (null-list? (crate-versions crate))) + (max-crate-version-of-semver semver-range + (crate-versions crate)))))) ;; If no non-yanked existing package version was found, check the upstream ;; versions. If a non-yanked upsteam version exists, use it instead, -- 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 unknown Mon Aug 18 17:54:38 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#68346] [PATCH 0/2] semver aware cargo refresh Resent-From: David Elsing Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 14 Jan 2024 12:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68346 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: efraim@flashner.co.il, 68346@debbugs.gnu.org Cc: Jaeme Sifat , Efraim Flashner X-Debbugs-Original-To: Efraim Flashner , guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.17052368882699 (code B ref -1); Sun, 14 Jan 2024 12:55:02 +0000 Received: (at submit) by debbugs.gnu.org; 14 Jan 2024 12:54:48 +0000 Received: from localhost ([127.0.0.1]:41858 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rP00l-0000hS-Pz for submit@debbugs.gnu.org; Sun, 14 Jan 2024 07:54:48 -0500 Received: from lists.gnu.org ([2001:470:142::17]:37276) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rP00k-0000hE-Ad for submit@debbugs.gnu.org; Sun, 14 Jan 2024 07:54:46 -0500 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 1rP00e-0006Yf-3w for guix-patches@gnu.org; Sun, 14 Jan 2024 07:54:41 -0500 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rP00Z-0000qm-Eb for guix-patches@gnu.org; Sun, 14 Jan 2024 07:54:39 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 8806A240028 for ; Sun, 14 Jan 2024 13:54:29 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1705236869; bh=wrnEFWBR3hb5o8ewKrpmWyHPNF77cnMBnCvxW++Bj0g=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=NOxofeIjkT8phF34PVlUrRkrgCI2azT/bRp/wv2pnYrwfUTI1q+v5Kuknopv5k4AT 4pXYjTOrNJK8PAPVDQ7olS8ZFYZeXKaoiCS2isiXpmjIPDtitsTWs5ALNW/I+jak1N jUlcam1v1jgxje9/AkfyroKvE7aHN0mANFhupjD3Fhd2/u5CeSHMQmyIXj18P/4k5d T/7B+3FtgZVSsvRXLjEHr8Dqk4y2AdxvIFHfwWqLYgIjGOKmIuZhRg60LfuV24ptgk 50nzRJlhGodtxGc6tdg90SXDCp5+V0vSIwGkgKpdHfbnO8YvWMes+6EtQhatfl+HD5 qiYTRvX7JwqAw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4TCZwh5ZQdz9rxK; Sun, 14 Jan 2024 13:54:28 +0100 (CET) From: David Elsing In-Reply-To: References: Date: Sun, 14 Jan 2024 12:54:27 +0000 Message-ID: <86mst8vzwc.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=david.elsing@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.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: -0.0 (/) Hello, Efraim Flashner writes: > These patches make 'guix refresh' take into account the semver of the > crate and only suggest upgrading to one which still matches the semver > constraints and isn't yanked. Then I went and used the functions to > factor out some of the other code. thanks for cleaning this up a bit! I tested your patches and only found the (minor) issue that an exception is thrown instead of returning #f if there is no non-yanked package available. The minimum element can also be found without sorting, so I would suggest something like the following changes: diff --git a/guix/import/crate.scm b/guix/import/crate.scm index ba2bc1573e..76b7c05072 100644 --- a/guix/import/crate.scm +++ b/guix/import/crate.scm @@ -104,7 +104,7 @@ (define-json-mapping make-crate-dependency ;; Autoload Guile-Semver so we only have a soft dependency. (module-autoload! (current-module) - '(semver) '(string->semver semver->string semversemver semver->string semver?)) (module-autoload! (current-module) '(semver ranges) '(string->semver-range semver-range-contains?)) @@ -233,20 +233,32 @@ (define (string->license string) 'unknown-license!))) (string-split string (string->char-set " /")))) +(define (min-element l less) + "Returns the smallest element of l according to less or #f if l is empty." + + (let loop ((curr #f) + (remaining l)) + (if (null-list? remaining) + curr + (let ((next (car remaining)) + (remaining (cdr remaining))) + (if (and curr + (not (less next curr))) + (loop curr remaining) + (loop next remaining)))))) + (define (max-crate-version-of-semver semver-range range) "Returns a of the highest version within the semver range." - (let ((matching-crates - (sort - (filter (lambda (entry) - (semver-range-contains? - semver-range - (string->semver (crate-version-number entry)))) - range) - (lambda (entry1 entry2) - (version>? (crate-version-number entry1) - (crate-version-number entry2)))))) - (and (not (null-list? matching-crates)) - (first matching-crates)))) + + (define (crate->semver crate) + (string->semver (crate-version-number crate))) + + (min-element + (filter (lambda (crate) + (semver-range-contains? semver-range (crate->semver crate))) + range) + (lambda args + (apply semver>? (map crate->semver args))))) (define (nonyanked-crate-versions crate) "Returns a list of s which are not yanked by upstream." @@ -284,8 +296,8 @@ (define version-number ;; Packages previously marked as yanked take lower priority. (define (find-package-version name range) (let* ((semver-range (string->semver-range range)) - (package-versions - (sort + (version + (min-element (filter (match-lambda ((semver yanked) (and (or allow-yanked? (not yanked)) @@ -293,17 +305,17 @@ (define (find-package-version name range) (map (lambda (pkg) (let ((version (package-version pkg))) (list - (string->semver version) - (assoc-ref (package-properties pkg) - 'crate-version-yanked?)))) + (string->semver version) + (assoc-ref (package-properties pkg) + 'crate-version-yanked?)))) (find-packages-by-name (crate-name->package-name name)))) (match-lambda* (((semver1 yanked1) (semver2 yanked2)) - (or (and yanked1 (not yanked2)) - (and (eq? yanked1 yanked2) - (semver? semver1 semver2)))))))) + (and (not (eq? #f version)) + (match-let (((semver yanked) version)) (list (semver->string semver) yanked))))) ;; Find the highest version of a crate that fulfills the semver . @@ -449,18 +461,22 @@ (define* (import-release package #:key (version #f)) "Return an for the latest release of PACKAGE. Optionally include a VERSION string to fetch a specific version." (let* ((crate-name (guix-package->crate-name package)) - (crate (lookup-crate crate-name)) - (version (or version - (crate-version-number - (max-crate-version-of-semver - (string->semver-range - (string-append "^" (package-version package))) - (nonyanked-crate-versions crate))))) - (url (crate-uri crate-name version))) - (upstream-source - (package (package-name package)) - (version version) - (urls (list url))))) + (crate (lookup-crate crate-name)) + (version + (or version + (let ((max-crate-version + (max-crate-version-of-semver + (string->semver-range + (string-append "^" (package-version package))) + (nonyanked-crate-versions crate)))) + (and max-crate-version + (crate-version-number max-crate-version)))))) + (if version + (upstream-source + (package (package-name package)) + (version version) + (urls (list (crate-uri crate-name version)))) + #f))) (define %crate-updater (upstream-updater Cheers, David From unknown Mon Aug 18 17:54:38 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Efraim Flashner Subject: bug#68346: closed (Re: [PATCH 0/2] semver aware cargo refresh) Message-ID: References: X-Gnu-PR-Message: they-closed 68346 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 68346@debbugs.gnu.org Date: Tue, 16 Jan 2024 12:27:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1705408022-26473-1" This is a multi-part message in MIME format... ------------=_1705408022-26473-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #68346: [PATCH 0/2] semver aware cargo refresh which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 68346@debbugs.gnu.org. --=20 68346: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D68346 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1705408022-26473-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 68346-done) by debbugs.gnu.org; 16 Jan 2024 12:26:34 +0000 Received: from localhost ([127.0.0.1]:47997 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rPiWX-0006sA-Ny for submit@debbugs.gnu.org; Tue, 16 Jan 2024 07:26:34 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]:59624) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rPiWV-0006ru-9r for 68346-done@debbugs.gnu.org; Tue, 16 Jan 2024 07:26:31 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-40e86c86a6fso1369345e9.2 for <68346-done@debbugs.gnu.org>; Tue, 16 Jan 2024 04:26:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705407985; x=1706012785; 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=uaY98vGYdWW+zzJ5krnvvYsjonY9lLzjAMEuYHePo0w=; b=d6s7jYQYe3LpY+hYd5dXQMQe7bBLO9f1ZeltHPQWyStv/e4HFvmoJoTve45MFsQbeY fHqAkCFx7Xn4zYeGQT/E/BkZr+hMvLsrUBcI4yh8XjBB4mLrqQDxxv9QZmThxJgU3mzO MMMge9HWS4TWzYNczwnFB2IF8/iUPeoeLODtxgAD9QzCLyj5zBt0RmPkVBzcx3wjkoJ3 exKM6i/RCKEU87AlBC6g5cCrMvVMwvJ587dmlJbhoDNaNZGb82A0hhwpwSCMzXl2Fi6v h4SC5s2F4hjbYQHmQvCZOqfitt5tTZpQDzh6vu21yAmn9/Hfzna2rgZofq62F+Urk1hG xnmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705407985; x=1706012785; 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=uaY98vGYdWW+zzJ5krnvvYsjonY9lLzjAMEuYHePo0w=; b=qCVlUI8dV7TI82Q4uSE9H9Y1T/LsIWJKdH6KjKlSDQvY/ZjaMXDhundMAUgHOEy4JV 2sPjVwjirEMiC3BTTP2Oik0BhpSxV0fr1EwrVhzRk+X6YFeTnNxnJBTitnxbOoaI48Np gNSuk8fWI9PyYxviR5kpEmETcTrVdneFcrfabLTLDdscDyY9/Md1PjGY+bnfWneA10c8 czU4qkPfddIZ9/iE/n+0prAsYS/2y+uVPeZkaag1qGPIZ6AXLLc9o0yfl+Un0UT8qZ3y bctCqjzkh3yp1fqw+lYLJrr5ZpeimCtbksC0szeotwMjSoKy0aWoZ43sdUvOrOt/FpC8 qmtQ== X-Gm-Message-State: AOJu0YyJtEky4IXkAMi25a5bN0jIe33W8KynHuh9aWBW2RULgS0MavxW YpePoh5KkM807RngLDZk7MTG2srNWXo= X-Google-Smtp-Source: AGHT+IEjz+zhVUqFgnxP/PTzTBSnSbIEIH/Rr05FVfU1EuzHLD+waNvpel69l3yJ0ewRpyzDedXe9w== X-Received: by 2002:a05:600c:4686:b0:40e:6305:88a0 with SMTP id p6-20020a05600c468600b0040e630588a0mr2032808wmo.112.1705407984486; Tue, 16 Jan 2024 04:26:24 -0800 (PST) Received: from localhost ([141.226.15.142]) by smtp.gmail.com with ESMTPSA id b20-20020a05600c4e1400b0040e7cff8d4dsm2882129wmq.21.2024.01.16.04.26.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jan 2024 04:26:23 -0800 (PST) Date: Tue, 16 Jan 2024 14:26:21 +0200 From: Efraim Flashner To: David Elsing Subject: Re: [PATCH 0/2] semver aware cargo refresh Message-ID: Mail-Followup-To: Efraim Flashner , David Elsing , 68346-done@debbugs.gnu.org, Jaeme Sifat References: <86mst8vzwc.fsf@posteo.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="DaK+yRH9qnPUJWlF" Content-Disposition: inline In-Reply-To: <86mst8vzwc.fsf@posteo.net> 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: 68346-done Cc: 68346-done@debbugs.gnu.org, Jaeme Sifat 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 (/) --DaK+yRH9qnPUJWlF Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jan 14, 2024 at 12:54:27PM +0000, David Elsing wrote: > Hello, >=20 > Efraim Flashner writes: > > These patches make 'guix refresh' take into account the semver of the > > crate and only suggest upgrading to one which still matches the semver > > constraints and isn't yanked. Then I went and used the functions to > > factor out some of the other code. >=20 > thanks for cleaning this up a bit! I tested your patches and only found > the (minor) issue that an exception is thrown instead of returning #f if > there is no non-yanked package available. The minimum element can also > be found without sorting, so I would suggest something like the > following changes: I still think I like sort better, but it definitely doesn't do as good a job of taking care of the #f case as your code does. I incorporated your changes and pushed them. --=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 --DaK+yRH9qnPUJWlF Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmWmde0ACgkQQarn3Mo9 g1Fe2w/9HOngHFw9Kk2pp3OFX3OUYeNyo3GrAG4LmITBZhHUGzAhgcpdpsF+m6D0 S24H9UxQ1jA5hKs7/T92811SqdUUYKkgk6yz/nF+phTNgx00htxS0azEF0R1l/FX 2Iq1llu2XD8vmreBxoPxJolHN3DLFxo328vBei42USNJpU9RM7Ejc0o2j//GCUqU QiZJVqRa8wIj/N3T5EwBRf+1GzmGRFZOLgw0eXR5nzp/HRJcrFcp6pMNOhedoFXp mf92okG/0KQ08drG3A3bDnHCJloSthJ0E7+N/RkvSyKWFP+io0Qx6xFUzu/Xfcrm wiqcDLCGrjw3qoX6pBQt5XFjDQLdB8AZWZXzTdVc6DyuFZdPTwTJerE40WCiWMEG F1QhATFWmPAlbmwie885I9hmQ59aOpuGzBZWk4krFGuI3KGOJEZDup1xMnDtANhX 2NWcfUbyjtmV7OxOEWRghKGsU+LBADgxrVT2NtpAQnGRUoZJBibuC3QGgFtUg6IX cxld5XUSHGa/bSFV/zaG7ru7/tPoxtOYcQ1YNv2fKyLDTOp+X2WQAopKgbC6dTrf KRTpkCnOlOrYHRaNzcQgnnDipauSKTJJn/1ysLGkBGtP/bUKM9fyWuD3I7arxaow 31zlsIf54ihMnhhMrJ8/lGRF0R5SU6Z0fiXN0fO2p2lbgcv1V0c= =e0EK -----END PGP SIGNATURE----- --DaK+yRH9qnPUJWlF-- ------------=_1705408022-26473-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 9 Jan 2024 13:06:15 +0000 Received: from localhost ([127.0.0.1]:38646 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rNBo7-0003E5-14 for submit@debbugs.gnu.org; Tue, 09 Jan 2024 08:06:15 -0500 Received: from lists.gnu.org ([2001:470:142::17]:59306) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rNBo4-0003Dp-Gr for submit@debbugs.gnu.org; Tue, 09 Jan 2024 08:06:13 -0500 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 1rNBnq-0005C8-FC for guix-patches@gnu.org; Tue, 09 Jan 2024 08:05:58 -0500 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rNBno-0002iu-47 for guix-patches@gnu.org; Tue, 09 Jan 2024 08:05:57 -0500 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-3367601a301so2757129f8f.2 for ; Tue, 09 Jan 2024 05:05:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704805552; x=1705410352; 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=LXu+kcUSKPkDxwz6h4xhTofyXZIeg1eeYEo4Sdj8epw=; b=XOJHmpZoRKiGEofaInoYZRpWQRjJGjFkrEwdpA+4xRluJTqFWdE4Ji6wF999C72Wjl +WP9u6LZdMAONqprq58HRRJbSMsm8vRuVYUZmh6z1V29S4UVSi/RijI7D5Ug6VLfn5Je OYpeTeiL99YMJfIhdSoyjraySjsHYBOzmiEDpP+T1WgslrJ7JCjeCrvqlVZqmmlifMMS 7WzNfNuAyXWhFQJoAQLWMKDkSntdVB6GUS1Ie7v7p5slSqm71Baa3LtJVFS5BHnP2xk2 Tv7OQKl8MQg/sfbu98bNgrzNb8L+KSeVkDisvF9ok99N2jmTnmIrNOuEX2UfDu1fSiBN 6klA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704805552; x=1705410352; 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=LXu+kcUSKPkDxwz6h4xhTofyXZIeg1eeYEo4Sdj8epw=; b=wf3ics1Oil6144CPUbZf2b8Lht11Yac2w21RunbyspBSnTi7qGhFeOuoqUdmGka7cM hOtiR+vZmroCzPhVfqGBkD/v4jXk3vonwnqx8JBh2jEUiqC8tqZj66OLXwuYRUgwnpoK lKwmARQvGDwoK0eQULEhgbcl4PR6qSvkbUCFktk5/a4nw2HtBXqhzFz0U5hIoebhkye+ rwVciLJXuCiyYsl0DFrcsrnXnvoTljLex/iT9ybFgrZPBUF3tXu3DFZoMbFl0Vr3p+q+ u8r+m2xgFZ+Opusr3P0A0J/jyLo3FYdf8R0iS/FeDvuhYjqEj9SkC2Axj/r5jZcKd98R R0Dg== X-Gm-Message-State: AOJu0Yyd8JVJfsQw5+q24Hlcb6z0O6F6y3u5mfE/g4nThSuUp6fyNccZ UG6nwOLBJGtRvg3ETCZwrnikXTkRkVu9HA== X-Google-Smtp-Source: AGHT+IH6jTm60waB/pvu9QDUucykX8YQZA2B/DUXrFKAPQKSzlDkBE/a60ZBiWowcgFkBAhEyWOkNg== X-Received: by 2002:a5d:64c8:0:b0:336:5be9:adf4 with SMTP id f8-20020a5d64c8000000b003365be9adf4mr438534wri.179.1704805552201; Tue, 09 Jan 2024 05:05:52 -0800 (PST) Received: from localhost ([141.226.15.142]) by smtp.gmail.com with ESMTPSA id e30-20020adfa45e000000b003373ece28efsm2403380wra.29.2024.01.09.05.05.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 05:05:51 -0800 (PST) From: Efraim Flashner To: guix-patches@gnu.org Subject: [PATCH 0/2] semver aware cargo refresh Date: Tue, 9 Jan 2024 15:05:45 +0200 Message-ID: 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::432; envelope-from=efraim.flashner@gmail.com; helo=mail-wr1-x432.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.248, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: These patches make 'guix refresh' take into account the semver of the crate and only suggest upgrading to one which still matches the semver constraints and isn't yanked. Then I went and used the func [...] 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) 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 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 -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: submit Cc: David Elsing , Jaeme Sifat , 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 (/) These patches make 'guix refresh' take into account the semver of the crate and only suggest upgrading to one which still matches the semver constraints and isn't yanked. Then I went and used the functions to factor out some of the other code. Efraim Flashner (2): import: crate: Update to latest semver version. import: crate: Simplify find-crate-version. guix/import/crate.scm | 59 +++++++++++++++++++++++++++---------------- 1 file changed, 37 insertions(+), 22 deletions(-) base-commit: b26926189e5bf253093050f9a73f2d9d7555cc3e -- Efraim Flashner רנשלפ םירפא GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted ------------=_1705408022-26473-1--