[PATCH] doc: Document usage of #:out-of-source? for meson-build-system.

  • Open
  • quality assurance status badge
Details
2 participants
  • Dariqq
  • Maxim Cournoyer
Owner
unassigned
Submitted by
Dariqq
Severity
normal
D
D
Dariqq wrote on 4 Sep 18:26 +0200
(address . guix-patches@gnu.org)(name . Dariqq)(address . dariqq@posteo.net)
f4bd571d1d0753acc003b4f1b371860e45270cce.1725467160.git.dariqq@posteo.net
Followup to 220546810830422f8ec3e6a4145fec85429914a1.

* doc/guix.texi (meson-build-system): Document #:out-of-source? parameter.

Change-Id: I730e1aef15010006a68710f8e46ce75dc50e6c67
---
doc/guix.texi | 4 ++++
1 file changed, 4 insertions(+)

Toggle diff (19 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index 16c697586a..2302e0f15c 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -10146,6 +10146,10 @@ Build Systems
of inputs, and they can be changed with the parameters @code{#:meson}
and @code{#:ninja} if needed.
+As Meson only supports out-of-source builds the @code{#:out-of-source?}
+parameter specifies whether to search for license files in the source
+or build directory.
+
This build system is an extension of @code{gnu-build-system}, but with the
following phases changed to some specific for Meson:

base-commit: 9a03ab25ba889be27b34d5cebea05d5ac3b0a033
--
2.45.2
M
M
Maxim Cournoyer wrote on 11 Sep 08:09 +0200
(name . Dariqq)(address . dariqq@posteo.net)
878qvy3ent.fsf@gmail.com
Hi Dariqq,

Dariqq <dariqq@posteo.net> writes:

Toggle quote (22 lines)
> Followup to 220546810830422f8ec3e6a4145fec85429914a1.
>
> * doc/guix.texi (meson-build-system): Document #:out-of-source? parameter.
>
> Change-Id: I730e1aef15010006a68710f8e46ce75dc50e6c67
> ---
> doc/guix.texi | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/doc/guix.texi b/doc/guix.texi
> index 16c697586a..2302e0f15c 100644
> --- a/doc/guix.texi
> +++ b/doc/guix.texi
> @@ -10146,6 +10146,10 @@ Build Systems
> of inputs, and they can be changed with the parameters @code{#:meson}
> and @code{#:ninja} if needed.
>
> +As Meson only supports out-of-source builds the @code{#:out-of-source?}
> +parameter specifies whether to search for license files in the source
> +or build directory.
> +

That strikes me as odd; is it useful in practice? Otherwise I'd rather
we keep it undocumented, so that it can be removed without notice in a
future cleanup (in a 'private API' way).

--
Thanks,
Maxim
D
D
Dariqq wrote on 11 Sep 17:18 +0200
(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)
97aa51a8-a945-44f4-8a61-e9bbc3eddba4@posteo.net
Hi Maxim,


On 11.09.24 08:09, Maxim Cournoyer wrote:
Toggle quote (10 lines)
> Hi Dariqq,
>
> Dariqq <dariqq@posteo.net> writes:
>
>
> That strikes me as odd; is it useful in practice? Otherwise I'd rather
> we keep it undocumented, so that it can be removed without notice in a
> future cleanup (in a 'private API' way).
>

Ludovic asked me to document the new parameter, so I added something for
the current behaviour.

Because I don't think the message arrived at the original issue, i
copied below. I hope this is ok:

Toggle quote (19 lines)
> On 04.09.24 16:02, Ludovic Courtès wrote:
> AFAICS these changes are not sufficient because ‘configure’ in
> meson-build-system.scm does not honor #:out-of-source? (unlike
> ‘configure’ in gnu-build-system.scm).
>
> So if I’m not mistaken, you’ll need to change ‘configure’ as well.
>
> You can also update doc/guix.texi under “Build Systems” to mention this
> parameter.
>
> Last: ‘guix refresh -l meson’ shows that this is almost a world-rebuild
> change (23K dependents), so we’ll need to have this change in a separate
> branch.
>
> Could you send an updated patch?
>
> Thanks,
> Ludo’.

I have sent this patch for the documentation part but am still unsure
what is meant by *sufficient* because meson cannot do in source builds.

Maybe it should not be an option at all and instead be #t
unconditionally in 'install-license-files phase in meson-build-system?
M
M
Maxim Cournoyer wrote on 12 Sep 02:56 +0200
(name . Dariqq)(address . dariqq@posteo.net)
87jzfhy9jf.fsf@gmail.com
Hi Dariqq,

Dariqq <dariqq@posteo.net> writes:

Toggle quote (38 lines)
> Hi Maxim,
>
>
> On 11.09.24 08:09, Maxim Cournoyer wrote:
>> Hi Dariqq,
>> Dariqq <dariqq@posteo.net> writes:
>> That strikes me as odd; is it useful in practice? Otherwise I'd
>> rather
>> we keep it undocumented, so that it can be removed without notice in a
>> future cleanup (in a 'private API' way).
>>
>
> Ludovic asked me to document the new parameter, so I added something
> for the current behaviour.
>
> Because I don't think the message arrived at the original issue, i
> copied below. I hope this is ok:
>
>> On 04.09.24 16:02, Ludovic Courtès wrote:
>> AFAICS these changes are not sufficient because ‘configure’ in
>> meson-build-system.scm does not honor #:out-of-source? (unlike
>> ‘configure’ in gnu-build-system.scm).
>> So if I’m not mistaken, you’ll need to change ‘configure’ as well.
>> You can also update doc/guix.texi under “Build Systems” to mention
>> this
>> parameter.
>> Last: ‘guix refresh -l meson’ shows that this is almost a
>> world-rebuild
>> change (23K dependents), so we’ll need to have this change in a separate
>> branch.
>> Could you send an updated patch?
>> Thanks,
>> Ludo’.
>
> I have sent this patch for the documentation part but am still unsure
> what is meant by *sufficient* because meson cannot do in source
> builds.

I'm still out of context; is there an original bug number to refer to to
better understand what was the root problem being addressed?

Toggle quote (3 lines)
> Maybe it should not be an option at all and instead be #t
> unconditionally in 'install-license-files phase in meson-build-system?

Given most build phases of the gnu-build-system, which support
#:out-of-source? are reused in the meson-build-system, this argument
needs to be set to #t (which it currently is). But perhaps there's a
way to hide it from the users, perhaps via the 'private-keywords'
variable defined in the 'lower' procedure of the (guix build-system
meson) module (I haven't tested).

--
Thanks,
Maxim
D
D
Dariqq wrote on 12 Sep 09:12 +0200
(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)
c900bef7-915f-4e51-8de6-3f1665075240@posteo.net
Hi,

On 12.09.24 02:56, Maxim Cournoyer wrote:
Toggle quote (46 lines)
> Hi Dariqq,
>
> Dariqq <dariqq@posteo.net> writes:
>
>> Hi Maxim,
>>
>>
>> On 11.09.24 08:09, Maxim Cournoyer wrote:
>>> Hi Dariqq,
>>> Dariqq <dariqq@posteo.net> writes:
>>> That strikes me as odd; is it useful in practice? Otherwise I'd
>>> rather
>>> we keep it undocumented, so that it can be removed without notice in a
>>> future cleanup (in a 'private API' way).
>>>
>>
>> Ludovic asked me to document the new parameter, so I added something
>> for the current behaviour.
>>
>> Because I don't think the message arrived at the original issue, i
>> copied below. I hope this is ok:
>>
>>> On 04.09.24 16:02, Ludovic Courtès wrote:
>>> AFAICS these changes are not sufficient because ‘configure’ in
>>> meson-build-system.scm does not honor #:out-of-source? (unlike
>>> ‘configure’ in gnu-build-system.scm).
>>> So if I’m not mistaken, you’ll need to change ‘configure’ as well.
>>> You can also update doc/guix.texi under “Build Systems” to mention
>>> this
>>> parameter.
>>> Last: ‘guix refresh -l meson’ shows that this is almost a
>>> world-rebuild
>>> change (23K dependents), so we’ll need to have this change in a separate
>>> branch.
>>> Could you send an updated patch?
>>> Thanks,
>>> Ludo’.
>>
>> I have sent this patch for the documentation part but am still unsure
>> what is meant by *sufficient* because meson cannot do in source
>> builds.
>
> I'm still out of context; is there an original bug number to refer to to
> better understand what was the root problem being addressed?
>

Sorry I should have added that. The problem I was trying to solve is

TLDR is that meson-build-system was failing to find and install license
files for many packages because it would search for licenses in the
build directory rather than the source directory. (which might be
against the terms of the license)

Toggle quote (11 lines)
>> Maybe it should not be an option at all and instead be #t
>> unconditionally in 'install-license-files phase in meson-build-system?
>
> Given most build phases of the gnu-build-system, which support
> #:out-of-source? are reused in the meson-build-system, this argument
> needs to be set to #t (which it currently is). But perhaps there's a
> way to hide it from the users, perhaps via the 'private-keywords'
> variable defined in the 'lower' procedure of the (guix build-system
> meson) module (I haven't tested).
>

Something like that might be a better solution. I am not sure how these
'private-keywords' work: It looks like #:meson is one but you can
definitly override the default meson being used. Also the
private-arguments seem to get stripped from the arguments in the bag
(not sure what that is exactly) so they might not be passed to the build
phases


Would such a change require rebuilding (basically) everything given that
currently all packages are already built with #:out-of-source? set to
the default value #t?
M
M
Maxim Cournoyer wrote on 12 Sep 14:02 +0200
(name . Dariqq)(address . dariqq@posteo.net)
877cbhw050.fsf@gmail.com
Hi Dariqq,

Dariqq <dariqq@posteo.net> writes:

[...]

Toggle quote (17 lines)
>>> Maybe it should not be an option at all and instead be #t
>>> unconditionally in 'install-license-files phase in meson-build-system?
>> Given most build phases of the gnu-build-system, which support
>> #:out-of-source? are reused in the meson-build-system, this argument
>> needs to be set to #t (which it currently is). But perhaps there's a
>> way to hide it from the users, perhaps via the 'private-keywords'
>> variable defined in the 'lower' procedure of the (guix build-system
>> meson) module (I haven't tested).
>>
>
> Something like that might be a better solution. I am not sure how
> these 'private-keywords' work: It looks like #:meson is one but you
> can definitly override the default meson being used. Also the
> private-arguments seem to get stripped from the arguments in the bag
> (not sure what that is exactly) so they might not be passed to the
> build phases

I think your understanding is correct. The private options are accepted
on the build system, but not propagated to the lower build strata
(applied to phases). So what we'd like here is to *not* expose an
#:out-of-source argument at the build system level, and enforce
#:out-of-source #t for the lower build code. I guess the static #t
argument could be added to the bag arguments.

Toggle quote (5 lines)
>
> Would such a change require rebuilding (basically) everything given
> that currently all packages are already built with #:out-of-source?
> set to the default value #t?

Yes. To test this kind of change without having to wait for the world
to rebuild first, I sometimes make a copy of the build system files and
suffix them with -v2 or something. It's a bit of a pain, but faster than
waiting for 20k packages to be built.

--
Thanks,
Maxim
D
D
Dariqq wrote on 12 Sep 21:19 +0200
(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)
8a62a876-58e8-401f-9716-9b661bd008f5@posteo.net
On 12.09.24 14:02, Maxim Cournoyer wrote:
Toggle quote (31 lines)
> Hi Dariqq,
>
> Dariqq <dariqq@posteo.net> writes:
>
> [...]
>
>>>> Maybe it should not be an option at all and instead be #t
>>>> unconditionally in 'install-license-files phase in meson-build-system?
>>> Given most build phases of the gnu-build-system, which support
>>> #:out-of-source? are reused in the meson-build-system, this argument
>>> needs to be set to #t (which it currently is). But perhaps there's a
>>> way to hide it from the users, perhaps via the 'private-keywords'
>>> variable defined in the 'lower' procedure of the (guix build-system
>>> meson) module (I haven't tested).
>>>
>>
>> Something like that might be a better solution. I am not sure how
>> these 'private-keywords' work: It looks like #:meson is one but you
>> can definitly override the default meson being used. Also the
>> private-arguments seem to get stripped from the arguments in the bag
>> (not sure what that is exactly) so they might not be passed to the
>> build phases
>
> I think your understanding is correct. The private options are accepted
> on the build system, but not propagated to the lower build strata
> (applied to phases). So what we'd like here is to *not* expose an
> #:out-of-source argument at the build system level, and enforce
> #:out-of-source #t for the lower build code. I guess the static #t
> argument could be added to the bag arguments.
>

This does not work. I tried adding that to the arguments in the bag (and
reverting the previous patch) but get an error:

Unrecognized keyword: #:out-of-source?

I guess this is because meson-(cross-)build now get a keyword they don't
know.


Maybe we could replace the install-license-files function with a version
that has #:out-of-source? set to #t?. Not sure if there is an elegant
way to do this?

Toggle quote (11 lines)
>>
>> Would such a change require rebuilding (basically) everything given
>> that currently all packages are already built with #:out-of-source?
>> set to the default value #t?
>
> Yes. To test this kind of change without having to wait for the world
> to rebuild first, I sometimes make a copy of the build system files and
> suffix them with -v2 or something. It's a bit of a pain, but faster than
> waiting for 20k packages to be built.
>

Previously i have been using the tio package for testing because it had
no other dependencies depending on meson. However since it got upgraded
it now depends on glib ...
M
M
Maxim Cournoyer wrote on 14 Sep 15:41 +0200
(name . Dariqq)(address . dariqq@posteo.net)
87plp6s683.fsf@gmail.com
Hi Dariqq,

Dariqq <dariqq@posteo.net> writes:

Toggle quote (38 lines)
> On 12.09.24 14:02, Maxim Cournoyer wrote:
>> Hi Dariqq,
>> Dariqq <dariqq@posteo.net> writes:
>> [...]
>>
>>>>> Maybe it should not be an option at all and instead be #t
>>>>> unconditionally in 'install-license-files phase in meson-build-system?
>>>> Given most build phases of the gnu-build-system, which support
>>>> #:out-of-source? are reused in the meson-build-system, this argument
>>>> needs to be set to #t (which it currently is). But perhaps there's a
>>>> way to hide it from the users, perhaps via the 'private-keywords'
>>>> variable defined in the 'lower' procedure of the (guix build-system
>>>> meson) module (I haven't tested).
>>>>
>>>
>>> Something like that might be a better solution. I am not sure how
>>> these 'private-keywords' work: It looks like #:meson is one but you
>>> can definitly override the default meson being used. Also the
>>> private-arguments seem to get stripped from the arguments in the bag
>>> (not sure what that is exactly) so they might not be passed to the
>>> build phases
>> I think your understanding is correct. The private options are
>> accepted
>> on the build system, but not propagated to the lower build strata
>> (applied to phases). So what we'd like here is to *not* expose an
>> #:out-of-source argument at the build system level, and enforce
>> #:out-of-source #t for the lower build code. I guess the static #t
>> argument could be added to the bag arguments.
>>
>
> This does not work. I tried adding that to the arguments in the bag
> (and reverting the previous patch) but get an error:
>
> Unrecognized keyword: #:out-of-source?
>
> I guess this is because meson-(cross-)build now get a keyword they
> don't know.

Hm. Thanks for trying it out.

Toggle quote (4 lines)
> Maybe we could replace the install-license-files function with a
> version that has #:out-of-source? set to #t?. Not sure if there is an
> elegant way to do this?

Is this really the only reused phase from gnu-build-system that makes
use of #:out-of-source? I'd expect the 'configure' to be one, also.
And in general it'd be a bit more risky; new gnu-build-system phases
that would make use of #:out-of-source could start breaking in the
future until thye are specially handled.

--
Thanks,
Maxim
D
D
Dariqq wrote on 19 Sep 16:07 +0200
(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)
86f53b3e-976c-4757-9dcb-d41dce7263b9@posteo.net
On 14.09.24 15:41, Maxim Cournoyer wrote:
Toggle quote (15 lines)
> Hi Dariqq,
>
> Dariqq <dariqq@posteo.net> writes:
>
>>
>> This does not work. I tried adding that to the arguments in the bag
>> (and reverting the previous patch) but get an error:
>>
>> Unrecognized keyword: #:out-of-source?
>>
>> I guess this is because meson-(cross-)build now get a keyword they
>> don't know.
>
> Hm. Thanks for trying it out.
>
Not an expert on how this works but it looks like when a phase has a
keyword that is not being passed in by the build-system it is treated as
#f even if there is no default parameter specified in
install-license-files function itself.

If there is no easy other way what about leaving the parameter
undocumented as is? Maybe Ludo can elaborate on what the original
concern was?

Toggle quote (11 lines)
>> Maybe we could replace the install-license-files function with a
>> version that has #:out-of-source? set to #t?. Not sure if there is an
>> elegant way to do this?
>
> Is this really the only reused phase from gnu-build-system that makes
> use of #:out-of-source? I'd expect the 'configure' to be one, also.
> And in general it'd be a bit more risky; new gnu-build-system phases
> that would make use of #:out-of-source could start breaking in the
> future until thye are specially handled.
>

As far as I can see only the configure phase and the
install-license-phase in gnu-build-system use that parameter. As meson
overwrites configure with its own it only the install-license-files
phase uses it.
M
M
Maxim Cournoyer wrote on 22 Sep 07:57 +0200
(name . Dariqq)(address . dariqq@posteo.net)
87jzf4kz6h.fsf@gmail.com
Hi Dariqq,

Dariqq <dariqq@posteo.net> writes:

Toggle quote (23 lines)
> On 14.09.24 15:41, Maxim Cournoyer wrote:
>> Hi Dariqq,
>> Dariqq <dariqq@posteo.net> writes:
>>
>>>
>>> This does not work. I tried adding that to the arguments in the bag
>>> (and reverting the previous patch) but get an error:
>>>
>>> Unrecognized keyword: #:out-of-source?
>>>
>>> I guess this is because meson-(cross-)build now get a keyword they
>>> don't know.
>> Hm. Thanks for trying it out.
>>
> Not an expert on how this works but it looks like when a phase has a
> keyword that is not being passed in by the build-system it is treated
> as #f even if there is no default parameter specified in
> install-license-files function itself.
>
> If there is no easy other way what about leaving the parameter
> undocumented as is? Maybe Ludo can elaborate on what the original
> concern was?

Unless someone is able to explain what the use case is for its behavior,
I think that's what I would do. It's easy and we don't have to commit to
preserving that behavior forever if it doesn't have an actual use.

--
Thanks,
Maxim
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 73028@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 73028
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch