From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Marusich Subject: bug#31221: Cross compiling perl with guix pack fails Date: Sat, 21 Apr 2018 14:23:18 -0700 Message-ID: <8736zouud5.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44702) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9zzL-0006xM-5D for bug-guix@gnu.org; Sat, 21 Apr 2018 17:24:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9zzG-0005rf-3m for bug-guix@gnu.org; Sat, 21 Apr 2018 17:24:07 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:55549) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f9zzF-0005rB-Uk for bug-guix@gnu.org; Sat, 21 Apr 2018 17:24:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1f9zzF-0002P0-LP for bug-guix@gnu.org; Sat, 21 Apr 2018 17:24:01 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: ("=?UTF-8?Q?Rapha=C3=ABl_?= =?UTF-8?Q?M=C3=A9lotte?="'s message of "Thu, 19 Apr 2018 22:58:49 +0200") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: =?UTF-8?Q?Rapha=C3=ABl_?= =?UTF-8?Q?M=C3=A9lotte?= Cc: 31221@debbugs.gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Rapha=C3=ABl, Thank you for the information! Rapha=C3=ABl M=C3=A9lotte writes: > starting phase `remove-extra-references' > ... > In unknown file: > 1 (string-append "incpth=3D'" #f "/include'\n") > ... > In procedure string-append: Wrong type (expecting string): #f The Perl package definition contains the following: (add-after 'install 'remove-extra-references (lambda* (#:key inputs outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) (libc (assoc-ref inputs "libc")) (config1 (car (find-files (string-append out "/lib/perl5") "^Config_heavy\\.pl$"))) (config2 (find-files (string-append out "/lib/perl5") "^Config\\.pm$"))) ;; Force the library search path to contain only libc because ;; it is recorded in Config.pm and Config_heavy.pl; we don't ;; want to keep a reference to everything that's in ;; $LIBRARY_PATH at build time (GCC, Binutils, bzip2, file, ;; etc.) (substitute* config1 (("^incpth=3D.*$") (string-append "incpth=3D'" libc "/include'\n")) (("^(libpth|plibpth|libspath)=3D.*$" _ variable) (string-append variable "=3D'" libc "/lib'\n"))) (for-each (lambda (file) (substitute* config2 (("libpth =3D> .*$") (string-append "libpth =3D> '" libc "/lib',\n")))) config2) #t))) It seems likely that (assoc-ref inputs "libc") is evaluating to #f during the build. You can check if this is the case by using Guile's undocumented "pk" procedure ("pk" is short for "peek stuff"). For example, change this line (libc (assoc-ref inputs "libc")) to this: (libc (pk (assoc-ref inputs "libc"))) Assuming that's the problem, the next question is: why is it happening? Probably, something about the cross-compilation is causing "libc" to be removed from the inputs. After looking around in places like guix/packages.scm, guix/build-system/gnu.scm, and guix/build/gnu-build-system.scm, it looks like maybe what we need to do is check to see if we're cross-compiling, and then try to get "cross-libc" instead of "libc" from the inputs. It turns out that we already do this for some packages, like the shadow package. We probably just need to do the same kind of thing shadow is doing in its "set-nscd-file-name" phase, which looks like this: (add-before 'build 'set-nscd-file-name (lambda* (#:key inputs #:allow-other-keys) ;; Use the right file name for nscd. (let ((libc (assoc-ref inputs ,(if (%current-target-system) "cross-libc" "libc")))) (substitute* "lib/nscd.c" (("/usr/sbin/nscd") (string-append libc "/sbin/nscd")))))) I would make a patch and test this myself for Perl, but I recently ran Guix pull, so it's taking me hours to build anything. I'll have to get back to you later with a fix because of that delay. Please feel free to try making the change yourself in the meantime! =2D-=20 Chris --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEy/WXVcvn5+/vGD+x3UCaFdgiRp0FAlrbq8YACgkQ3UCaFdgi Rp0v7RAAi2E8l8h+D+JLvI9LRDQGa5zllfyNwtBQMa1ts5v6n15jNRo3VkNL6giG DeKt8UDQ3TYN/qfBG71MfMoxSkSUsNRqWc7T+KrpvW6TEOG9m5q5jFegEgkYwC6k QCxjktI2QEpsfXMa4JLKzN5aZfL7NZqCOI1RCK12hEP8q67jCZ9ce5c45hcHiW3s HFqViIuZj7UvUFn7ixgfuLd6pxXKOMuquP3nP4VK034amNKSM56w04uFeoeP74T7 fRqDtLHbMmE/5MRIjFF15rod6005IkjVy1dZGgmvTKWNNxWOkYOTuqZO4JM4j5oA 0Ru2I3RNojFLlhKeVV//uE1DMP1/vjUrV24WF6/xu15th6mHLfq2H681Mj8YQ6mX kfLMJd+3wJfughKTl+TPmfkYRQcavwJVJUUBP+yqXQiQ3mpsSz8/KjpOPjCZDHK8 0v6F6ConFSE2Ja6cXD14xJppgvbjuu59v3JiS5356qI+6PNkrzJb9E8c3aHC1pU6 fTYBZtly2umeaGX+yxh1qexs+PTTKds/utgCNJRlwyy2TG57XOh+lguKqzO9ARYB sVuedUJi5Gc/4AbGBf/CKxDqc/e+rBt1MktYK0qRxk9nd622oWIfrUIxl6cqfDIi gfUAos2PftnZ8KJHzEnWaH89c5N73b3eBqZWvPY9F881pbS/a6s= =0/6h -----END PGP SIGNATURE----- --=-=-=--