all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Maxime Devos <maximedevos@telenet.be>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 47221@debbugs.gnu.org
Subject: bug#47221: Guile not in native-inputs when it should
Date: Thu, 18 Mar 2021 10:29:59 +0100	[thread overview]
Message-ID: <d62b3877cce0f3a6c16c62a7047ac70e5fc790d6.camel@telenet.be> (raw)
In-Reply-To: <c34c473b38b2c659947d684d357a31a2a3ece480.camel@telenet.be>

[-- Attachment #1: Type: text/plain, Size: 2947 bytes --]

On Wed, 2021-03-17 at 22:58 +0100, Maxime Devos wrote:
> [...]
> Some suspicious things:
> * [...]
> * clipmenu & others use "wrap-script" to define wrapper scripts

>   (in this case "guile" does not have to be in native-inputs).
>   The "wrap-script" procedure from (guix build utils) uses the
>   "which" procedure to determine where guile is located ...
>   but this is incorrect when cross-compiling!

Demonstration (host system: x86-64-linux with a childhurd running, without qemu binfmt),
using the "bats" package (the "bats" package is choosen because it doesn't have many
dependencies and it uses wrap-script).  ("bats" actually uses wrap-script correctly,
so first remove the following line
                                ":" (assoc-ref %build-inputs "guile") "/bin"
from the package definition to simulate a misbehaving package)

./pre-inst-env guix build --system=i586-gnu --target=x86-64-linux bats
--> tcl fails to build with plenty of failing test cases
^ TODO submit a bug report, for now try without tests

./pre-inst-env guix build --system=i586-gnu --target=x86-64-linux bats --without-tests=tcl
^ TODO this hangs the childhurd (something about paging?)

./pre-inst-env guix build --target=aarch64-linux bats
(warning: this takes some time building the cross-compiler)
--> install.sh: line 15: /gnu/store/...-coreutils-8.32/bin/install: cannot execute binary file: Exec format error

After adding "coreutils" to the native-inputs:

./pre-inst-env guix build --target=aarch64-linux bats
(success! --> some /gnu/store/something path $STORE_ITEM)

Let's look at $STORE_ITEM/bin/bats:

(start snip)
#!#f --no-auto-compile
#!#; Guix wrapper
#\-(begin (let ((current (getenv "PATH"))) (setenv "PATH" (if current (string-append "/gnu/store/qrj2w7a8ms7rkyvqhnrv8wrvqnbwv9bm-bash-
5.0.16/bin:/gnu/store/n8awazyldv9hbzb7pjcw76hiifmvrpvd-coreutils-8.32/bin:/gnu/store/3xi5vprn92r0jcb03lk9ykind5pi789j-grep-3.4/bin:/path-
not-set" ":" current) "/gnu/store/qrj2w7a8ms7rkyvqhnrv8wrvqnbwv9bm-bash-5.0.16/bin:/gnu/store/n8awazyldv9hbzb7pjcw76hiifmvrpvd-coreutils-
8.32/bin:/gnu/store/3xi5vprn92r0jcb03lk9ykind5pi789j-grep-3.4/bin:/path-not-set"))))
#\-(let ((cl (command-line))) (apply execl "/gnu/store/qrj2w7a8ms7rkyvqhnrv8wrvqnbwv9bm-bash-5.0.16/bin/bash" (car cl) (cons (car cl)
(append (quote ("")) cl))))
#!/gnu/store/qrj2w7a8ms7rkyvqhnrv8wrvqnbwv9bm-bash-5.0.16/bin/bash

set -e

BATS_READLINK='true'
[...]
(end snip)

I was worried for a moment that the inputs in "inputs" would contribute to
$PATH even when cross-compiling, but this turns out not to be the case.
However, I believe "wrap-script" should raise some kind of exception
instead of trying to use "#f" as interpreter.

--
Btw., "wrap-program" also uses "which" (but for finding the shell),
but fixing that would entail a world-rebuild as "wrap-program" doesn't
have a keyword argument

> Greetings,
> Maxime

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

  parent reply	other threads:[~2021-03-18  9:34 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-09 19:37 [bug#47027] Disarchive package Timothy Sample
2021-03-09 19:39 ` [bug#47027] [PATCH 1/2] gnu: Add guile-quickcheck Timothy Sample
2021-03-09 19:39   ` [bug#47027] [PATCH 2/2] gnu: Add disarchive Timothy Sample
2021-03-10 10:23     ` Leo Prikler
2021-03-11 22:17       ` [bug#47027] Disarchive package Ludovic Courtès
2021-03-11 22:43         ` Tobias Geerinckx-Rice via Guix-patches via
2021-03-12  3:06         ` Timothy Sample
2021-03-12 10:08           ` Leo Prikler
2021-03-12 16:45           ` Ludovic Courtès
2021-03-21 10:29             ` Ludovic Courtès
2021-03-21 11:10               ` Leo Prikler
2021-03-21 14:13                 ` Timothy Sample
2021-03-21 14:59                   ` Maxime Devos
2021-03-21 16:59                   ` Ludovic Courtès
2021-03-23  4:45                     ` bug#47027: " Timothy Sample
2021-03-23 11:01                       ` [bug#47027] " Ludovic Courtès
2021-03-10 10:00   ` [bug#47027] [PATCH 1/2] gnu: Add guile-quickcheck Leo Prikler
2021-03-14 21:12   ` Maxime Devos
2021-03-17 20:52     ` [bug#47027] Disarchive package Ludovic Courtès
2021-03-17 21:58       ` bug#47221: Guile not in native-inputs when it should Maxime Devos
2021-03-18  7:18         ` Maxime Devos
2021-03-18  9:29         ` Maxime Devos [this message]
2021-03-18 14:01         ` Maxime Devos
2021-03-18 19:08           ` Maxime Devos
2021-03-20 21:45         ` bug#47221: [PATCH v2]: Correct some inputs / native-inputs issues with guile Maxime Devos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d62b3877cce0f3a6c16c62a7047ac70e5fc790d6.camel@telenet.be \
    --to=maximedevos@telenet.be \
    --cc=47221@debbugs.gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.