Subject: Re: bug#37403: Cannot 'guix guix build --target=x86_64-w64-mingw32 perl'

From: Danny Milosavljevic <[email-masked]>
Date: Sat, 14 Sep 2019 14:23:38 +0200

Further information:

According to gnu/packages/cross-base.scm, cross-gcc contains either "libc" or
"mingw-source" in the mingw case--I don't know why, but that's what it says.

The purpose of "remove-extra-references" seems to be to shrink the
number of recorded dependencies, so maybe compare it with the unshrinked
list of dependencies by printing the latter out (apparently it should be
inside Config_heavy.pl and Config.pm in the temporary build
directory--could you post those?).

I tried it myself (with mingw target) and I got:

loclibpth='/gnu/store/h90vnqw0nwd0hhm1l5dgxsdrigddfmq4-glibc-2.28/lib'

Hmm.

Also, perl seems to fetch libc from the %build-inputs just fine earlier.

So try putting (assoc-ref native-inputs "libc") instead of
(assoc-ref inputs "libc") in the perl package definition (make sure to
accept native-inputs in the function in the first place) in order to debug
the problem (or maybe (assoc-ref inputs "mingw-source")).

When cross compiling it's important to get right which parts you get
from the host libs and which from the target libs, maybe that's messed
up there.

Also possible would be not to do that shrinking if libc is unavailable,
but not sure whether we want that.