GNU bug report logs -
#54595
[PATCH 0/2] Fix cross-compilation for libfido2
Previous Next
Reported by: Sébastien Lerique <sl <at> eauchat.org>
Date: Sun, 27 Mar 2022 12:29:01 UTC
Severity: normal
Tags: patch
Done: Ludovic Courtès <ludo <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 54595 in the body.
You can then email your comments to 54595 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
guix-patches <at> gnu.org
:
bug#54595
; Package
guix-patches
.
(Sun, 27 Mar 2022 12:29:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Sébastien Lerique <sl <at> eauchat.org>
:
New bug report received and forwarded. Copy sent to
guix-patches <at> gnu.org
.
(Sun, 27 Mar 2022 12:29:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Hello guix!
This small patch fixes cross-compilation for libfido2, which in turn is
necessary to cross-compile openssh.
Thank you to Pierre Langlois and for help on IRC!
Sébastien Lerique (2):
gnu: libfido2: Use new style.
gnu: libfido2: Fix cross-compilation.
gnu/packages/security-token.scm | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
base-commit: cabda1197e7925f58a8532534afc1bde6c5eb377
--
2.34.0
Information forwarded
to
guix-patches <at> gnu.org
:
bug#54595
; Package
guix-patches
.
(Sun, 27 Mar 2022 12:31:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 54595 <at> debbugs.gnu.org (full text, mbox):
* gnu/packages/security-token.scm (libfido2)[inputs]: Use new style.
---
gnu/packages/security-token.scm | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/gnu/packages/security-token.scm b/gnu/packages/security-token.scm
index 129b8f6122..6853d5bc9e 100644
--- a/gnu/packages/security-token.scm
+++ b/gnu/packages/security-token.scm
@@ -903,11 +903,7 @@ (define-public libfido2
(file-name (git-file-name name version))
(sha256 (base32 "12zy4cnlcffcb64lsx8198y09j1dwi0bcn9rr82q6i1k950yzd3p"))))
(native-inputs (list pkg-config))
- (inputs
- `(("zlib" ,zlib)
- ("udev" ,eudev)
- ("libcbor" ,libcbor)
- ("openssl" ,openssl)))
+ (inputs (list zlib eudev libcbor openssl))
(build-system cmake-build-system)
(arguments
'(#:phases
--
2.34.0
Information forwarded
to
guix-patches <at> gnu.org
:
bug#54595
; Package
guix-patches
.
(Sun, 27 Mar 2022 12:31:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 54595 <at> debbugs.gnu.org (full text, mbox):
* gnu/packages/security-token.scm (libfido2)[arguments]: Set
PKG_CONFIG_EXECUTABLE variable when cross-compiling.
---
gnu/packages/security-token.scm | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/gnu/packages/security-token.scm b/gnu/packages/security-token.scm
index 6853d5bc9e..903da686f9 100644
--- a/gnu/packages/security-token.scm
+++ b/gnu/packages/security-token.scm
@@ -906,7 +906,16 @@ (define-public libfido2
(inputs (list zlib eudev libcbor openssl))
(build-system cmake-build-system)
(arguments
- '(#:phases
+ `(#:configure-flags (list ,@(if (%current-target-system)
+ `((string-append
+ "-DPKG_CONFIG_EXECUTABLE="
+ (search-input-file %build-inputs
+ (string-append
+ "/bin/"
+ ,(%current-target-system)
+ "-pkg-config"))))
+ '()))
+ #:phases
(modify-phases %standard-phases
;; regress tests enabled only for debug builds
(delete 'check))))
--
2.34.0
Information forwarded
to
guix-patches <at> gnu.org
:
bug#54595
; Package
guix-patches
.
(Sun, 27 Mar 2022 12:37:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 54595 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Sébastien Lerique schreef op zo 27-03-2022 om 21:29 [+0900]:
> + ,(%current-target-system)
> + "-pkg-config"))))
This can be simplified with 'pkg-config-for-target':
#:configure-flags
(list (string-append "-DPKG_CONFIG_EXECUTABLE="
(search-input-file %build-inputs
(string-append "/bin/" ,(pkg-config-for-target)))))
Greetings,
Maxime.
[signature.asc (application/pgp-signature, inline)]
Information forwarded
to
guix-patches <at> gnu.org
:
bug#54595
; Package
guix-patches
.
(Sun, 27 Mar 2022 13:01:01 GMT)
Full text and
rfc822 format available.
Message #17 received at 54595 <at> debbugs.gnu.org (full text, mbox):
* gnu/packages/security-token.scm (libfido2)[inputs]: Use new style.
---
gnu/packages/security-token.scm | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/gnu/packages/security-token.scm b/gnu/packages/security-token.scm
index 129b8f6122..6853d5bc9e 100644
--- a/gnu/packages/security-token.scm
+++ b/gnu/packages/security-token.scm
@@ -903,11 +903,7 @@ (define-public libfido2
(file-name (git-file-name name version))
(sha256 (base32 "12zy4cnlcffcb64lsx8198y09j1dwi0bcn9rr82q6i1k950yzd3p"))))
(native-inputs (list pkg-config))
- (inputs
- `(("zlib" ,zlib)
- ("udev" ,eudev)
- ("libcbor" ,libcbor)
- ("openssl" ,openssl)))
+ (inputs (list zlib eudev libcbor openssl))
(build-system cmake-build-system)
(arguments
'(#:phases
base-commit: cabda1197e7925f58a8532534afc1bde6c5eb377
--
2.34.0
Information forwarded
to
guix-patches <at> gnu.org
:
bug#54595
; Package
guix-patches
.
(Sun, 27 Mar 2022 13:01:01 GMT)
Full text and
rfc822 format available.
Message #20 received at 54595 <at> debbugs.gnu.org (full text, mbox):
* gnu/packages/security-token.scm (libfido2)[arguments]: Set
PKG_CONFIG_EXECUTABLE variable when cross-compiling.
---
gnu/packages/security-token.scm | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/gnu/packages/security-token.scm b/gnu/packages/security-token.scm
index 6853d5bc9e..db8a8a53d3 100644
--- a/gnu/packages/security-token.scm
+++ b/gnu/packages/security-token.scm
@@ -44,6 +44,7 @@ (define-module (gnu packages security-token)
#:use-module (guix build-system gnu)
#:use-module (guix build-system glib-or-gtk)
#:use-module (guix build-system python)
+ #:use-module (guix utils)
#:use-module (gnu packages autotools)
#:use-module (gnu packages base)
#:use-module (gnu packages curl)
@@ -906,7 +907,15 @@ (define-public libfido2
(inputs (list zlib eudev libcbor openssl))
(build-system cmake-build-system)
(arguments
- '(#:phases
+ `(#:configure-flags (list ,@(if (%current-target-system)
+ `((string-append
+ "-DPKG_CONFIG_EXECUTABLE="
+ (search-input-file %build-inputs
+ (string-append
+ "/bin/"
+ ,(pkg-config-for-target)))))
+ '()))
+ #:phases
(modify-phases %standard-phases
;; regress tests enabled only for debug builds
(delete 'check))))
--
2.34.0
Information forwarded
to
guix-patches <at> gnu.org
:
bug#54595
; Package
guix-patches
.
(Sun, 27 Mar 2022 13:02:02 GMT)
Full text and
rfc822 format available.
Message #23 received at 54595 <at> debbugs.gnu.org (full text, mbox):
On 27 Mar 2022 at 14:36, Maxime Devos <maximedevos <at> telenet.be> wrote:
> This can be simplified with 'pkg-config-for-target':
>
Indeed, thanks! Just tried again with a v2.
Best,
Sébastien
Information forwarded
to
guix-patches <at> gnu.org
:
bug#54595
; Package
guix-patches
.
(Sun, 27 Mar 2022 14:10:01 GMT)
Full text and
rfc822 format available.
Message #26 received at 54595 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Sébastien Lerique schreef op zo 27-03-2022 om 22:00 [+0900]:
> + `(#:configure-flags (list ,@(if (%current-target-system)
> + `((string-append
> + "-DPKG_CONFIG_EXECUTABLE="
> + (search-input-file %build-inputs
> + (string-append
> + "/bin/"
> + ,(pkg-config-for-target)))))
> + '()))
'pkg-config-for-target' just returns "pkg-config" when compiling
natively, so the 'if' can be dropped here and the "-
DPKG_CONFIG_EXECUTABLE=..." be made unconditional.
For clarity, I would put the 'list' on a separate line, though for
style reasons that might require removing the quasiquote and turning it
in a 'list': (arguments (list #:phases #~(foo ...) #:configure-flags
#~(bar ... #$(pkg-config-for-target)))).
Greetings,
Maxime.
[signature.asc (application/pgp-signature, inline)]
Information forwarded
to
guix-patches <at> gnu.org
:
bug#54595
; Package
guix-patches
.
(Sun, 27 Mar 2022 14:12:01 GMT)
Full text and
rfc822 format available.
Message #29 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Hi,
Maxime Devos <maximedevos <at> telenet.be> writes:
> [[PGP Signed Part:Undecided]]
> Sébastien Lerique schreef op zo 27-03-2022 om 21:29 [+0900]:
>> + ,(%current-target-system)
>> + "-pkg-config"))))
>
> This can be simplified with 'pkg-config-for-target':
>
> #:configure-flags
> (list (string-append "-DPKG_CONFIG_EXECUTABLE="
> (search-input-file %build-inputs
> (string-append "/bin/" ,(pkg-config-for-target)))))
For my own benefit trying to get better at writing gexps, I was
wondering how to write in order to remove the %build-inputs reference.
I came up with the following:
--8<---------------cut here---------------start------------->8---
(arguments
(list
#:configure-flags
#~(list #$@(if (%current-target-system)
(list
#~(string-append
"-DPKG_CONFIG_EXECUTABLE="
#+pkg-config "/bin/"
#$(pkg-config-for-target)))
'()))
#:phases
#~(modify-phases %standard-phases
;; regress tests enabled only for debug builds
(delete 'check))))
--8<---------------cut here---------------end--------------->8---
Would this a the better way to do this? It looks a bit complex to me so
I wonder if there's a simpler way. I'm also not entirely sure if it's
#+pkg-config or #$pkg-config, both seem to work, however I thought we
should be using #+ for native inputs and #$ for regular inputs.
Thanks,
Pierre
[signature.asc (application/pgp-signature, inline)]
Information forwarded
to
guix-patches <at> gnu.org
:
bug#54595
; Package
guix-patches
.
(Sun, 27 Mar 2022 14:12:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
guix-patches <at> gnu.org
:
bug#54595
; Package
guix-patches
.
(Sun, 27 Mar 2022 15:44:01 GMT)
Full text and
rfc822 format available.
Message #35 received at 54595 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Pierre Langlois schreef op zo 27-03-2022 om 15:04 [+0100]:
> I'm also not entirely sure if it's
> #+pkg-config or #$pkg-config, both seem to work
#+pkg-config, given that it is a thing that needs to be run during
compilation. I'm wondering, do you have transparant QEMU emulation
enabled? If so, both seeming to work is expected since QEMU will
emulate the cross-compiled cross-compiling (IIUC a canadian cross, in
GCC terminology) pkg-config. If not, I would expect some kind of error
...
Or, to allow for package transformations:
#+(file-append (this-package-native-input (pkg-config-for-target))
"/bin/" (pkg-config-for-target))
though maybe package transformations should just transform the G-exp as
well, dunno. ('file-append' is not strictly required here.) Maybe we can
have a macro (pkg-config-binary) that expands to that thing, and
use it in other packages?
Possibly interesting or irrelevant: the following will produce an
x86_64-linux-gnu-pkg-config that can be run on a aarch64-linux-gnu
computer to find libraries for x86_64-linux-gnu.
$ guix build -e '(parameterize (((@ (guix utils) %current-target-system) "x86_64-linux-gnu")) (@ (gnu packages pkg-config) pkg-config))' --target=aarch64-linux-gnu
Greetings,
Maxime.
[signature.asc (application/pgp-signature, inline)]
Information forwarded
to
guix-patches <at> gnu.org
:
bug#54595
; Package
guix-patches
.
(Sun, 27 Mar 2022 15:45:02 GMT)
Full text and
rfc822 format available.
Message #38 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Pierre Langlois schreef op zo 27-03-2022 om 15:04 [+0100]:
> #~(modify-phases %standard-phases
> ;; regress tests enabled only for debug builds
> (delete 'check))))
FWIW, given that this is old code, '#:tests #false' + comment would
suffice here and is a bit simpler.
Greetings,
Maxime.
[signature.asc (application/pgp-signature, inline)]
Information forwarded
to
guix-patches <at> gnu.org
:
bug#54595
; Package
guix-patches
.
(Sun, 27 Mar 2022 15:45:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
guix-patches <at> gnu.org
:
bug#54595
; Package
guix-patches
.
(Sun, 27 Mar 2022 17:39:01 GMT)
Full text and
rfc822 format available.
Message #44 received at 54595 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Maxime Devos <maximedevos <at> telenet.be> writes:
> [[PGP Signed Part:Undecided]]
> Pierre Langlois schreef op zo 27-03-2022 om 15:04 [+0100]:
>> I'm also not entirely sure if it's
>> #+pkg-config or #$pkg-config, both seem to work
>
> #+pkg-config, given that it is a thing that needs to be run during
> compilation. I'm wondering, do you have transparant QEMU emulation
> enabled? If so, both seeming to work is expected since QEMU will
> emulate the cross-compiled cross-compiling (IIUC a canadian cross, in
> GCC terminology) pkg-config. If not, I would expect some kind of error
> ...
Ooooh I do have qemu emulation enabled, that must be it, thanks! I'll
need to be careful about that, seems too easy to make a mistake.
>
> Or, to allow for package transformations:
>
> #+(file-append (this-package-native-input (pkg-config-for-target))
> "/bin/" (pkg-config-for-target))
>
> though maybe package transformations should just transform the G-exp as
> well, dunno. ('file-append' is not strictly required here.) Maybe we can
> have a macro (pkg-config-binary) that expands to that thing, and
> use it in other packages?
Yeah, if we have this pattern often it sounds like a good idea.
However, better yet maybe could be to make the cmake build-system handle
it automagically. I see `PKG_CONFIG_EXECUTABLE' is part of cmake itself
so that might be OK?
https://cmake.org/cmake/help/latest/module/FindPkgConfig.html
>
> Possibly interesting or irrelevant: the following will produce an
> x86_64-linux-gnu-pkg-config that can be run on a aarch64-linux-gnu
> computer to find libraries for x86_64-linux-gnu.
>
> $ guix build -e '(parameterize (((@ (guix utils) %current-target-system) "x86_64-linux-gnu")) (@ (gnu packages pkg-config) pkg-config))' --target=aarch64-linux-gnu
Ha! That's pretty cool :-).
Thanks,
Pierre
[signature.asc (application/pgp-signature, inline)]
Information forwarded
to
guix-patches <at> gnu.org
:
bug#54595
; Package
guix-patches
.
(Sun, 27 Mar 2022 18:02:02 GMT)
Full text and
rfc822 format available.
Message #47 received at 54595 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Pierre Langlois schreef op zo 27-03-2022 om 18:27 [+0100]:
> Yeah, if we have this pattern often it sounds like a good idea.
> However, better yet maybe could be to make the cmake build-system
> handle
> it automagically. I see `PKG_CONFIG_EXECUTABLE' is part of cmake
> itself
> so that might be OK?
>
> https://cmake.org/cmake/help/latest/module/FindPkgConfig.html
Seems reasonable to me, though it that probably needs to be on core-
updates due to many impacted packages, so that's more of a long-term
thing.
Greetings,
Maxime.
[signature.asc (application/pgp-signature, inline)]
Information forwarded
to
guix-patches <at> gnu.org
:
bug#54595
; Package
guix-patches
.
(Sun, 27 Mar 2022 22:23:01 GMT)
Full text and
rfc822 format available.
Message #50 received at submit <at> debbugs.gnu.org (full text, mbox):
Maxime Devos <maximedevos <at> telenet.be> writes:
> [[PGP Signed Part:Undecided]]
> Pierre Langlois schreef op zo 27-03-2022 om 18:27 [+0100]:
>> Yeah, if we have this pattern often it sounds like a good idea.
>> However, better yet maybe could be to make the cmake build-system
>> handle
>> it automagically. I see `PKG_CONFIG_EXECUTABLE' is part of cmake
>> itself
>> so that might be OK?
>>
>> https://cmake.org/cmake/help/latest/module/FindPkgConfig.html
>
> Seems reasonable to me, though it that probably needs to be on core-
> updates due to many impacted packages, so that's more of a long-term
> thing.
IMHO the most correct way to fix this problem is in CMake itself. If
it's cross-compiling and there's a $TARGET_PREFIX-pkg-config in path,
then it ought to use it automatically.
I'm not volunteering to champion that solution though. :-)
So of course the next best thing is to make Guix's build system do that
for us.
--
Thanks
Thiago
Information forwarded
to
guix-patches <at> gnu.org
:
bug#54595
; Package
guix-patches
.
(Sun, 27 Mar 2022 22:23:02 GMT)
Full text and
rfc822 format available.
bug closed, send any further explanations to
54595 <at> debbugs.gnu.org and Sébastien Lerique <sl <at> eauchat.org>
Request was from
Ludovic Courtès <ludo <at> gnu.org>
to
control <at> debbugs.gnu.org
.
(Fri, 08 Apr 2022 21:47:01 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sat, 07 May 2022 11:24:08 GMT)
Full text and
rfc822 format available.
This bug report was last modified 3 years and 40 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.