all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* modifying (rather than fully replacing) a build phases
@ 2023-06-27 16:38 John Kehayias
  0 siblings, 0 replies; 4+ messages in thread
From: John Kehayias @ 2023-06-27 16:38 UTC (permalink / raw)
  To: guix-devel

Hi Guixers,

A question that is either relatively simple or else getting into the weeds a bit, that I came across in my proposed patch <https://issues.guix.gnu.org/64213> The general question is: how can I modify a build phase without replacing it completely? More specifically (as seen in the proposed patch) there is a build phase consisting of just an "apply invoke" call where I want to remove one of the arguments given. Is there a simple way to do this rather than just manually copying and deleting that string?

I would assume so, but I wasn't sure how to do it and couldn't quite grep any examples. Some light exploring in the guix repl shows me that package-arguments is a keyword list (not sure the proper terminology in Guile) with #:phases a big gexp. Essentially I want to modify that to remove a string. I suppose it is a question of manipulating a gexp directly. (I'm sure macros can do all this but there doesn't seem to be a need for that at this level, right?)

Thanks in advance!
John



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

* Re: modifying (rather than fully replacing) a build phases
@ 2023-06-28  1:01 John Kehayias
  2023-06-29  0:30 ` Csepp
  0 siblings, 1 reply; 4+ messages in thread
From: John Kehayias @ 2023-06-28  1:01 UTC (permalink / raw)
  To: guix-devel

My question remains, but I've updated the patch in question to use
#:make-flags (thanks to mirai for the idea), separating out these
parameters from the build command and making this a much easier
change.

Still, we have examples of just copying some phase by hand to make
adjustments, is there anything better we can/should do?

On Tue, Jun 27, 2023 at 12:29 PM, John Kehayias wrote:

> Hi Guixers,
>
> A question that is either relatively simple or else getting into the
> weeds a bit, that I came across in my proposed patch
> <https://issues.guix.gnu.org/64213> The general question is: how can I
> modify a build phase without replacing it completely? More
> specifically (as seen in the proposed patch) there is a build phase
> consisting of just an "apply invoke" call where I want to remove one
> of the arguments given. Is there a simple way to do this rather than
> just manually copying and deleting that string?
>
> I would assume so, but I wasn't sure how to do it and couldn't quite
> grep any examples. Some light exploring in the guix repl shows me that
> package-arguments is a keyword list (not sure the proper terminology
> in Guile) with #:phases a big gexp. Essentially I want to modify that
> to remove a string. I suppose it is a question of manipulating a gexp
> directly. (I'm sure macros can do all this but there doesn't seem to
> be a need for that at this level, right?)
>
> Thanks in advance!
> John



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

* Re: modifying (rather than fully replacing) a build phases
  2023-06-28  1:01 modifying (rather than fully replacing) a build phases John Kehayias
@ 2023-06-29  0:30 ` Csepp
  2023-06-29 15:02   ` John Kehayias
  0 siblings, 1 reply; 4+ messages in thread
From: Csepp @ 2023-06-29  0:30 UTC (permalink / raw)
  To: John Kehayias; +Cc: guix-devel


John Kehayias <john.kehayias@protonmail.com> writes:

> My question remains, but I've updated the patch in question to use
> #:make-flags (thanks to mirai for the idea), separating out these
> parameters from the build command and making this a much easier
> change.
>
> Still, we have examples of just copying some phase by hand to make
> adjustments, is there anything better we can/should do?
>
> On Tue, Jun 27, 2023 at 12:29 PM, John Kehayias wrote:
>
>> Hi Guixers,
>>
>> A question that is either relatively simple or else getting into the
>> weeds a bit, that I came across in my proposed patch
>> <https://issues.guix.gnu.org/64213> The general question is: how can I
>> modify a build phase without replacing it completely? More
>> specifically (as seen in the proposed patch) there is a build phase
>> consisting of just an "apply invoke" call where I want to remove one
>> of the arguments given. Is there a simple way to do this rather than
>> just manually copying and deleting that string?
>>
>> I would assume so, but I wasn't sure how to do it and couldn't quite
>> grep any examples. Some light exploring in the guix repl shows me that
>> package-arguments is a keyword list (not sure the proper terminology
>> in Guile) with #:phases a big gexp. Essentially I want to modify that
>> to remove a string. I suppose it is a question of manipulating a gexp
>> directly. (I'm sure macros can do all this but there doesn't seem to
>> be a need for that at this level, right?)
>>
>> Thanks in advance!
>> John

I think I've used assoc-ref to find the build phase I wanted and then
called it from something else.  It's not super pretty, but it works.


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

* Re: modifying (rather than fully replacing) a build phases
  2023-06-29  0:30 ` Csepp
@ 2023-06-29 15:02   ` John Kehayias
  0 siblings, 0 replies; 4+ messages in thread
From: John Kehayias @ 2023-06-29 15:02 UTC (permalink / raw)
  To: Csepp; +Cc: guix-devel

Hi Csepp,

On Thu, Jun 29, 2023 at 02:30 AM, Csepp wrote:

>
> I think I've used assoc-ref to find the build phase I wanted and then
> called it from something else.  It's not super pretty, but it works.

Yes, you can get phases from other build-systems, for instance, which
is needed sometimes. Here I meant actually modifying such a phase,
rather than just using/replacing/removing it. Perhaps that is not so
straightforward currently. (And like you said, getting phases from
elsewhere can feel a little clunky, luckily not needed too often from
what I've seen.)

John



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

end of thread, other threads:[~2023-06-29 15:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-28  1:01 modifying (rather than fully replacing) a build phases John Kehayias
2023-06-29  0:30 ` Csepp
2023-06-29 15:02   ` John Kehayias
  -- strict thread matches above, loose matches on Subject: below --
2023-06-27 16:38 John Kehayias

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.