From: Mark H Weaver <mhw@netris.org>
To: John Doe <dftxbs3e@free.fr>,
Chris Marusich <cmmarusich@gmail.com>,
Efraim Flashner <efraim@flashner.co.il>
Cc: guix-devel@gnu.org, 45252@debbugs.gnu.org
Subject: Re: [PATCH] gnu: libffi: Add unreleased patch to fix float128 on powerpc64le.
Date: Tue, 22 Dec 2020 01:00:44 -0500 [thread overview]
Message-ID: <87tuseidlk.fsf@netris.org> (raw)
In-Reply-To: <87y2hqifp3.fsf@netris.org>
Earlier, I wrote:
> When invoking 'patch' in Guix, you should *always* use "--force" instead
> of "--batch".
(See <https://bugs.gnu.org/45252#19> for my earlier message).
Since writing the message above, I've found another problem in the same
commit (7eaa2f24ea77cddbb4bbc2d6a6905673a36f8f99): it searches for the
'patch' program in 'inputs'. This is a mistake, because when
cross-compiling, 'inputs' will contain software compiled to run on the
target system instead of the build system.
If 'native-inputs' is not #f, we should search for the 'patch' program
in 'native-inputs' instead of 'inputs'. Unless there's now a better way
that I don't know, I suggest adding 'native-inputs' to the list of
keyword arguments accepted by the 'lambda*', and changing 'inputs' to
"(or native-inputs inputs)" in the call to 'assoc-ref'. Something like
this (untested):
_ ,@(if (string-prefix? "powerpc64le-" (or (%current-target-system)
__________________________________________ (%current-system)))
_______ '(#:phases (modify-phases %standard-phases
____________________ (add-after 'unpack 'apply-patch2
______________________ (lambda* (#:key inputs native-inputs
________________________________ #:allow-other-keys)
________________________ (let ((patch (assoc-ref (or native-inputs inputs)
________________________________________________ "powerpc64le-patch")))
__________________________ (invoke "patch" "--force" "-p1"
__________________________________ "-i" patch))))))
_______ '())
I see now that both of these mistakes were already present in the
"powerpc-*" case immediately above the recently-added "powerpc64le-*"
case. The "powerpc-*" case was added earlier this year in the following
commit:
https://git.sv.gnu.org/cgit/guix.git/commit/?id=02f5ee01c96589fc13f1e21b85b0b48100aec4e8
I'm CC'ing 'guix-devel' to raise awareness about these common mistakes,
in the hopes that reviewers will be more likely to notice them in the
future.
Thanks,
Mark
next prev parent reply other threads:[~2020-12-22 6:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-22 5:15 [PATCH] gnu: libffi: Add unreleased patch to fix float128 on powerpc64le Mark H Weaver
2020-12-22 6:00 ` Mark H Weaver [this message]
2020-12-23 6:38 ` [bug#45252] " Chris Marusich
2020-12-23 7:50 ` Efraim Flashner
2020-12-23 21:34 ` Mark H Weaver
2020-12-28 4:17 ` [bug#45252] [PATCH] gnu: libffi: Add unreleased patch to fix float128 on powerpc64le., [bug#45252] [PATCH] gnu: libffi: Add unreleased patch to fix float128 on powerpc64le., [bug#45252] " Chris Marusich
2020-12-23 21:22 ` Mark H Weaver
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
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87tuseidlk.fsf@netris.org \
--to=mhw@netris.org \
--cc=45252@debbugs.gnu.org \
--cc=cmmarusich@gmail.com \
--cc=dftxbs3e@free.fr \
--cc=efraim@flashner.co.il \
--cc=guix-devel@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 public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).