Having failed a year ago to build the latest gcc and latest clang together using "with-c-toolchain", the following succeeds using "package-input-rewriting/spec".
My current issue is that glibc@2.33 on master fails to build with gcc@12 ("cc1: all warnings being treated as errors") and my attempts to pull a glibc@2.35 inferior from core-updates are failing. On core-updates I can containerize and use gcc-toolchain@12 and clang-toolchain@15 with the following manifest. Both gcc and clang successfully compile a test file. --8<---------------cut here---------------start------------->8--- $ cat core-updates.scm (use-modules (guix packages) (gnu packages gcc) (gnu packages llvm)) (define with-gcc12 (package-input-rewriting/spec `(("gcc" . ,(const gcc-12))))) (define clang-with-gcc-12 (with-gcc12 clang-toolchain-15)) (concatenate-manifests (list (specifications->manifest '("gcc-toolchain@12")) (packages->manifest `(,clang-with-gcc-12)))) --8<---------------cut here---------------end--------------->8--- On master I modify the manifest to create an inferior for glibc@2.35 from core-updates, but receive the following error when attempting to use the inferior as a package. A similar question went unanswered on StackOverflow last year (https://unix.stackexchange.com/questions/699148/how-to-use-an-inferior-when-input-rewriting-in-guix). --8<---------------cut here---------------start------------->8--- $ cat master.scm (use-modules (guix channels) (guix inferior) (guix packages) (gnu packages gcc) (gnu packages llvm)) (define channels (list (channel (name 'guix) (url "https://git.savannah.gnu.org/git/guix.git") (branch "core-updates") (commit "3b57f25f55c52c97428106de285d3cf2746554dc")))) (define (from-core-updates name) (car (lookup-inferior-packages (inferior-for-channels channels) name))) (define glibc-from-core-updates (from-core-updates "glibc")) (define with-gcc12 (package-input-rewriting/spec `(("gcc" . ,(const gcc-12)) ("glibc" . ,(const glibc-from-core-updates))))) (define clang-with-gcc-12 (with-gcc12 clang-toolchain-15)) (concatenate-manifests (list (specifications->manifest '("gcc-toolchain@12")) (packages->manifest `(,clang-with-gcc-12)))) $ guix build -m master.scm Backtrace: In guix/scripts/build.scm: 670:16 19 (_ #<package clang-toolchain@15.0.7 gnu/packages/llvm.s…>) 659:24 18 (_ #<package clang-toolchain@15.0.7 gnu/packages/llvm.…> …) In guix/packages.scm: 1351:17 17 (supported-package? #<package clang-toolchain@15.0.7 g…> …) In guix/memoization.scm: 101:0 16 (_ #<hash-table 7f5d81ec88a0 125/223> #<package clang-…> …) In guix/packages.scm: 1329:37 15 (_) 1589:16 14 (package->bag _ _ _ #:graft? _) 1690:48 13 (thunk) 1485:25 12 (inputs _) In srfi/srfi-1.scm: 586:29 11 (map1 (("clang" #<package clang@15.0.7 gnu/package…>) …)) 586:29 10 (map1 (("ld-wrapper" #<package ld-wrapper@0 gnu/pa…>) …)) 586:29 9 (map1 (("binutils" #<package binutils@2.37 gnu/pac…>) …)) 586:29 8 (map1 (("libomp" #<package libomp@15.0.7 gnu/packa…>) …)) 586:17 7 (map1 (("libc" #<package glibc@2.33 gnu/packages/b…>) …)) In guix/packages.scm: 1442:20 6 (rewrite ("libc" #<package glibc@2.33 gnu/packages/ba…>)) In guix/memoization.scm: 101:0 5 (_ #<hash-table 7f5d937a6780 5/31> #<package glibc@2.3…> …) In guix/packages.scm: 1459:22 4 (_) 1570:31 3 (loop #<inferior-package glibc@2.35 7f5d88e873c0>) In ice-9/boot-9.scm: 1685:16 2 (raise-exception _ #:continuable? _) 1685:16 1 (raise-exception _ #:continuable? _) 1685:16 0 (raise-exception _ #:continuable? _) ice-9/boot-9.scm:1685:16: In procedure raise-exception: In procedure package-properties: Wrong type argument: #<inferior-package glibc@2.35 7f5d88e873c0> --8<---------------cut here---------------end--------------->8---