Subject: Re: bug#57127: unzip fails to cross-compile

From: Tobias Geerinckx-Rice <[email-masked]>
Date: Thu, 11 Aug 2022 10:12:47 +0000

Hi Andrew,

This is a bug in Guix, not really related to cross-compiling (hence you can stop cross-testing and reporting different architectures, although the effort is appreciated!).

%output is practically deprecated, but is still present in a good number of packages.  Sometimes it happens to work, because a specific build system explicitly kept support for it.  Some build systems don't, making support for it feel unreliable.  It is.  %output is obsolete for new code.

What also happens is that build systems still support it in the well-tested native build path, but not when cross-compiling.  That seems to be the case here.

> Interestingly, it gives the same errors when explicitly building for x86_64 
> on an x86_64 machine, even though I would expect doing so to compile as normal.

You don't define what you mean by 'explicitly building'.

If you mean --target=x86_64-linux-gnu, why would it not fail?  You're cross-compiling.  Guix doesn't silently fall back to a non-cross build when the architectures match, no should it IMO.

The fix should be simple: rewrite unzip to use gexps and hence #$output.  Why didn't I simply do so yet?  Because too many packages depend on unzip to simply do so on master.  There's probably a way around that, but I'll try it when I'm back at a computer.

Kind regards,

T G-R

Sent on the go.  Excuse or enjoy my brevity.