unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Skyler Ferris via Guix-patches via <guix-patches@gnu.org>
To: Vagrant Cascadian <vagrant@reproducible-builds.org>,
	70001@debbugs.gnu.org
Subject: [bug#70001] [PATCH] gnu: reprotest: Add missing propogated inputs
Date: Tue, 26 Mar 2024 20:06:41 +0000	[thread overview]
Message-ID: <79373a3d-4e2c-44b0-9593-97374eaba7fa@protonmail.com> (raw)
In-Reply-To: <9c3327ac-c6a3-4324-b832-7b51463ae13e@protonmail.com>

Hi again, sorry, it seems like some of my paragraphs and code blocks got 
squashed into one giant paragraph somehow. I'm going to try this again, 
hopefully it works this time. This is the text beneath the "Most of the 
proposed inputs..." quote:

I remember running into this before and it has been a pain point for me 
because it is not clear what the optional dependencies are. I know that 
package managers like apt have the ability to recommend packages which 
are optional dependencies, but the problem that I run into is that if 
I'm looking at a configuration (manifest, operating-system spec, etc) 
it's not clear to me which items are included as "invisible 
dependencies" of other packages and which ones are being included for 
their own sake. So I would like to propose using a different technique 
which I believe addresses both of our concerns.

Basically, the technique is to embed absolute paths into the python 
code. For example, I tried adding this phase to reprotest (it would need 
some polishing before actual submission, for reasons mentioned later in 
this email):

```scheme
(add-after 'adjust-locales 'set-taskset-path
   (lambda _
     (define (quote-surround str)
       (string-append "'" str "'"))

     (let ((util-linux #$(this-package-input "util-linux")))
       (when util-linux
         (substitute* "reprotest/build.py"
           (("'taskset'")
            (quote-surround (string-append util-linux "/bin/taskset")))
           (("setarch")
            (string-append util-linux "/bin/setarch")))))))
```

This let me run the num_cpus test from a pure shell without adding 
util-linux to my explicit inputs. Running taskset from the shell 
resulted in a "command not found" error so the package was not added to 
the profile. Additionally, I built a `guix pack` with only reprotest as 
an input, and util-linux was present. I built a pack with the current 
version of the package and util-linux was not present. So it seems that 
even though Guix sees the hash and is aware of it as a run-time 
dependency, it does not automatically add the package to the profile, 
addressing both of our concerns.

If a user does not want an optional dependency then they can delete the 
input like so (or replace it for a different version, if so desired):

```scheme
(use-modules (guix packages) (gnu packages diffoscope))

(package
     (inherit reprotest)
     (inputs (modify-inputs (package-inputs reprotest)
                            (delete "util-linux"))))
```

Unfortunately I do not see a way to remove an input using the with-input 
option in options->transformation procedure or the analogous 
--with-input command-line flag. If we do go this route then I will look 
at adding "#f" as a valid value for the with-input transformation to 
support this case, but that will be handled in a separate issue.

We could default to not including optional dependencies, but I don't 
think that this would be the most useful thing to do. I would expect 
that most people want all tests to work and that removing the inputs is 
a niche interest. It seems likely that "all of the tests work out of the 
box" is closer to what most people are currently experiencing because 
all of the packages which I added to the propagated inputs, with the 
exception of libfaketime and diffoscope, is in the %base-packages 
variable that Guix recommends people use (and the "normal" diff command 
is provided by %base-packages as well, so the lack of diffoscope would 
not cause a problem for users with the default configuration). If we do 
decide to exclude optional dependencies by default then I will look at 
adding an "add-input" option to the available transformations.





      reply	other threads:[~2024-03-26 20:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-25 19:12 [bug#70001] [PATCH] gnu: reprotest: Add missing propogated inputs Skyler Ferris via Guix-patches via
2024-03-25 19:16 ` Skyler Ferris via Guix-patches via
2024-03-26  6:02 ` Vagrant Cascadian
2024-03-26 19:57   ` Skyler Ferris via Guix-patches via
2024-03-26 20:06     ` Skyler Ferris via Guix-patches via [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=79373a3d-4e2c-44b0-9593-97374eaba7fa@protonmail.com \
    --to=guix-patches@gnu.org \
    --cc=70001@debbugs.gnu.org \
    --cc=skyvine@protonmail.com \
    --cc=vagrant@reproducible-builds.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).