X-Loop: help-debbugs@HIDDEN Subject: [bug#73212] [PATCH] gnu: bcachefs-tools: Update to 1.11.0. Resent-From: Tobias Geerinckx-Rice <me@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Thu, 12 Sep 2024 21:35:02 +0000 Resent-Message-ID: <handler.73212.B.172617687413072 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: report 73212 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 73212 <at> debbugs.gnu.org X-Debbugs-Original-To: guix-patches@HIDDEN Received: via spool by submit <at> debbugs.gnu.org id=B.172617687413072 (code B ref -1); Thu, 12 Sep 2024 21:35:02 +0000 Received: (at submit) by debbugs.gnu.org; 12 Sep 2024 21:34:34 +0000 Received: from localhost ([127.0.0.1]:42055 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1sorST-0003Ol-GG for submit <at> debbugs.gnu.org; Thu, 12 Sep 2024 17:34:34 -0400 Received: from lists.gnu.org ([209.51.188.17]:43406) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <me@HIDDEN>) id 1sorSM-0003OX-BM for submit <at> debbugs.gnu.org; Thu, 12 Sep 2024 17:34:31 -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 <me@HIDDEN>) id 1sorSC-0002oy-CQ for guix-patches@HIDDEN; Thu, 12 Sep 2024 17:34:16 -0400 Received: from tobias.gr ([2a02:c205:2020:6054::1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <me@HIDDEN>) id 1sorS9-00031S-Qy for guix-patches@HIDDEN; Thu, 12 Sep 2024 17:34:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=2018; bh=F00RZg2mXSHxY w4crVjkqNB/qbXAkiS6q/YTZb4O3FQ=; h=date:subject:to:from; d=tobias.gr; b=WYfd9P4oBnbllVWlzaeGMYYOMsWIBX9sSCFR7wt4MLsNgpP8LoGSz7DXNFNKpculf13E 4xPcwOArqGGIe3gybiPjzn4u/UGnxNIHdO1uVc0x2RwaXH21yORzpA8WkiPDnzBIyzvXpj g1VUI8+BJxQyw3kTAjHJ7BBu0aRXVP3Xu8aslNqF59NNFxbOswEaC1rtTdE/5NB0lSwgWg 5JUHnVUoPqnNZ9Yn2nwpVDTrhJButiGpH4h9MrfEwcPRdgUXij6Bb/0yEvyZq93hzqtHxj tdYVVO0iX3MVlRh10v87kcbFz1pwkFaBwSOD3917+Mo3bIBcJcnQbW9Nfc48X/sA== Received: by submission.tobias.gr (OpenSMTPD) with ESMTPSA id 39a3d764 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for <guix-patches@HIDDEN>; Thu, 12 Sep 2024 21:34:05 +0000 (UTC) From: Tobias Geerinckx-Rice <me@HIDDEN> Date: Thu, 12 Sep 2024 23:33:57 +0200 Message-ID: <b828946ffd39464e6daabb06313ab47a64f7a055.1726176837.git.me@HIDDEN> X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a02:c205:2020:6054::1; envelope-from=me@HIDDEN; helo=tobias.gr X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.7 (-) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -2.7 (--) * gnu/packages/crates-io.scm (rust-rustix-for-bcachefs-tools): New public variable. * gnu/packages/file-systems.scm (bcachefs-tools-rust-target) (bcachefs-tools-target/release, bcachefs-tools-cargo-args) (bcachefs-tools-make-flags, bcachefs-tools-make-install-flags): New variables. (bcachefs-tools): Update to 1.11.0. [build-system]: Switch to Cargo. [arguments]: Remove #:make-flags. Add Cargo keywords. Run the test suite with upstream defaults. Delete 'promote-mount.bcachefs.sh phase. [native-inputs]: Remove python, python-docutils, python-pytest, and valgrind. [inputs]: Remove bash-minimal, coreutils-minimal, gawk, and util-linux. Add clang. (bcachefs-tools/static): Modify #:phases instead of #:make-flags, and adjust accordingly. Change-Id: I872f5dea88b75f855f3cdcbffbbd9c70d7ebe8d6 --- gnu/packages/crates-io.scm | 16 ++- gnu/packages/file-systems.scm | 190 +++++++++++++++++++++------------- 2 files changed, 134 insertions(+), 72 deletions(-) diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm index 0cdb071ea0..c08ccd29fd 100644 --- a/gnu/packages/crates-io.scm +++ b/gnu/packages/crates-io.scm @@ -66141,7 +66141,7 @@ (define-public rust-rusticata-macros-4 (define-public rust-rustix-0.38 (package (name "rust-rustix") - (version "0.38.31") + (version "0.38.31") ;XXX drop rust-rustix-for-bcachefs-tools when updating (source (origin (method url-fetch) @@ -66195,6 +66195,20 @@ (define-public rust-rustix-0.38 ;; Apache 2.0, Apache 2.0 with LLVM exception, or Expat. (license (list license:asl2.0 license:expat)))) +(define-public rust-rustix-for-bcachefs-tools + ;; The package above is too old; too many dependents to update it directly. + (package + (inherit rust-rustix-0.38) + (name (package-name rust-rustix-0.38)) + (version "0.38.34") + (source + (origin + (inherit (package-source rust-rustix-0.38)) + (uri (crate-uri "rustix" version)) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 "03vkqa2ism7q56rkifyy8mns0wwqrk70f4i4fd53r97p8b05xp3h")))))) + (define-public rust-rustix-0.37 (package (inherit rust-rustix-0.38) diff --git a/gnu/packages/file-systems.scm b/gnu/packages/file-systems.scm index c6a49a6bc0..a5020e1f87 100644 --- a/gnu/packages/file-systems.scm +++ b/gnu/packages/file-systems.scm @@ -34,8 +34,10 @@ (define-module (gnu packages file-systems) #:use-module (guix gexp) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) + #:use-module (guix platform) #:use-module (guix download) #:use-module (guix git-download) + #:use-module (guix build-system cargo) #:use-module (guix build-system cmake) #:use-module (guix build-system copy) #:use-module (guix build-system gnu) @@ -58,6 +60,7 @@ (define-module (gnu packages file-systems) #:use-module (gnu packages check) #:use-module (gnu packages compression) #:use-module (gnu packages cpp) + #:use-module (gnu packages crates-io) #:use-module (gnu packages crypto) #:use-module (gnu packages curl) #:use-module (gnu packages cyrus-sasl) @@ -85,6 +88,7 @@ (define-module (gnu packages file-systems) #:use-module (gnu packages libffi) #:use-module (gnu packages libunwind) #:use-module (gnu packages linux) + #:use-module (gnu packages llvm) #:use-module (gnu packages maths) #:use-module (gnu packages man) #:use-module (gnu packages m4) @@ -589,10 +593,39 @@ (define-public gphotofs (home-page "http://www.gphoto.org/proj/gphotofs/") (license license:gpl2+))) +(define bcachefs-tools-rust-target + (platform-rust-target (lookup-platform-by-target-or-system + (or (%current-target-system) + (%current-system))))) + +(define bcachefs-tools-target/release + (string-append "target/" bcachefs-tools-rust-target "/release")) + +(define bcachefs-tools-cargo-args + ;; Distinct from -MAKE-FLAGS for use with ‘cargo test’ in 'check. + #~(list "--release" + (string-append "--target=" #$bcachefs-tools-rust-target))) + +;; XXX We want to share common make flags across different packages & phases, +;; but the cargo-build-system doesn't allow #:make-flags. +(define bcachefs-tools-make-flags + ;; These result of these flags should be as minimal as possible. + ;; Enable any optional features in the bcachefs-tools package instead. + #~(list (string-append "CARGO_BUILD_ARGS=" + (string-join #$bcachefs-tools-cargo-args " ")) + (string-append "CC=" #$(cc-for-target)) + (string-append "PKG_CONFIG=" #$(pkg-config-for-target)))) + +(define bcachefs-tools-make-install-flags + #~(cons* (string-append "PREFIX=" #$output) + "INITRAMFS_DIR=$(PREFIX)/share/initramfs-tools" + "PKGCONFIG_UDEVRULESDIR=$(PREFIX)/lib/udev/rules.d" + #$bcachefs-tools-make-flags)) + (define-public bcachefs-tools (package (name "bcachefs-tools") - (version "1.4.1") + (version "1.11.0") (source (origin (method git-fetch) @@ -601,84 +634,74 @@ (define-public bcachefs-tools (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 - (base32 "0axwbckqrw1v3v50nzhpkvpyjbjwy3rq5bv23db84x3xia497apq")))) - (build-system gnu-build-system) + (base32 "0m6z8z1cv78ay9yspypgr0kv70ck4wpln5n44f6n57i7sihqhrrg")))) + (build-system cargo-build-system) (arguments - (list #:make-flags - #~(list (string-append "VERSION=" #$version) ; ‘v…-nogit’ otherwise - (string-append "PREFIX=" #$output) - "INITRAMFS_DIR=$(PREFIX)/share/initramfs-tools" - "PKGCONFIG_UDEVRULESDIR=$(PREFIX)/lib/udev/rules.d" - (string-append "CC=" #$(cc-for-target)) - (string-append "PKG_CONFIG=" #$(pkg-config-for-target)) - ;; ‘This will be less of an option in the future, as more - ;; code gets rewritten in Rust.’ - "NO_RUST=better") - #:phases - #~(modify-phases %standard-phases - (delete 'configure) ; no configure script - (replace 'check - ;; The test suite is moribund upstream (‘never been useful’), - ;; but let's keep running it as a sanity check until then. - (lambda* (#:key tests? make-flags #:allow-other-keys) - (when tests? - ;; We must manually build the test_helper first. - (apply invoke "make" "tests" make-flags) - (invoke (string-append - #$(this-package-native-input "python-pytest") - "/bin/pytest") "-k" - ;; These fail (‘invalid argument’) on kernels - ;; with a previous bcachefs version. - (string-append "not test_format and " - "not test_fsck and " - "not test_list and " - "not test_list_inodes and " - "not test_list_dirent"))))) - (add-after 'install 'promote-mount.bcachefs.sh - ;; The (optional) ‘mount.bcachefs’ requires rust:cargo. - ;; This shell alternative does the job well enough for now. - (lambda* (#:key inputs #:allow-other-keys) - (define (whence file) - (dirname (search-input-file inputs file))) - (let ((mount (string-append #$output - "/sbin/mount.bcachefs"))) - (delete-file mount) ; symlink to ‘bcachefs’ - (copy-file "mount.bcachefs.sh" mount) - ;; WRAP-SCRIPT causes bogus ‘Insufficient arguments’ errors. - (wrap-program mount - `("PATH" ":" prefix - ,(list (getcwd) - (whence "bin/tail") - (whence "bin/awk") - (whence "bin/mount")))))))))) + (list + #:install-source? #f + ;; The Makefile CCs *every* C file anywhere beneath the build directory, + ;; even in Rust crates, creating ludicrous and totally bogus dependencies + ;; such as the Android SDK. Put our crates elsewhere. + #:vendor-dir "../guix-vendor" + #:cargo-inputs + `(("rust-aho-corasick" ,rust-aho-corasick-1) + ("rust-anstream" ,rust-anstream-0.6) + ("rust-anstyle" ,rust-anstyle-1) + ("rust-anstyle-parse" ,rust-anstyle-parse-0.2) + ("rust-anyhow" ,rust-anyhow-1) + ("rust-autocfg" ,rust-autocfg-1) + ("rust-bitfield" ,rust-bitfield-0.14) + ("rust-clap" ,rust-clap-4) + ("rust-clap-complete" ,rust-clap-complete-4) + ("rust-either" ,rust-either-1) + ("rust-errno" ,rust-errno-0.2) + ("rust-env-logger" ,rust-env-logger-0.10) + ("rust-libc" ,rust-libc-0.2) + ("rust-log" ,rust-log-0.4) + ("rust-memoffset" ,rust-memoffset-0.8) + ("rust-owo-colors" ,rust-owo-colors-4) + ("rust-rustix" ,rust-rustix-for-bcachefs-tools) + ("rust-strum" ,rust-strum-0.26) + ("rust-strum-macros" ,rust-strum-macros-0.26) + ("rust-udev" ,rust-udev-0.7) + ("rust-uuid" ,rust-uuid-1) + ("rust-zeroize" ,rust-zeroize-1)) + #:phases + #~(modify-phases %standard-phases + (replace 'build + (lambda* (#:key parallel-build? #:allow-other-keys) + (apply invoke "make" + "-j" (if parallel-build? + (number->string (parallel-job-count)) + "1") + (string-append "VERSION=" #$version) + #$bcachefs-tools-make-flags))) + (add-before 'install 'patch-install + ;; ‘make install’ hard-codes target/release/bcachefs, which is + ;; incorrect when passing --target, as required to cross-compile or + ;; even just link statically. We always pass it, so always patch. + (lambda _ + (substitute* "Makefile" + (("target/release") + #$bcachefs-tools-target/release)))) + (replace 'install + (lambda _ + (apply invoke "make" "install" + #$bcachefs-tools-make-install-flags)))))) (native-inputs - (cons* pkg-config - ;; For generating documentation with rst2man. - python - python-docutils - ;; For tests. - python-pytest - (if (member (%current-system) (package-supported-systems valgrind)) - (list valgrind) - '()))) + (list pkg-config)) (inputs - (list bash-minimal + (list clang eudev keyutils libaio libscrypt libsodium liburcu - `(,util-linux "lib") + `(,util-linux "lib") ;libblkid lz4 zlib - `(,zstd "lib") - - ;; Only for mount.bcachefs.sh. - bash-minimal - coreutils-minimal - gawk - util-linux)) + `(,zstd "lib"))) (home-page "https://bcachefs.org/") (synopsis "Tools to create and manage bcachefs file systems") (description @@ -701,9 +724,34 @@ (define-public bcachefs-tools/static (name "bcachefs-tools-static") (arguments (substitute-keyword-arguments (package-arguments bcachefs-tools) - ((#:make-flags make-flags) - #~(append #$make-flags - (list "LDFLAGS=-static"))))) + ((#:phases phases #~%standard-phases) + #~(modify-phases #$phases + (add-after 'configure 'set-rust-flags + (lambda _ + (setenv "RUSTFLAGS" (string-join + '("-C" "link-arg=-z" + "-C" "link-arg=muldefs" + "-C" "target-feature=+crt-static" + "-C" "relocation-model=static") + " ")))) + (replace 'build + (lambda* (#:key parallel-build? #:allow-other-keys) + (apply invoke "make" + "-j" (if parallel-build? + (number->string (parallel-job-count)) + "1") + (string-append "VERSION=" + #$(package-version this-package)) + #$bcachefs-tools-make-flags))) + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (apply invoke "cargo" "test" #$bcachefs-tools-cargo-args)))) + (replace 'install + (lambda _ + (apply invoke "make" "install" + (string-append "PREFIX=" #$output) + #$bcachefs-tools-make-install-flags))))))) (inputs (modify-inputs (package-inputs bcachefs-tools) (prepend `(,eudev "static") `(,keyutils "static") base-commit: 191e0f9e5214783f8261ef9b6325abfff834ecbc prerequisite-patch-id: 5e305d35139259ba5f9f91c562c22b926bf9e801 prerequisite-patch-id: 2aa756ea2c34fed8b4cb5dcde72fa558a396d3bd prerequisite-patch-id: 5a5eb3c0f4ce59d4ce340a14bb697b3f1d189e71 prerequisite-patch-id: 241cb117acd301ac875feea5574544adb9e2abf4 prerequisite-patch-id: 5b7fb5afed6a45b653178002c3bc17c6d3015566 prerequisite-patch-id: 4fc8aac18afc1b417e3c9825015f6013a7d31209 -- 2.46.0
Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) Content-Type: text/plain; charset=utf-8 X-Loop: help-debbugs@HIDDEN From: help-debbugs@HIDDEN (GNU bug Tracking System) To: Tobias Geerinckx-Rice <me@HIDDEN> Subject: bug#73212: Acknowledgement ([PATCH] gnu: bcachefs-tools: Update to 1.11.0.) Message-ID: <handler.73212.B.172617687413072.ack <at> debbugs.gnu.org> References: <b828946ffd39464e6daabb06313ab47a64f7a055.1726176837.git.me@HIDDEN> X-Gnu-PR-Message: ack 73212 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 73212 <at> debbugs.gnu.org Date: Thu, 12 Sep 2024 21:35:02 +0000 Thank you for filing a new bug report with debbugs.gnu.org. This is an automatically generated reply to let you know your message has been received. Your message is being forwarded to the package maintainers and other interested parties for their attention; they will reply in due course. Your message has been sent to the package maintainer(s): guix-patches@HIDDEN If you wish to submit further information on this problem, please send it to 73212 <at> debbugs.gnu.org. Please do not send mail to help-debbugs@HIDDEN unless you wish to report a problem with the Bug-tracking system. --=20 73212: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D73212 GNU Bug Tracking System Contact help-debbugs@HIDDEN with problems
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.