help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Transformations to add or remove inputs?


From: Tomas Volf
Subject: Re: Transformations to add or remove inputs?
Date: Tue, 9 Apr 2024 21:21:00 +0200

On 2024-04-09 11:12:22 -0700, Vagrant Cascadian wrote:
> In trying to verify weather adding or removing an input affects a
> package, I was wondering if there are any transformations to do so,
> rather than having to edit the package definition, build the guix
> checkout, etc. or play games with guix time-machine.
>
> It seems like --with-input almost gets you there, at least for removing
> dependencies, you can do something like:
>
>   guix build --with-input=r-minimal=perl diffoscope
>
> But obviously, this no longer has r-minimal.
>
>
> I'd want something almost like:
>
>   guix build --add-input=perl diffoscope
>
> Or:
>
>  guix build --remove-input=r-minimal diffoscope
>
> Is there a trivial way to do this sort of thing already?

I do not think there is a command line argument, but -e can be (mis)used for
this it seems:

    guix build -e '(begin
                     (use-modules (guix packages) (gnu packages diffoscope))
                     (package/inherit diffoscope
                      (native-inputs (modify-inputs (package-inputs diffoscope)
                                       (delete "r-minimal")))))'

You could write a couple of helper functions utilizing the above for
adding/removing (native-)inputs and use guix repl to use them in non-horrible
way?

I agree that having --add-input --remove-input --add-native-input
--remove-native-input would be easier to use from command-line, but quick search
suggest it does not exist (as you already noticed).

>
>
> This seems similar in spirit to --with-patch, which adds a patch to the
> package definition...
>
>
> live well,
>   vagrant

Have a nice day,
Tomas

--
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]