GNU bug report logs - #54052
[PATCH] gnu: cgdb: Add gdb to propagated-inputs

Previous Next

Package: guix-patches;

Reported by: Chadwain Holness <chadwainholness <at> gmail.com>

Date: Fri, 18 Feb 2022 05:20:01 UTC

Severity: normal

Tags: moreinfo, patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #14 received at 54052 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: Chadwain Holness <chadwainholness <at> gmail.com>, 54052 <at> debbugs.gnu.org
Subject: Re: [bug#54052] [PATCH] gnu: cgdb: Add gdb to propagated-inputs
Date: Sun, 20 Feb 2022 11:30:52 +0100
[Message part 1 (text/plain, inline)]
Chadwain Holness schreef op zo 20-02-2022 om 03:11 [-0500]:
> Hello Maxime, thank you for the suggestion. Is this new patch better in your opinion?

It does look quite a bit better, but there's a cross-compilation
problem now: when cross-compiling, 'which' looks in the 'native-inputs'
instead of the 'inputs' (native-inputs = compiled for the architecture
the build is performed on, inputs = compiled for the architecture
'cgdb' will be run on).  You can use 'search-input-file' to solve this:

    (arguments
      (list
         #:phases
         #~(modify-phases %standard-phases
             (add-after 'unpack 'fix-paths
               (lambda* (#:key inputs #:allow-other-keys)
                 (define gdb (search-input-file inputs "bin/gdb"))
                 (define sh (search-input-file inputs "bin/sh"))
                 (substitute* "lib/util/fork_util.cpp"
                   (("GDB = \"gdb\"") (string-append "GDB = \"" gdb))
                   (("/bin/sh") sh)))))))

>      (inputs
> -     (list ncurses readline))
> +     (list ncurses readline gdb))

You are using a 'sh' from 'inputs' in 'fix-paths', so the package
'bash-minimal' needs to be included, otherwise the build would fail
when cross-compiling.

('bash-minimal' is an (implicit) native-input, so the build failure
would not happen when compiling natively).

To test whether cross-compiling cgdb works, you can try

  ./pre-inst-env guix build cgdb --target=aarch64-linux-gnu

(warning: this might build a cross-compiler toolchain first, which can
take quite some time, and possibly 'gdb' is not cross-compilable!)

Greetings,
Maxime.

[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 3 years and 138 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.