Subject: bug#76110: closed (Re: [bug#76694] [PATCH] packages: Honor system and target system for graft replacements.)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 08 Mar 2025 15:19:04 +0000

Your bug report

#76110: Broken i686 package on x86_64 since commit 28e4018e59

which was filed against the guix package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
76110: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=76110
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: [bug#76694] [PATCH] packages: Honor system and target system for graft replacements.
From: Ludovic Courtès <[email-masked]>
To: David Elsing <[email-masked]>
Cc: [email-masked], [email-masked], Denis 'GNUtoo' Carikli <[email-masked]>
Date: Sat, 08 Mar 2025 16:18:23 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi David,

David Elsing <[email-masked]> skribis:

> * guix/packages.scm (input-graft, input-cross-graft): Wrap graft replacement
> in ‘with-parameters’.
> * tests/packages.scm ("package-grafts, indirect grafts")
> ("package-grafts, indirect grafts, propagated inputs")
> ("package-grafts, same replacement twice")
> ("package-grafts, dependency on several outputs")
> ("replacement also grafted"): Adjust accordingly by comparing the replacement
> after lowering to a derivation.
> ("package-grafts, indirect grafts, #:system argument"): New test.
> ---
> The modified tests are now more expensive, because comparing the
> replacements now needs to be done by comparing the resulting derivations
> due to the wrapping in <parameterized>. This requires building the
> original package.

Applied, thanks for fixing it!  I tweaked the commit log to include a
reference to the bug report and to the reporter.

Ludo’.

Subject: Broken i686 package on x86_64 since commit 28e4018e59
From: Denis 'GNUtoo' Carikli <[email-masked]>
To: [email-masked], Ludovic Courtès <[email-masked]>, David Elsing <[email-masked]>
Date: Fri, 7 Feb 2025 01:15:41 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi,

I run a 32bit version of PostgreSQL that I compile with the package
definition below:
> ;; Copyright (C) 2024 Denis 'GNUtoo' Carikli
> ;; <[email-masked]>
> ;; This file is free software; you can redistribute it and/or modify
> ;; it under the terms of the GNU General Public License as
> ;; published by the Free Software Foundation; either version 3 of the
> ;; License, or (at your option) any later version.
> ;;
> ;; This file is distributed in the hope that it will be useful, but
> ;; WITHOUT ANY WARRANTY; without even the implied warranty of
> ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> ;; GNU General Public License for more details.
> ;;
> ;; You should have received a copy of the GNU General Public License
> ;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
> 
> (define-module (postgresql-i686-linux)
>   #:use-module (gnu packages databases)
>   #:use-module (guix packages)
>   #:use-module (guix utils))
> 
> (define-public postgresql-14-i686-linux
>   (package
>    (inherit postgresql-14)
>    (name "postgresql-14-i686-linux")
>    (arguments
>     (ensure-keyword-arguments
>      (package-arguments postgresql-14)
>      '(#:system "i686-linux")))))
> 
> (list postgresql-14-i686-linux)

Here's why it is broken:
> $ guix build -f postgresql-i686-linux.scm
> [...]
> /gnu/store/[...]-postgresql-14-i686-linux-14.13

> $ file /gnu/store/[...]-postgresql-14-i686-linux-14.13/bin/psql
> /gnu/store/[...]-postgresql-14-i686-linux-14.13/bin/psql:
> ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically
> linked, interpreter
> /gnu/store/[...]-glibc-2.39/lib/ld-linux.so.2,

> $ ls -l /gnu/store/[...]-postgresql-14-i686-linux-14.13/bin/psql
> -r-xr-xr-x 2 root root 674532 Jan  1  1970
> /gnu/store/jb8jdcyf8q4whlczhp76kdgpqs007jz9-postgresql-14-i686-linux-14.13/bin/psql

> $ /gnu/store/[...]-postgresql-14-i686-linux-14.13/bin/psql --help
> bash:
> /gnu/store/jb8jdcyf8q4whlczhp76kdgpqs007jz9-postgresql-14-i686-linux-14.13/bin/psql:
> No such file or directory

Before the commit 28e4018e59d30efb3d52aa950ce2261f11b69b33, the same
command printed the help of the psql program.

So I bisected with the script below (ran manually, not with git bisect
run):

> #!/usr/bin/env bash
> $(guix time-machine \
> --commit=$(git show HEAD --no-patch --pretty="%H") -- \
> build -f \
> ~/work/setup/configs/packages/postgresql-i686-linux.scm )/bin/psql
> --help

And the process gave the commit 28e4018e59d30efb3d52aa950ce2261f11b69b33
("grafts: Allow file-like objects in the ‘replacement’ field of
<graft>.").

However I didn't look into how to repair the behavior above as I'm not
familiar at all with the code that the 28e4018e59 patch touches.

Denis.