GNU bug report logs - #43679
[PATCH 0/5] Add '--with-toolchain' package transformation option

Previous Next

Package: guix-patches;

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

Date: Mon, 28 Sep 2020 19:54:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludovic.courtes <at> inria.fr>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Ludovic Courtès <ludo <at> gnu.org>
Subject: bug#43679: closed (Re: [bug#43679] [PATCH v2 0/5] Add
 '--with-c-toolchain')
Date: Mon, 12 Oct 2020 16:29:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#43679: [PATCH 0/5] Add '--with-toolchain' package transformation option

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

The explanation is attached below, along with your original report.
If you require more details, please reply to 43679 <at> debbugs.gnu.org.

-- 
43679: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=43679
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Ludovic Courtès <ludovic.courtes <at> inria.fr>
To: 43679-done <at> debbugs.gnu.org
Subject: Re: [bug#43679] [PATCH v2 0/5] Add '--with-c-toolchain'
Date: Mon, 12 Oct 2020 18:27:55 +0200
Hi!

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

> This is v2 of this patch, with these changes:
>
>   1. ‘with-toolchain’ is replaced by ‘with-c-toolchain’ everywhere,
>      with the understanding that it’s about the C/C++ toolchain
>      in practice.  In the end I’m sympathetic with the argument
>      that C/C++ don’t have a monopoly on toolchains.  ;-)
>
>   2. ‘--with-c-toolchain=PACKAGE=TOOLCHAIN’ rebuilds not just
>      PACKAGE with TOOLCHAIN, but also everything above PACKAGE
>      with TOOLCHAIN (in v1, only PACKAGE was rebuilt with TOOLCHAIN
>      but everything above it had to be rebuilt anyway.)
>
>      The main motivation here is to reduce the changes that we’re
>      introducing ABI incompatibilities that users would have to work
>      around by passing on ‘--with-c-toolchain’ for each package in
>      the chain.  I think it also more closely matches user
>      expectations: when you see things are being rebuilt, you’re
>      likely to think that’s because they’re rebuilt with the new
>      toolchain, not the default one.
>
> Feedback welcome!
>
> Ludo’.
>
> Ludovic Courtès (5):
>   gnu: gcc-toolchain: Add 'GUIX_LOCPATH' to the search paths.
>   gnu: clang-toolchain: Add 'GUIX_LOCPATH' to the search paths.
>   gnu: clang-toolchain: Create 'cc' and 'c++' symlinks.
>   packages: Add 'package-with-c-toolchain'.
>   guix build: Add '--with-c-toolchain'.

Pushed as a2ed00f79fd5bf69c6cca3fa7bdc62726bf848fa!

Ludo’.

[Message part 3 (message/rfc822, inline)]
From: Ludovic Courtès <ludo <at> gnu.org>
To: guix-patches <at> gnu.org
Cc: Ludovic Courtès <ludovic.courtes <at> inria.fr>
Subject: [PATCH 0/5] Add '--with-toolchain' package transformation option
Date: Mon, 28 Sep 2020 21:53:05 +0200
From: Ludovic Courtès <ludovic.courtes <at> inria.fr>

Hello!

This patch series adds the ‘--with-toolchain’ option.  I’ve
tested it with gcc-toolchain <at> 10 and clang-toolchain, and I can say
it works as advertised.  :-)

One thing I wasn’t entirely sure about: ‘--with-toolchain’ changes
the toolchain of the specified package, not that of its dependents.
This assumes that the toolchains all follow the same ABI.  This is
the case for C, apparently, maybe not for C++.  Should it instead
change to toolchain of the package’s dependents as well?

Something like:

  guix build guile --with-toolchain=guile <at> 3.0.4=clang-toolchain 

generates working code.

Another issue is that since we use ‘package-input-rewriting/spec’,
we can’t change the toolchain of core packages like Guile or Perl
without rebuilding the world.  For example, if we omit “@3.0.4”
in the example above, we rebuild a “guile” package deep down and
everything that follows (aka. “the world”).

Another option I considered was to graft the package that
‘--with-toolchain’ targets instead of rebuilding its dependents.
Again that’d only work if the resulting binaries are ABI-compatible,
but maybe that’s a reasonable assumption.  It would definitely save
build time.  Should it be grafted, or should there be a separate
option to do that?  Thoughts?

Last, when doing ‘--with-toolchain=foo=gcc-toolchain’, I noticed
that ‘foo’ would keep a reference to ‘gcc-toolchain’ for some obscure
reasons:

--8<---------------cut here---------------start------------->8---
$ ./pre-inst-env guix build hello --with-toolchain=hello=gcc-toolchain
/gnu/store/qi7pqqsxhbwmy75hl43j7l0aw1xr7r42-hello-2.10
$ grep -r $(guix build gcc-toolchain | head -2 |tail -1) /gnu/store/qi7pqqsxhbwmy75hl43j7l0aw1xr7r42-hello-2.10
Duuma dosiero /gnu/store/qi7pqqsxhbwmy75hl43j7l0aw1xr7r42-hello-2.10/bin/hello kongruas
$ strings /gnu/store/qi7pqqsxhbwmy75hl43j7l0aw1xr7r42-hello-2.10/bin/hello | grep $(guix build gcc-toolchain | head -2 |tail -1)
/gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31/lib:/gnu/store/qj38f3vi4q1d7z30hkpaxyajv49rwamb-gcc-10.2.0-lib/lib:/gnu/store/qj38f3vi4q1d7z30hkpaxyajv49rwamb-gcc-10.2.0-lib/lib/gcc/x86_64-unknown-linux-gnu/10.2.0/../../..:/gnu/store/pknm43xsza6nlc7bn27djip8fis92akd-gcc-toolchain-10.2.0/lib
--8<---------------cut here---------------end--------------->8---

Not a showstopper but would be nice to address.

Feedback welcome!

Ludo’.

Ludovic Courtès (5):
  gnu: gcc-toolchain: Add 'GUIX_LOCPATH' to the search paths.
  gnu: clang-toolchain: Add 'GUIX_LOCPATH' to the search paths.
  gnu: clang-toolchain: Create 'cc' and 'c++' symlinks.
  packages: Add 'package-with-toolchain'.
  guix build: Add '--with-toolchain'.

 doc/guix.texi                 | 61 +++++++++++++++++++++++++++++++++++
 gnu/packages/commencement.scm |  8 +++--
 gnu/packages/llvm.scm         | 12 ++++++-
 guix/build-system.scm         | 35 ++++++++++++++++++--
 guix/packages.scm             |  9 ++++++
 guix/scripts/build.scm        | 40 +++++++++++++++++++++++
 tests/packages.scm            | 20 ++++++++++++
 tests/scripts-build.scm       | 30 +++++++++++++++++
 8 files changed, 210 insertions(+), 5 deletions(-)

-- 
2.28.0




This bug report was last modified 4 years and 224 days ago.

Previous Next


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