diff mbox series

[RFC] systemd: dont allow autoselect for meson

Message ID 20241110132848.2135721-1-f_l_k@t-online.de
State New
Headers show
Series [RFC] systemd: dont allow autoselect for meson | expand

Commit Message

Markus Volk Nov. 10, 2024, 1:28 p.m. UTC
This might help avoid reproducibility issues

Signed-off-by: Markus Volk <f_l_k@t-online.de>
---
 meta/recipes-core/systemd/systemd_256.7.bb | 1 +
 1 file changed, 1 insertion(+)

Comments

Alexander Kanavin Nov. 10, 2024, 2:40 p.m. UTC | #1
It would help to explain what the option does precisely.

Alex

On Sun 10. Nov 2024 at 14.26, Markus Volk via lists.openembedded.org <f_l_k=
t-online.de@lists.openembedded.org> wrote:

> This might help avoid reproducibility issues
>
> Signed-off-by: Markus Volk <f_l_k@t-online.de>
> ---
>  meta/recipes-core/systemd/systemd_256.7.bb | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/meta/recipes-core/systemd/systemd_256.7.bb
> b/meta/recipes-core/systemd/systemd_256.7.bb
> index bf829c4931..159a0e25b8 100644
> --- a/meta/recipes-core/systemd/systemd_256.7.bb
> +++ b/meta/recipes-core/systemd/systemd_256.7.bb
> @@ -258,6 +258,7 @@ EXTRA_OEMESON += "-Dnobody-user=nobody \
>                    -Dsystem-gid-max=999 \
>                    -Dcreate-log-dirs=false \
>                    ${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf',
> '-Ddefault-mdns=no -Ddefault-llmnr=no', '', d)} \
> +                  --auto-features=disabled \
>                    "
>
>  # Hardcode target binary paths to avoid using paths from sysroot or worse
> --
> 2.47.0
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#206919):
> https://lists.openembedded.org/g/openembedded-core/message/206919
> Mute This Topic: https://lists.openembedded.org/mt/109496557/1686489
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [
> alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>
Markus Volk Nov. 10, 2024, 2:52 p.m. UTC | #2
On Sun, Nov 10 2024 at 03:40:42 PM +01:00:00, Alexander Kanavin via 
lists.openembedded.org <alex.kanavin=gmail.com@lists.openembedded.org> 
wrote:
> It would help to explain what the option does precisely.

As far as I understand it, it is a general way for meson to prevent the 
addition of features just because the required source has been found. 
Each feature must then be explicitly enabled.

I checked if the setting is effective by creating sysupdate. If 
auto-features=enabled, it was enough to add util-linux to the 
PACKAGECONFIG[sysuser] depends field and fdisk support was built 
without having to explicitly set -Dfdisk=enabled. With 
'--auto-features=disabled' the latter was required.
Markus Volk Nov. 10, 2024, 3:23 p.m. UTC | #3
According to meson documentation:

  --auto-features {enabled,disabled,auto}
                                        Override value of all 'auto' 
features
                                        (default: auto).

On Sun, Nov 10 2024 at 03:52:26 PM +01:00:00, Markus Volk 
<f_l_k@t-online.de> wrote:
> On Sun, Nov 10 2024 at 03:40:42 PM +01:00:00, Alexander Kanavin via 
> lists.openembedded.org 
> <alex.kanavin=gmail.com@lists.openembedded.org> wrote:
>> It would help to explain what the option does precisely.
> 
> As far as I understand it, it is a general way for meson to prevent 
> the addition of features just because the required source has been 
> found. Each feature must then be explicitly enabled.
> 
> I checked if the setting is effective by creating sysupdate. If 
> auto-features=enabled, it was enough to add util-linux to the 
> PACKAGECONFIG[sysuser] depends field and fdisk support was built 
> without having to explicitly set -Dfdisk=enabled. With 
> '--auto-features=disabled' the latter was required.
Alexander Kanavin Nov. 10, 2024, 4:33 p.m. UTC | #4
On Sun, 10 Nov 2024 at 16:21, Markus Volk <f_l_k@t-online.de> wrote:
>
> According to meson documentation:
>
>   --auto-features {enabled,disabled,auto}
>                                         Override value of all 'auto' features
>                                         (default: auto).

Shouldn't this go to meson.bbclass then? It's useful everywhere.

Alex
Markus Volk Nov. 10, 2024, 4:43 p.m. UTC | #5
On Sun, Nov 10 2024 at 05:33:42 PM +01:00:00, Alexander Kanavin via 
lists.openembedded.org <alex.kanavin=gmail.com@lists.openembedded.org> 
wrote:
> Shouldn't this go to meson.bbclass then? It's useful everywhere.

Presumably yes, but I just found out about this command-line option and 
didn't dare to propose it for the whole system without checking the 
impact.I have some other stuff I'd like to sort out before I can have a 
look at. For now I only verified that systemd builds with oe-core and 
poky for qemux86-64 with glibc and musl
ChenQi Nov. 11, 2024, 7:07 a.m. UTC | #6
I have two small questions.

1) For the current systemd, what's the difference between the final 
configure results with/without this option?
2) How could this help avoid reproducibility issues?

Regards,
Qi

On 11/10/24 21:28, Markus Volk wrote:
> This might help avoid reproducibility issues
>
> Signed-off-by: Markus Volk <f_l_k@t-online.de>
> ---
>   meta/recipes-core/systemd/systemd_256.7.bb | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/meta/recipes-core/systemd/systemd_256.7.bb b/meta/recipes-core/systemd/systemd_256.7.bb
> index bf829c4931..159a0e25b8 100644
> --- a/meta/recipes-core/systemd/systemd_256.7.bb
> +++ b/meta/recipes-core/systemd/systemd_256.7.bb
> @@ -258,6 +258,7 @@ EXTRA_OEMESON += "-Dnobody-user=nobody \
>                     -Dsystem-gid-max=999 \
>                     -Dcreate-log-dirs=false \
>                     ${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', '-Ddefault-mdns=no -Ddefault-llmnr=no', '', d)} \
> +                  --auto-features=disabled \
>                     "
>   
>   # Hardcode target binary paths to avoid using paths from sysroot or worse
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#206919): https://lists.openembedded.org/g/openembedded-core/message/206919
> Mute This Topic: https://lists.openembedded.org/mt/109496557/7304865
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [Qi.Chen@eng.windriver.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Markus Volk Nov. 11, 2024, 9:48 a.m. UTC | #7
On Mon, Nov 11 2024 at 03:07:30 PM +08:00:00, ChenQi 
<Qi.Chen@windriver.com> wrote:
> ?

1) I didn't diff the output files yet, so I don't have a valid answer 
to this. I just looked at log.do_configure with and without this option 
and did some runtime testing
2) Generally speaking, a binary changes when a feature is added. 
Ideally, a feature should only be added if this is explicitly 
specified. Otherwise there can always be differences (e.g. because a 
tool is searched for and found on the host machine). This can lead to 
different results on different distributions/installations.
Alexander Kanavin Nov. 11, 2024, 10:49 a.m. UTC | #8
On Mon, 11 Nov 2024 at 08:07, Chen Qi via lists.openembedded.org
<Qi.Chen=windriver.com@lists.openembedded.org> wrote:
> 2) How could this help avoid reproducibility issues?

Reproducibility is slightly incorrect term to use here, a better one
is 'build determinism'. When a component is using auto-detection to
enable (or not) features, the result build configuration can quietly
change behind your back depending on what was found (or not) in a
sysroot, or on the build host. We constantly have to fix such issues
by adding missing PACKAGECONFIGs, or forcing parameters in
EXTRA_OECONF etc. An option to blanket-disable such auto-detection
across all of meson is most welcome.

Alex
Alexander Kanavin Nov. 11, 2024, 11:03 a.m. UTC | #9
On Sun, 10 Nov 2024 at 17:41, Markus Volk <f_l_k@t-online.de> wrote:
> Shouldn't this go to meson.bbclass then? It's useful everywhere.
>
>
> Presumably yes, but I just found out about this command-line option and didn't dare to propose it for the whole system without checking the impact.I have some other stuff I'd like to sort out before I can have a look at. For now I only verified that systemd builds with oe-core and poky for qemux86-64 with glibc and musl

You can totally propose a patch for the whole system, if you clearly
note that it was not given broad testing (but building as many meson
driven projects as possible with it would be appreciated). We'll take
that into account, and throw it on the autobuilder anyway to see if it
breaks everything, something or nothing at all.

Alex
Ross Burton Nov. 11, 2024, 1:31 p.m. UTC | #10
> On 10 Nov 2024, at 16:33, Alexander Kanavin via lists.openembedded.org <alex.kanavin=gmail.com@lists.openembedded.org> wrote:
> 
> On Sun, 10 Nov 2024 at 16:21, Markus Volk <f_l_k@t-online.de> wrote:
>> 
>> According to meson documentation:
>> 
>>  --auto-features {enabled,disabled,auto}
>>                                        Override value of all 'auto' features
>>                                        (default: auto).
> 
> Shouldn't this go to meson.bbclass then? It's useful everywhere.

Yes, I believe so.

https://git.yoctoproject.org/poky-contrib/log/?h=ross/mesonopts is a WIP from some time ago where I changed the auto-features option and went around forcing options where it changed build options.  There’s a few packages that were still to do — I left gstreamer as auto for now as the list of options is quite extensive but that should probably be fixed.  Somewhere there’s a script to run the meson configuration into a PACKAGECONFIG statement that just needs the DEPENDS filled in…

Ross
Markus Volk Nov. 12, 2024, 6:51 a.m. UTC | #11
Since you are already working on it, this can be ignored.

On Mon, Nov 11 2024 at 01:31:29 PM +00:00:00, Ross Burton 
<Ross.Burton@arm.com> wrote:
> 
> 
>>  On 10 Nov 2024, at 16:33, Alexander Kanavin via 
>> lists.openembedded.org 
>> <alex.kanavin=gmail.com@lists.openembedded.org 
>> <mailto:alex.kanavin=gmail.com@lists.openembedded.org>> wrote:
>> 
>>  On Sun, 10 Nov 2024 at 16:21, Markus Volk <f_l_k@t-online.de 
>> <mailto:f_l_k@t-online.de>> wrote:
>>> 
>>>  According to meson documentation:
>>> 
>>>   --auto-features {enabled,disabled,auto}
>>>                                         Override value of all 
>>> 'auto' features
>>>                                         (default: auto).
>> 
>>  Shouldn't this go to meson.bbclass then? It's useful everywhere.
> 
> Yes, I believe so.
> 
> <https://git.yoctoproject.org/poky-contrib/log/?h=ross/mesonopts> is 
> a WIP from some time ago where I changed the auto-features option and 
> went around forcing options where it changed build options.  
> There’s a few packages that were still to do — I left gstreamer 
> as auto for now as the list of options is quite extensive but that 
> should probably be fixed.  Somewhere there’s a script to run the 
> meson configuration into a PACKAGECONFIG statement that just needs 
> the DEPENDS filled in…
> 
> Ross
diff mbox series

Patch

diff --git a/meta/recipes-core/systemd/systemd_256.7.bb b/meta/recipes-core/systemd/systemd_256.7.bb
index bf829c4931..159a0e25b8 100644
--- a/meta/recipes-core/systemd/systemd_256.7.bb
+++ b/meta/recipes-core/systemd/systemd_256.7.bb
@@ -258,6 +258,7 @@  EXTRA_OEMESON += "-Dnobody-user=nobody \
                   -Dsystem-gid-max=999 \
                   -Dcreate-log-dirs=false \
                   ${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', '-Ddefault-mdns=no -Ddefault-llmnr=no', '', d)} \
+                  --auto-features=disabled \
                   "
 
 # Hardcode target binary paths to avoid using paths from sysroot or worse