From: Olivier Dion via <gwl-devel@gnu.org>
To: Liliana Marie Prikler <liliana.prikler@ist.tugraz.at>, gwl-devel@gnu.org
Subject: Re: GWL 0.5 fails with plain packages
Date: Sun, 31 Jul 2022 17:17:33 -0400 [thread overview]
Message-ID: <87pmhl0yoi.fsf@laura> (raw)
In-Reply-To: <87sfmh1hai.fsf@laura>
This patch should now have all outputs in _GWL_PROFILE. There's still a
problem with the derivation though.
--8<---------------cut here---------------start------------->8---
diff --git a/gwl/packages.scm b/gwl/packages.scm
index 6a598ba..2ad3929 100644
--- a/gwl/packages.scm
+++ b/gwl/packages.scm
@@ -43,10 +43,11 @@
#:export (current-guix
inferior-store
+ add-package-output!
lookup-package
valid-package?
package-name
- package-output
+ package-outputs
bash-minimal
build-time-guix
@@ -86,7 +87,7 @@
(_ (raise (condition
(&gwl-package-error
(package-spec specification))))))))
- (set! (package-output package) output)
+ (add-package-output! package output)
package))
(define (valid-package? val)
@@ -110,7 +111,14 @@ the version. By default, DELIMITER is \"@\"."
((? inferior-package? pkg)
(inferior-package-full-name pkg))))
-(define package-output (make-object-property))
+(define package-outputs (make-object-property))
+
+(define (add-package-output! pkg out)
+ (let ((outs (package-outputs pkg)))
+ (set! (package-outputs pkg)
+ (if outs
+ (cons out outs)
+ (list out)))))
(define bash-minimal
(mlambda ()
diff --git a/gwl/processes.scm b/gwl/processes.scm
index 2452d1f..3616ad2 100644
--- a/gwl/processes.scm
+++ b/gwl/processes.scm
@@ -45,6 +45,7 @@
process-name
process-full-name
process-version
+ process-raw-packages
process-packages
process-raw-inputs
process-inputs
@@ -182,7 +183,7 @@
#:init-keyword #:description
#:init-value "")
(packages
- #:accessor process-packages
+ #:accessor process-raw-packages
#:init-keyword #:packages
#:init-value '()
#:implicit-list? #t
@@ -197,12 +198,21 @@
((and (? string?) spec)
(lookup-package spec))
((and (? valid-package?) pkg)
+ (add-package-output! pkg "out")
+ pkg)
+ (((? valid-package? pkg) (? string? output))
+ (add-package-output! pkg output)
pkg)
(x
(raise
(condition
(&gwl-type-error
- (expected-type (list "<package>" "<inferior-package>" "<string>"))
+ (expected-type
+ (list "<package>"
+ "<inferior-package>"
+ "<string>"
+ "(<package> <string>)"
+ "(inferior-package> <string>)"))
(actual-value x))))))
value)))
(inputs
@@ -622,6 +632,9 @@ the container."
;;; ADDITIONAL FUNCTIONS
;;; ---------------------------------------------------------------------------
+(define (process-packages process)
+ (delete-duplicates (process-raw-packages process)))
+
(define* (process-inputs process #:optional with-tags?)
"Return the plain values of all inputs of PROCESS, without any
keyword tags if WITH-TAGS? is #FALSE or missing."
@@ -688,10 +701,13 @@ PROCESS."
(let* ((name (process-full-name process))
(packages (cons (bash-minimal)
(process-packages process)))
- (manifest (packages->manifest (map
- (lambda (pkg)
- (list pkg (package-output pkg)))
- packages)))
+ (manifest (packages->manifest
+ (append-map
+ (lambda (pkg)
+ (map (lambda (output)
+ (list pkg output))
+ (package-outputs pkg)))
+ packages)))
(profile (profile (content manifest)))
(search-paths (delete-duplicates
(map search-path-specification->sexp
--8<---------------cut here---------------end--------------->8---
--
Olivier Dion
oldiob.dev
next prev parent reply other threads:[~2022-07-31 21:18 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-29 11:45 GWL 0.5 fails with plain packages Liliana Marie Prikler
2022-07-29 15:40 ` Olivier Dion via
2022-07-30 17:03 ` Liliana Marie Prikler
2022-07-30 17:04 ` Liliana Marie Prikler
2022-07-30 18:47 ` Olivier Dion via
2022-07-31 8:16 ` Liliana Marie Prikler
2022-07-31 13:33 ` Olivier Dion via
2022-07-31 14:35 ` Olivier Dion via
2022-07-31 21:17 ` Olivier Dion via [this message]
2022-08-01 7:21 ` Liliana Marie Prikler
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87pmhl0yoi.fsf@laura \
--to=gwl-devel@gnu.org \
--cc=liliana.prikler@ist.tugraz.at \
--cc=olivier.dion@polymtl.ca \
/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 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.