all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Philip McGrath" <philip@philipmcgrath.com>
To: help-guix@gnu.org
Subject: Debugging cross-compilation dependencies
Date: Sat, 23 Jul 2022 07:30:01 -0400	[thread overview]
Message-ID: <9b97fff1-9de9-4e81-bb5d-1dd20a17b6fb@www.fastmail.com> (raw)

Hi Guix,

For the upcoming Racket 8.6 release, I've been trying to get the Chez-Scheme–based implementation working for architectures without native code-generation backends [1] and initial support for cross-compilation. (Full support for cross-compilation will come after there is a `racket-build-system`, since it involved building a cross-compilation plugin for the compiler, and tooling for doing so lives in a different package, but I had a problem during the bootstrapping process with QEMU [2].)

I thought I had things working at least up through `chez-scheme-for-racket`, but, when I later removed the QEMU binfmt_misc package from my (foreign) system, I discovered that a dependency was incorrectly being cross-compiled when it needed to be run on the build machine. Specifically, the problem was with Zuo (a tiny Racket-like language for build scripts, [3] which replaces complex makefiles in 8.6), which was particularly surprising, since it is only ever used in `native-inputs`.

I've put my work in progress at [4]. With that Guix commit, if I run `./pre-inst-env guix build --keep-failed --target=powerpc64le-linux-gnu chez-scheme-for-racket`, the log shows that these flags get passed to Zuo's configure (generated via Autoconf):

```
configure flags: ("CC_FOR_BUILD=gcc" "CONFIG_SHELL=/gnu/store/4y5m9lb8k3qkb1y9m02sw9w9a6hacd16-bash-minimal-5.1.8/bin/bash" "SHELL=/gnu/store/4y5m9lb8k3qkb1y9m02sw9w9a6hacd16-bash-minimal-5.1.8/bin/bash" "--prefix=/gnu/store/ldjkknahc9hl6vzc6mqxa5zga4qd4lmf-zuo-1.0-racket8.5.900-guix1" "--enable-fast-install" "--build=x86_64-unknown-linux-gnu" "--host=powerpc64le-linux-gnu" "--prefix=/gnu/store/ldjkknahc9hl6vzc6mqxa5zga4qd4lmf-zuo-1.0-racket8.5.900-guix1" "CPPFLAGS=-DGUIX_RKTIO_PATCH_BIN_SH=/gnu/store/q9pidl3hg9l0qga88gsgjs8brv82qy0v-bash-minimal-5.1.8/bin/sh")
```

which leads to:

```
starting phase `build'
powerpc64le-linux-gnu-gcc -DGUIX_RKTIO_PATCH_BIN_SH=/gnu/store/q9pidl3hg9l0qga88gsgjs8brv82qy0v-bash-minimal-5.1.8/bin/sh -g -O2 -DZUO_LIB_PATH='"'"../zuo/lib"'"' -o zuo ../zuo/zuo.c  
./zuo . zuos-to-run-and-install
./zuo: ./zuo: cannot execute binary file
make: *** [Makefile:24: zuos-to-run-and-install] Error 126
error: in phase 'build': uncaught exception:
%exception #<&invoke-error program: "make" arguments: ("-j" "12") exit-status: 2 term-signal: #f stop-signal: #f> 
phase `build' failed after 2.2 seconds
command "make" "-j" "12" failed with status 2
note: keeping build directory `/tmp/guix-build-zuo-1.0-racket8.5.900-guix1.drv-4'
builder for `/gnu/store/66n0cf0fyzwbv5j29f12if2ghk69p7vq-zuo-1.0-racket8.5.900-guix1.drv' failed with exit code 1
build of /gnu/store/66n0cf0fyzwbv5j29f12if2ghk69p7vq-zuo-1.0-racket8.5.900-guix1.drv failed
View build log at '/var/log/guix/drvs/66/n0cf0fyzwbv5j29f12if2ghk69p7vq-zuo-1.0-racket8.5.900-guix1.drv.gz'.
cannot build derivation `/gnu/store/4lrhirlyp0h7bb3ihwdknh86pm8yvlgx-chez-scheme-for-racket-9.5.9.2.drv': 1 dependencies couldn't be built
guix build: error: build of `/gnu/store/4lrhirlyp0h7bb3ihwdknh86pm8yvlgx-chez-scheme-for-racket-9.5.9.2.drv' failed
```

(It's an additional issue that cross-compiling Zuo currently fails, but that's unrelated to the fact that we shouldn't be trying to cross-compile Zuo.)

I'm not sure how to debug this. In particular, `guix graph` doesn't seem to support `--target=`.

-Philip

[1]: https://racket.discourse.group/t/chez-for-architectures-without-native-backends/950
[2]: https://racket.discourse.group/t/chez-for-architectures-without-native-backends/950/13
[3]: https://docs.racket-lang.org/zuo/
[4]: https://gitlab.com/philip1/guix-patches/-/commit/e28ff4c0f520a88aa781f847f52b0bbd12948caa


             reply	other threads:[~2022-07-23 11:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-23 11:30 Philip McGrath [this message]
2022-07-29  5:36 ` Debugging cross-compilation dependencies Philip McGrath
2022-08-09 20:16   ` Ludovic Courtès
2022-08-09 20:16   ` Ludovic Courtès

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=9b97fff1-9de9-4e81-bb5d-1dd20a17b6fb@www.fastmail.com \
    --to=philip@philipmcgrath.com \
    --cc=help-guix@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.