From patchwork Mon Apr 28 16:23:11 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Hilton Chain X-Patchwork-Id: 42115 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id E134027BC49; Mon, 28 Apr 2025 17:33:59 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FROM_SUSPICIOUS_NTLD,MAILING_LIST_MULTI,PDS_OTHER_BAD_TLD, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL, RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 5CAE227BC49 for ; Mon, 28 Apr 2025 17:33:59 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u9RPo-0007vp-Hq; Mon, 28 Apr 2025 12:33:09 -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 1u9RP4-0007dp-LQ for guix-patches@gnu.org; Mon, 28 Apr 2025 12:32:24 -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 1u9RP3-0004Qv-FH for guix-patches@gnu.org; Mon, 28 Apr 2025 12:32:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=V4BgEMxp3y5LHH/13Zfc78i++Hv7Z668p3Kd4fIxMjY=; b=SI6DjBsyNbH1kWbVhACi0EB4WkCONRt/TSssqj2yEkn6q901lZH/NBiG64Y+r1yhk1kJjvQuP4yWw8ub+/FB5R6oa/g8GgJOhqhad6POR41j0wn2MkHPASihWjrDIrj/uWSTl37hiey+rxuQfEJg4k2PL0JIc2fQk9NkeeeeZzaKoyHl3VsHKmNXEjl7bxs0t/iY230RjLb9iLP1yr3n5WpQdd7S0xy0LfewAjSl/k9hjacBRxSzTQlrqxa+sHjKathpwRllLVVE8w16rg+R+qfInOMc6JTDi1PPM2KcpARSDEO+li4S5DpR328m2qEUS8JD3/miVjFny40nv4Gw4Q==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1u9ROz-0003K9-5Q; Mon, 28 Apr 2025 12:32:17 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77093] [PATCH v4 rust-team 14/22] build/cargo: Don't vendor self. Resent-From: Hilton Chain Original-Sender: "Debbugs-submit" Resent-CC: divya@subvertising.org, efraim@flashner.co.il, hako@ultrarare.space, lars@6xq.net, liliana.prikler@gmail.com, maxim.cournoyer@gmail.com, me@bonfacemunyoki.com, noelopez@free.fr, sharlatanus@gmail.com, steve@futurile.net, tanguy@bioneland.org, vivien@planete-kraus.eu, guix-patches@gnu.org Resent-Date: Mon, 28 Apr 2025 16:32:17 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77093 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77093@debbugs.gnu.org Cc: Hilton Chain , Divya Ranjan Pattanaik , Efraim Flashner , Hilton Chain , Lars-Dominik Braun , Liliana Marie Prikler , Maxim Cournoyer , Munyoki Kilyungi , =?utf-8?q?No=C3=A9?= Lopez , Sharlatan Hellseher , Steve George , Tanguy Le Carrour , Vivien Kraus X-Debbugs-Original-Xcc: Divya Ranjan Pattanaik , Efraim Flashner , Hilton Chain , Lars-Dominik Braun , Liliana Marie Prikler , Maxim Cournoyer , Munyoki Kilyungi , =?utf-8?q?No=C3=A9?= Lopez , Sharlatan Hellseher , Steve George , Tanguy Le Carrour , Vivien Kraus Received: via spool by 77093-submit@debbugs.gnu.org id=B77093.174585792912608 (code B ref 77093); Mon, 28 Apr 2025 16:32:17 +0000 Received: (at 77093) by debbugs.gnu.org; 28 Apr 2025 16:32:09 +0000 Received: from localhost ([127.0.0.1]:32868 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u9ROl-0003Fy-JW for submit@debbugs.gnu.org; Mon, 28 Apr 2025 12:32:09 -0400 Received: from mail.boiledscript.com ([49.12.134.184]:51460) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u9ROQ-0003C2-P2 for 77093@debbugs.gnu.org; Mon, 28 Apr 2025 12:31:43 -0400 From: Hilton Chain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space; s=mail; t=1745857901; h=from:from: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: in-reply-to:in-reply-to:references:references; bh=V4BgEMxp3y5LHH/13Zfc78i++Hv7Z668p3Kd4fIxMjY=; b=bSOSEl2pwX2UM+fGhkZXYNIgqvj3zvi1ZwYsFvmJoUXDq9AhOq3Qz2zlsKIhN/Fp4imAed R/C4pwpGV2c6CE669trsBDS8EuvyIlfpTyANnCYltzzciZ2EUlYSv6W7NYIhtiPwSQTgV0 lnuup2YnPgMe1s4VWNrUbx2UcoWo8hwkUngj+uTq1HTJCqqm2lXg+rs69fvOKQ8KDt+cUX 7+wmcnGr0mKKgypOlBIUmXBr1xCXSSywEKMY4Wxr5GHvGyH3ldRZ7Z01md1RCmOH2frxEk V7iVXUpSK8G3ebM5ei3LHW0hmjLYjMaz64Hj4I3Qovpd24S7alfdvHeLhSgukQ== Date: Tue, 29 Apr 2025 00:23:11 +0800 Message-ID: In-Reply-To: References: MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * guix/build/cargo-build-system.scm (crate-src?, configure): Exclude self. * gnu/packages/gnome.scm (librsvg)[#:phases]: Remove ‘dont-vendor-self’. * gnu/packages/python-crypto.scm (python-cryptography)[#:arguments]: Likewise. * gnu/packages/python-xyz.scm (python-libcst)[#:arguments]: Likewise. * gnu/packages/syndication.scm (newsboat)[#:arguments]: Likewise. * gnu/packages/antivirus.scm (clamav)[#:arguments]: Likewise. Change-Id: I5e01721fb705937f5fcf858c21b6d7e27ade6c10 --- gnu/packages/antivirus.scm | 5 +--- gnu/packages/gnome.scm | 5 ---- gnu/packages/python-crypto.scm | 5 ---- gnu/packages/python-xyz.scm | 5 ---- gnu/packages/syndication.scm | 5 ---- guix/build/cargo-build-system.scm | 43 ++++++++++++++++--------------- 6 files changed, 23 insertions(+), 45 deletions(-) diff --git a/gnu/packages/antivirus.scm b/gnu/packages/antivirus.scm index 4a01115abd..d2060fa385 100644 --- a/gnu/packages/antivirus.scm +++ b/gnu/packages/antivirus.scm @@ -116,10 +116,7 @@ (define-public clamav (add-after 'configure 'fix-cargo-inputs-vendoring (lambda _ ;; Reproduce the original layout, fails with config. - (rename-file ".cargo/config" ".cargo/config.toml") - ;; Wrongly placed by configure - (delete-file-recursively - (string-append ".cargo/vendor/clamav-" #$version ".tar.zst")))) + (rename-file ".cargo/config" ".cargo/config.toml"))) (add-after 'patch-cargo-checksums 'cmake-configure (lambda* (#:key outputs #:allow-other-keys) ((assoc-ref cmake:%standard-phases 'configure) diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm index 26416df155..3de0dfb293 100644 --- a/gnu/packages/gnome.scm +++ b/gnu/packages/gnome.scm @@ -3780,11 +3780,6 @@ (define-public librsvg "--host=" #$(%current-target-system))) #~("--enable-vala"))) args))) - (add-after 'configure 'dont-vendor-self - (lambda* (#:key vendor-dir #:allow-other-keys) - ;; Don't keep the whole tarball in the vendor directory - (delete-file-recursively - (string-append vendor-dir "/" #$name "-" #$version ".tar.xz")))) (replace 'build (assoc-ref gnu:%standard-phases 'build)) (replace 'check diff --git a/gnu/packages/python-crypto.scm b/gnu/packages/python-crypto.scm index d004f6a69e..f7b6609315 100644 --- a/gnu/packages/python-crypto.scm +++ b/gnu/packages/python-crypto.scm @@ -561,11 +561,6 @@ (define-public python-cryptography #:install-source? #false #:phases #~(modify-phases %standard-phases - (add-after 'configure 'dont-vendor-self - (lambda* (#:key vendor-dir #:allow-other-keys) - ;; Don't keep the whole tarball in the vendor directory - (delete-file-recursively - (string-append vendor-dir "/cryptography-" #$version ".tar.zst")))) (replace 'build (assoc-ref py:%standard-phases 'build)) (delete 'check) diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index c63a0a7708..b56d15f202 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -23694,11 +23694,6 @@ (define-public python-libcst (add-after 'unpack 'prepare-source (lambda _ (delete-file "native/Cargo.lock"))) - (add-after 'configure 'dont-vendor-self - (lambda* (#:key vendor-dir #:allow-other-keys) - ;; Don't keep the whole tarball in the vendor directory - (delete-file-recursively - (string-append vendor-dir "/libcst-" #$version ".tar.zst")))) (replace 'build (assoc-ref py:%standard-phases 'build)) (add-after 'install 'wrap diff --git a/gnu/packages/syndication.scm b/gnu/packages/syndication.scm index 61220bb9fe..b597bf9004 100644 --- a/gnu/packages/syndication.scm +++ b/gnu/packages/syndication.scm @@ -311,11 +311,6 @@ (define-public newsboat (("if curl-config") (string-append "if " (search-input-file inputs "/bin/curl-config")))))) - (add-after 'configure 'dont-vendor-self - (lambda* (#:key vendor-dir #:allow-other-keys) - ;; Don't keep the whole tarball in the vendor directory - (delete-file-recursively - (string-append vendor-dir "/" #$name "-" #$version ".tar.xz")))) (add-after 'unpack 'patch-source (lambda* (#:key outputs #:allow-other-keys) (substitute* "Makefile" diff --git a/guix/build/cargo-build-system.scm b/guix/build/cargo-build-system.scm index d1020bab52..c6865e6e81 100644 --- a/guix/build/cargo-build-system.scm +++ b/guix/build/cargo-build-system.scm @@ -70,27 +70,28 @@ (define (single-crate? dir) (call-with-input-file manifest-file get-string-all) "[workspace]"))))) -(define (crate-src? path) +(define* (crate-src? path #:key source) "Check if PATH refers to a crate source, namely a gzipped tarball with a Cargo.toml file present at its root." - (if (directory-exists? path) - ;; The build system only handles sources containing single crate. - ;; Workspaces should be packaged into crates (via 'package phase) - ;; and used in inputs. - (single-crate? path) - (and (not (string-suffix? "py" path)) ;sanity-check.py - ;; First we print out all file names within the tarball to see - ;; if it looks like the source of a crate. However, the tarball - ;; will include an extra path component which we would like to - ;; ignore (since we're interested in checking if a Cargo.toml - ;; exists at the root of the archive, but not nested anywhere - ;; else). We do this by cutting up each output line and only - ;; looking at the second component. We then check if it matches - ;; Cargo.toml exactly and short circuit if it does. - (invoke "sh" "-c" - (string-append "tar -tf " path - " | cut -d/ -f2" - " | grep -q '^Cargo.toml$'"))))) + (and (not (string=? path source)) ;Exclude self. + (if (directory-exists? path) + ;; The build system only handles sources containing single crate. + ;; Workspaces should be packaged into crates (via 'package phase) + ;; and used in inputs. + (single-crate? path) + (and (not (string-suffix? "py" path)) ;sanity-check.py + ;; First we print out all file names within the tarball to see + ;; if it looks like the source of a crate. However, the tarball + ;; will include an extra path component which we would like to + ;; ignore (since we're interested in checking if a Cargo.toml + ;; exists at the root of the archive, but not nested anywhere + ;; else). We do this by cutting up each output line and only + ;; looking at the second component. We then check if it matches + ;; Cargo.toml exactly and short circuit if it does. + (invoke "sh" "-c" + (string-append "tar -tf " path + " | cut -d/ -f2" + " | grep -q '^Cargo.toml$'")))))) (define* (unpack-rust-crates #:key inputs (vendor-dir "guix-vendor") #:allow-other-keys) @@ -155,7 +156,7 @@ (define* (check-for-pregenerated-files #:key parallel-build? #:allow-other-keys) (format #t "error: Possible pre-generated file found: ~a~%" file))) (find-files "." (negate empty-file?))))) -(define* (configure #:key inputs +(define* (configure #:key source inputs target system (cargo-target #f) (vendor-dir "guix-vendor") @@ -172,7 +173,7 @@ (define* (configure #:key inputs ((name . path) (let* ((basepath (strip-store-file-name path)) (crate-dir (string-append vendor-dir "/" basepath))) - (and (crate-src? path) + (and (crate-src? path #:source source) ;; Gracefully handle duplicate inputs (not (file-exists? crate-dir)) (if (directory-exists? path)