GNU bug report logs - #57430
[PATCH] gnu: wayland-protocols: Fix cross-compilation

Previous Next

Package: guix-patches;

Reported by: Tobias Kortkamp <tobias.kortkamp <at> gmail.com>

Date: Fri, 26 Aug 2022 14:32:02 UTC

Severity: normal

Tags: patch

Done: Mathieu Othacehe <othacehe <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 57430 in the body.
You can then email your comments to 57430 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#57430; Package guix-patches. (Fri, 26 Aug 2022 14:32:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tobias Kortkamp <tobias.kortkamp <at> gmail.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Fri, 26 Aug 2022 14:32:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Tobias Kortkamp <tobias.kortkamp <at> gmail.com>
To: guix-patches <at> gnu.org
Cc: Tobias Kortkamp <tobias.kortkamp <at> gmail.com>
Subject: [PATCH] gnu: wayland-protocols: Fix cross-compilation
Date: Fri, 26 Aug 2022 12:14:58 +0200
* gnu/packages/freedesktop.scm (wayland-protocols): Fix cross-compilation
[native-inputs]: Add pkg-config-for-build and wayland.
---
 gnu/packages/freedesktop.scm | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index 037a247243..c0a94c6623 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -1074,8 +1074,11 @@ (define-public wayland-protocols
     (build-system meson-build-system)
     (inputs
      (list wayland))
-    (native-inputs
-     (list pkg-config python))
+    (native-inputs (cons* pkg-config python
+                          (if (%current-target-system)
+                              (list pkg-config-for-build
+                                    wayland) ; for wayland-scanner
+                              '())))
     (synopsis "Wayland protocols")
     (description "Wayland-Protocols contains Wayland protocols that add
 functionality not available in the Wayland core protocol.  Such protocols either
-- 
2.37.1





Information forwarded to guix-patches <at> gnu.org:
bug#57430; Package guix-patches. (Fri, 26 Aug 2022 15:05:01 GMT) Full text and rfc822 format available.

Message #8 received at 57430 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: Tobias Kortkamp <tobias.kortkamp <at> gmail.com>, 57430 <at> debbugs.gnu.org
Cc: muradm <mail <at> muradm.net>, Liliana Marie Prikler <liliana.prikler <at> gmail.com>
Subject: Re: [bug#57430] [PATCH] gnu: wayland-protocols: Fix cross-compilation
Date: Fri, 26 Aug 2022 17:04:27 +0200
[Message part 1 (text/plain, inline)]
On 26-08-2022 12:14, Tobias Kortkamp wrote:

> * gnu/packages/freedesktop.scm (wayland-protocols): Fix cross-compilation
> [native-inputs]: Add pkg-config-for-build and wayland.

According to 'guix gc --references $(guix build wayland-protocols))' and 
it only having a 'share' subdirectory, this appears pure, 
architecture-independent, data.

As such, here's a proposal for a simpler solution: do:

;; Pure architecture-independent data, cross-compilation is meaningless.
;; Resolve a cross-compilation failure and save some disk space and 
compilation
;; time by always compiling natively. As an additional benefit, this 
avoids some
;; worrying about whether placing this package should be placed in 
'inputs' or in
;; 'native-inputs', it can now be placed wherever makes the build succeed.

(arguments (list #:target #false))

This appears related to https://issues.guix.gnu.org/50627, so putting 
the people there in CC.

I'm wondering, is whatever the issue addressed by 50627 now addressed by 
this patch?

Greetings,
Maxime.
[OpenPGP_0x49E3EE22191725EE.asc (application/pgp-keys, attachment)]
[OpenPGP_signature (application/pgp-signature, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#57430; Package guix-patches. (Fri, 26 Aug 2022 17:12:04 GMT) Full text and rfc822 format available.

Message #11 received at 57430 <at> debbugs.gnu.org (full text, mbox):

From: muradm <mail <at> muradm.net>
To: Maxime Devos <maximedevos <at> telenet.be>
Cc: 57430 <at> debbugs.gnu.org, Tobias Kortkamp <tobias.kortkamp <at> gmail.com>,
 Liliana Marie Prikler <liliana.prikler <at> gmail.com>
Subject: Re: [bug#57430] [PATCH] gnu: wayland-protocols: Fix cross-compilation
Date: Fri, 26 Aug 2022 19:59:01 +0300
[Message part 1 (text/plain, inline)]
Maxime Devos <maximedevos <at> telenet.be> writes:

> [[PGP Signed Part:Undecided]]
> On 26-08-2022 12:14, Tobias Kortkamp wrote:
>
>> * gnu/packages/freedesktop.scm (wayland-protocols): Fix 
>> cross-compilation
>> [native-inputs]: Add pkg-config-for-build and wayland.
>
> According to 'guix gc --references $(guix build 
> wayland-protocols))'
> and it only having a 'share' subdirectory, this appears pure,
> architecture-independent, data.
>
> As such, here's a proposal for a simpler solution: do:
>
> ;; Pure architecture-independent data, cross-compilation is 
> meaningless.
> ;; Resolve a cross-compilation failure and save some disk space 
> and
>    compilation
> ;; time by always compiling natively. As an additional benefit, 
> this
>    avoids some
> ;; worrying about whether placing this package should be placed 
> in
>    'inputs' or in
> ;; 'native-inputs', it can now be placed wherever makes the 
> build succeed.
>
> (arguments (list #:target #false))
>
> This appears related to https://issues.guix.gnu.org/50627, so 
> putting
> the people there in CC.
>
> I'm wondering, is whatever the issue addressed by 50627 now 
> addressed
> by this patch?

Purpose of 50627 was to reduce dependency on wayland-protocols 
from
other packages.

As far as I understand, this one is to reduce dependencies of
wayland-protocols itself.

As far as I know, there is no binary output of wayland-protocols,
and wayland maybe needed as dependency for testing purposes only.
IMHO these tests are targeted for developers producing protocol
specifications. Once protocol specification is ready
wayland-protocols is released. So running tests on
wayland-protocols should be pointless waste of resources, as they
don't prove that anything useful, instead dependents should
test themselves. If testing causing waste of space and resources
I would turn them off or probably use copy-build-system even.

> Greetings,
> Maxime.
>
> [2. OpenPGP public key --- application/pgp-keys; 
> OpenPGP_0x49E3EE22191725EE.asc]...
>
> [[End of PGP Signed Part]]

[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#57430; Package guix-patches. (Fri, 26 Aug 2022 18:59:02 GMT) Full text and rfc822 format available.

Message #14 received at 57430 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: muradm <mail <at> muradm.net>
Cc: 57430 <at> debbugs.gnu.org, Tobias Kortkamp <tobias.kortkamp <at> gmail.com>,
 Liliana Marie Prikler <liliana.prikler <at> gmail.com>
Subject: Re: [bug#57430] [PATCH] gnu: wayland-protocols: Fix cross-compilation
Date: Fri, 26 Aug 2022 20:58:51 +0200
[Message part 1 (text/plain, inline)]
On 26-08-2022 18:59, muradm wrote:
> As far as I understand, this one is to reduce dependencies of
> wayland-protocols itself. 

This one keeps the dependencies the same (except for pkg-config / 
pkg-config-for-build) -- it just sorts the dependencies differently.

> As far as I know, there is no binary output of wayland-protocols,

'ls -R "$(guix build wayland-protocols)"'? Maybe not 'binary', but it 
still appears required by some dependents.

> and wayland maybe needed as dependency for testing purposes only. 
This appears confirmed by meson.build. In that case, wayland can be 
removed from 'inputs' and put in 'native-inputs' unconditionally.

Tobias, does unconditionally moving wayland from 'inputs' to 
'native-inputs' (and unconditionally using pkg-config-for-build) work? 
Potential problem: lots of dependents according to "guix refresh -l", 
making it unconditional would need to be done on core-updates or staging.

> IMHO these tests are targeted for developers producing protocol
> specifications. Once protocol specification is ready
> wayland-protocols is released. So running tests on
> wayland-protocols should be pointless waste of resources, as they
> don't prove that anything useful, instead dependents should
> test themselves. If testing causing waste of space and resources
> I would turn them off or probably use copy-build-system even. 
#:tests? #false should suffice, no need to switch to copy-build-system.

I see the argument for a waste of CPU time/energy resources, but not for 
a waste of space.

Also, it is a dangerous assumption to make that developers run tests 
prior to a release. It seems pretty logical to me to do that, but 
sometimes errors are encountered in Guix and discussions happen upstream 
that indicate that this somehow didn't happen.

Even if developers are known to always run tests, without fail, they 
might run tests in a different environment.

For example, until recent-ish, GCC did -fcommon as a default, but later 
switched to -fcommon, breaking some builds.

Also, 'developers' is not necessarily 'upstream developers'. Sometimes 
Guix adds a patch to package definitions, in combinations that upstream 
might not have tested, in that case running tests is important. 
Additionally, sometimes I find it more practical to write a patch, add 
it to the package definition and do a "guix build", than to do 
whatever's the meson equivalent of 'make && make check'.

Greetings,
Maxime.

[OpenPGP_0x49E3EE22191725EE.asc (application/pgp-keys, attachment)]
[OpenPGP_signature (application/pgp-signature, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#57430; Package guix-patches. (Fri, 26 Aug 2022 19:23:02 GMT) Full text and rfc822 format available.

Message #17 received at 57430 <at> debbugs.gnu.org (full text, mbox):

From: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
To: Maxime Devos <maximedevos <at> telenet.be>, muradm <mail <at> muradm.net>
Cc: 57430 <at> debbugs.gnu.org, Tobias Kortkamp <tobias.kortkamp <at> gmail.com>
Subject: Re: [bug#57430] [PATCH] gnu: wayland-protocols: Fix cross-compilation
Date: Fri, 26 Aug 2022 21:22:48 +0200
Am Freitag, dem 26.08.2022 um 20:58 +0200 schrieb Maxime Devos:
> For example, until recent-ish, GCC did -fcommon as a default, but
> later switched to -fcommon, breaking some builds.
You probably typo'd there.

> Additionally, sometimes I find it more practical to write a patch,
> add it to the package definition and do a "guix build", than to do 
> whatever's the meson equivalent of 'make && make check'.
This is good advice for everyone regardless of build system, even if
you do also run make && make check manually.  guix build addresses
several other issues, particular in the graphics toolkit world :)




Information forwarded to guix-patches <at> gnu.org:
bug#57430; Package guix-patches. (Fri, 26 Aug 2022 20:35:01 GMT) Full text and rfc822 format available.

Message #20 received at 57430 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: Liliana Marie Prikler <liliana.prikler <at> gmail.com>, muradm <mail <at> muradm.net>
Cc: 57430 <at> debbugs.gnu.org, Tobias Kortkamp <tobias.kortkamp <at> gmail.com>
Subject: Re: [bug#57430] [PATCH] gnu: wayland-protocols: Fix cross-compilation
Date: Fri, 26 Aug 2022 22:34:46 +0200
[Message part 1 (text/plain, inline)]
On 26-08-2022 21:22, Liliana Marie Prikler wrote:

> Am Freitag, dem 26.08.2022 um 20:58 +0200 schrieb Maxime Devos:
>> For example, until recent-ish, GCC did -fcommon as a default, but
>> later switched to -fcommon, breaking some builds.
> You probably typo'd there.
Yes, -fcommon and -fno-common if I have my GCC flags right.

Greetings,
Maxime

[OpenPGP_0x49E3EE22191725EE.asc (application/pgp-keys, attachment)]
[OpenPGP_signature (application/pgp-signature, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#57430; Package guix-patches. (Sat, 27 Aug 2022 10:41:01 GMT) Full text and rfc822 format available.

Message #23 received at 57430 <at> debbugs.gnu.org (full text, mbox):

From: Tobias Kortkamp <tobias.kortkamp <at> gmail.com>
To: Maxime Devos <maximedevos <at> telenet.be>
Cc: 57430 <at> debbugs.gnu.org, muradm <mail <at> muradm.net>,
 Liliana Marie Prikler <liliana.prikler <at> gmail.com>
Subject: Re: [bug#57430] [PATCH] gnu: wayland-protocols: Fix cross-compilation
Date: Sat, 27 Aug 2022 12:40:12 +0200
On Fri, Aug 26, 2022 at 08:58:51PM +0200, Maxime Devos wrote:
> Tobias, does unconditionally moving wayland from 'inputs' to 'native-inputs'
> (and unconditionally using pkg-config-for-build) work? Potential problem:
> lots of dependents according to "guix refresh -l", making it unconditional
> would need to be done on core-updates or staging.

You mean change the patch like this?

-    (inputs
-     (list wayland))
-    (native-inputs (cons* pkg-config python
-                          (if (%current-target-system)
-                              (list pkg-config-for-build
-                                    wayland) ; for wayland-scanner
-                              '())))
+    (native-inputs (list pkg-config pkg-config-for-build wayland python))

No, it doesn't work:

Run-time dependency wayland-client found: NO (tried pkgconfig)

../wayland-protocols-1.23/tests/meson.build:4:0: ERROR: Dependency "wayland-client" not found, tried pkgconfig

What would work is:

+    (arguments `(#:configure-flags (list "-Dtests=false")))
+    (native-inputs (list pkg-config-for-build wayland))

But this turns off the tests. Even then it still looks for
wayland-scanner for some reason.





Information forwarded to guix-patches <at> gnu.org:
bug#57430; Package guix-patches. (Sat, 27 Aug 2022 11:03:01 GMT) Full text and rfc822 format available.

Message #26 received at 57430 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: Tobias Kortkamp <tobias.kortkamp <at> gmail.com>
Cc: 57430 <at> debbugs.gnu.org, muradm <mail <at> muradm.net>,
 Liliana Marie Prikler <liliana.prikler <at> gmail.com>
Subject: Re: [bug#57430] [PATCH] gnu: wayland-protocols: Fix cross-compilation
Date: Sat, 27 Aug 2022 13:02:29 +0200
[Message part 1 (text/plain, inline)]
On 27-08-2022 12:40, Tobias Kortkamp wrote:
> On Fri, Aug 26, 2022 at 08:58:51PM +0200, Maxime Devos wrote:
>> Tobias, does unconditionally moving wayland from 'inputs' to 'native-inputs'
>> (and unconditionally using pkg-config-for-build) work? Potential problem:
>> lots of dependents according to "guix refresh -l", making it unconditional
>> would need to be done on core-updates or staging.
> You mean change the patch like this?
>
> -    (inputs
> -     (list wayland))
> -    (native-inputs (cons* pkg-config python
> -                          (if (%current-target-system)
> -                              (list pkg-config-for-build
> -                                    wayland) ; for wayland-scanner
> -                              '())))
> +    (native-inputs (list pkg-config pkg-config-for-build wayland python))
>
> No, it doesn't work:
>
> Run-time dependency wayland-client found: NO (tried pkgconfig)
>
> ../wayland-protocols-1.23/tests/meson.build:4:0: ERROR: Dependency "wayland-client" not found, tried pkgconfig

I thought it would work because in the meson.build, wayland-protocols 
was listed as 'native', but apparently things are different on 
core-updates and master (1.23 vs. 1.25).

Greetings,
Maxime.


[OpenPGP_0x49E3EE22191725EE.asc (application/pgp-keys, attachment)]
[OpenPGP_signature (application/pgp-signature, attachment)]

Reply sent to Mathieu Othacehe <othacehe <at> gnu.org>:
You have taken responsibility. (Tue, 30 Aug 2022 07:19:01 GMT) Full text and rfc822 format available.

Notification sent to Tobias Kortkamp <tobias.kortkamp <at> gmail.com>:
bug acknowledged by developer. (Tue, 30 Aug 2022 07:19:01 GMT) Full text and rfc822 format available.

Message #31 received at 57430-done <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Othacehe <othacehe <at> gnu.org>
To: Tobias Kortkamp <tobias.kortkamp <at> gmail.com>
Cc: 57430-done <at> debbugs.gnu.org, maximedevos <at> telenet.be
Subject: Re: bug#57430: [PATCH] gnu: wayland-protocols: Fix cross-compilation
Date: Tue, 30 Aug 2022 09:18:30 +0200
Hello Tobias,

> * gnu/packages/freedesktop.scm (wayland-protocols): Fix cross-compilation
> [native-inputs]: Add pkg-config-for-build and wayland.

Maxime's idea of setting #target to false is interesting but let's go
with your original patch because it's the way we handle things in
general.

Thanks,

Mathieu




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 27 Sep 2022 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 210 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.