GNU bug report logs - #41796
Grafts don't handle outputs other than out

Previous Next

Package: guix;

Reported by: Jakub Kądziołka <kuba <at> kadziolka.net>

Date: Wed, 10 Jun 2020 22:33:01 UTC

Severity: important

Tags: security

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

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jakub Kądziołka <kuba <at> kadziolka.net>
To: bug-guix <at> gnu.org
Subject: Grafts don't handle outputs other than out
Date: Thu, 11 Jun 2020 00:32:20 +0200
[Message part 1 (text/plain, inline)]
$ cat test.scm
(use-modules
  (guix packages)
  (guix build-system trivial))

(define-public core-pkg
  (package
    (name "core-pkg")
    (version "1.0")
    (replacement core-pkg/fixed)
    (source #f)
    (outputs '("out" "lib"))
    (build-system trivial-build-system)
    (arguments
     `(#:modules ((guix build utils))
       #:builder
       (begin
         (use-modules (guix build utils))
         (let ((outdir (assoc-ref %outputs "out"))
               (libdir (assoc-ref %outputs "lib")))
           (mkdir-p outdir)
           (mkdir-p libdir)
           #t))))
    (synopsis #f)
    (description #f)
    (home-page #f)
    (license #f)))

(define-public core-pkg/fixed
  (package
    (inherit core-pkg)
    (version "1.1")))

(package
  (name "other-pkg")
  (version "4.2")
  (source #f)
  (build-system trivial-build-system)
  (inputs
  `(("core-pkg" ,core-pkg)
    ("core-pkg:lib" ,core-pkg "lib")))
  (arguments
  `(#:modules ((guix build utils))
    #:builder
    (begin
      (use-modules (guix build utils))
      (let ((outdir (assoc-ref %outputs "out")))
        (mkdir-p outdir)
        (with-output-to-file (string-append outdir "/hello")
          (lambda ()
            (display (assoc-ref %build-inputs "core-pkg"))
            (newline)
            (display (assoc-ref %build-inputs "core-pkg:lib"))
            (newline)))
        #t))))
  (synopsis #f)
  (description #f)
  (home-page #f)
  (license #f))
~$ cat `guix build --no-offload -f test.scm`/hello
/gnu/store/pmz07rzm63z02lkyyldsw3srf98h01y2-core-pkg-1.1
/gnu/store/pivsji8qfpln4i4v0f5v5cjmzakmcmvg-core-pkg-1.0-lib

Expected output: the second line contains -core-pkg-1.1-lib.

Regards,
Jakub Kądziołka
[signature.asc (application/pgp-signature, inline)]

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

Previous Next


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