all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#43679] [PATCH 0/5] Add '--with-toolchain' package transformation option
@ 2020-09-28 19:53 Ludovic Courtès
  2020-09-28 19:56 ` [bug#43679] [PATCH 1/5] gnu: gcc-toolchain: Add 'GUIX_LOCPATH' to the search paths Ludovic Courtès
  2020-09-29 10:44 ` [bug#43679] [PATCH 0/5] Add '--with-toolchain' package transformation option zimoun
  0 siblings, 2 replies; 21+ messages in thread
From: Ludovic Courtès @ 2020-09-28 19:53 UTC (permalink / raw)
  To: 43679; +Cc: Ludovic Courtès

From: Ludovic Courtès <ludovic.courtes@inria.fr>

Hello!

This patch series adds the ‘--with-toolchain’ option.  I’ve
tested it with gcc-toolchain@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@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





^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2020-10-12 16:29 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-28 19:53 [bug#43679] [PATCH 0/5] Add '--with-toolchain' package transformation option Ludovic Courtès
2020-09-28 19:56 ` [bug#43679] [PATCH 1/5] gnu: gcc-toolchain: Add 'GUIX_LOCPATH' to the search paths Ludovic Courtès
2020-09-28 19:56   ` [bug#43679] [PATCH 2/5] gnu: clang-toolchain: " Ludovic Courtès
2020-09-28 19:56   ` [bug#43679] [PATCH 3/5] gnu: clang-toolchain: Create 'cc' and 'c++' symlinks Ludovic Courtès
2020-09-29  5:42     ` Efraim Flashner
2020-09-29  7:53       ` Ludovic Courtès
2020-10-05 12:14         ` Efraim Flashner
2020-10-08  7:04           ` Ludovic Courtès
2020-09-28 19:56   ` [bug#43679] [PATCH 4/5] packages: Add 'package-with-toolchain' Ludovic Courtès
2020-09-28 19:56   ` [bug#43679] [PATCH 5/5] guix build: Add '--with-toolchain' Ludovic Courtès
2020-09-29 10:44 ` [bug#43679] [PATCH 0/5] Add '--with-toolchain' package transformation option zimoun
2020-09-30  8:46   ` Ludovic Courtès
2020-09-30 13:32     ` zimoun
2020-09-30 16:58       ` Ludovic Courtès
2020-10-09  9:12         ` [bug#43679] [PATCH v2 0/5] Add '--with-c-toolchain' Ludovic Courtès
2020-10-09  9:12           ` [bug#43679] [PATCH v2 1/5] gnu: gcc-toolchain: Add 'GUIX_LOCPATH' to the search paths Ludovic Courtès
2020-10-09  9:12           ` [bug#43679] [PATCH v2 2/5] gnu: clang-toolchain: " Ludovic Courtès
2020-10-09  9:12           ` [bug#43679] [PATCH v2 3/5] gnu: clang-toolchain: Create 'cc' and 'c++' symlinks Ludovic Courtès
2020-10-09  9:12           ` [bug#43679] [PATCH v2 4/5] packages: Add 'package-with-c-toolchain' Ludovic Courtès
2020-10-09  9:12           ` [bug#43679] [PATCH v2 5/5] guix build: Add '--with-c-toolchain' Ludovic Courtès
2020-10-12 16:27           ` bug#43679: [PATCH v2 0/5] " Ludovic Courtès

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.