all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#67947] [PATCH 0/3 rust-team] guix: cargo-build-system: Add test keys.
@ 2023-12-21  5:11 Jaeme Sifat via Guix-patches via
  2023-12-21  5:28 ` [bug#67947] [PATCH 1/3] guix: build-system: cargo: Add cargo-skip-tests Jaeme Sifat via Guix-patches via
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Jaeme Sifat via Guix-patches via @ 2023-12-21  5:11 UTC (permalink / raw)
  To: 67947; +Cc: Jaeme Sifat, Efraim Flashner

I propose adding two new keys for the 'check phase of the
cargo-build-system. One is #:cargo-skip-tests which accepts a list of
strings representing the names of the tests to be skipped and the
other is #:cargo-test-targets which accepts a list of strings
representing the test targets to be ran.

The goal of adding these two keys is to make it so that the packager
doesn't have to interface directly with #:cargo-test-flags which is
set to --release mode by default. I believe that this leads to cleaner
looking build definitions that should be easier to bind to something
say, a web-based package definition editor that exists right now.

These patches are just a draft of this feature I cooked up. Here's
what they should look like in action with the rust-alsa crate:

--8<---------------cut here---------------start------------->8---
(define-public rust-alsa-0.8
  (package
    ...
    (build-system cargo-build-system)
    (arguments
     `(#:cargo-test-targets
       (list "lib"
             "bins"
             "tests")
       #:cargo-skip-tests
       (list "pcm::drop"
             "pcm::info_from_default"
             "pcm::playback_to_default"
             "pcm::record_from_default"
             "seq::print_seqs"
             "seq::seq_loopback"
             "seq::seq_portsubscribeiter"
             "seq::seq_subscribe")
       #:cargo-inputs
       (("rust-alsa-sys" ,rust-alsa-sys-0.3)
        ("rust-bitflags" ,rust-bitflags-2)
        ("rust-libc" ,rust-libc-0.2)
        ("rust-nix" ,rust-nix-0.26))))
     ...))
--8<---------------cut here---------------end--------------->8---

I would like to hear the feedback on this change and its
implementation. Of course, if this change is accepted, then there
ought to be an update to the Rust crates section of 'Contributing' in
the Guix manual that details this.

Jaeme Sifat (3):
  guix: build-system: cargo: Add cargo-skip-tests.
  guix: build-system: cargo: Add cargo-test-targets.
  guix: Add copyright notice.

 guix/build-system/cargo.scm       |  9 +++++++++
 guix/build/cargo-build-system.scm | 20 +++++++++++++++++++-
 2 files changed, 28 insertions(+), 1 deletion(-)


base-commit: 49a7a95ba44e231e9e15a274f9a96de6fa012daf
--
2.41.0




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-10-31 15:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-21  5:11 [bug#67947] [PATCH 0/3 rust-team] guix: cargo-build-system: Add test keys Jaeme Sifat via Guix-patches via
2023-12-21  5:28 ` [bug#67947] [PATCH 1/3] guix: build-system: cargo: Add cargo-skip-tests Jaeme Sifat via Guix-patches via
2023-12-21  5:28 ` [bug#67947] [PATCH 2/3] guix: build-system: cargo: Add cargo-test-targets Jaeme Sifat via Guix-patches via
2023-12-21  5:28 ` [bug#67947] [PATCH 3/3] guix: Add copyright notice Jaeme Sifat via Guix-patches via
2024-10-31 15:19 ` [bug#67947] cargo-build-system: Add test keys Steve George

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.