unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Transformations to add or remove inputs?
@ 2024-04-09 18:12 Vagrant Cascadian
  2024-04-09 19:21 ` Tomas Volf
  0 siblings, 1 reply; 2+ messages in thread
From: Vagrant Cascadian @ 2024-04-09 18:12 UTC (permalink / raw)
  To: help-guix

[-- Attachment #1: Type: text/plain, Size: 773 bytes --]

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?


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


live well,
  vagrant

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]

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

* Re: Transformations to add or remove inputs?
  2024-04-09 18:12 Transformations to add or remove inputs? Vagrant Cascadian
@ 2024-04-09 19:21 ` Tomas Volf
  0 siblings, 0 replies; 2+ messages in thread
From: Tomas Volf @ 2024-04-09 19:21 UTC (permalink / raw)
  To: Vagrant Cascadian; +Cc: help-guix

[-- Attachment #1: Type: text/plain, Size: 1715 bytes --]

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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2024-04-09 19:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-09 18:12 Transformations to add or remove inputs? Vagrant Cascadian
2024-04-09 19:21 ` Tomas Volf

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).