From e6301fb76d0a8d931ece2e18d197e3c2cc53fc6c Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 26 Mar 2019 10:22:15 +0100 Subject: packages: Adjust to new calling convention for "thunked" fields. Fixes . This is a followup to abd4d6b33dba4de228e90ad15a8efb456fcf7b6e. * guix/packages.scm (package->bag): Adjust calls to INPUTS, PROPAGATED-INPUTS, NATIVE-INPUTS, and ARGS, passing them SELF as an argument. * gnu/packages/gnucash.scm (gnucash)[arguments]: Use (package-inputs this-record) intead of (inputs). * gnu/packages/version-control.scm (git)[arguments]: Likewise. --- guix/packages.scm | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'guix/packages.scm') diff --git a/guix/packages.scm b/guix/packages.scm index d20a2562c3..9d83de3d48 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -1025,9 +1025,10 @@ and return it." (match (if graft? (or (package-replacement package) package) package) - (($ name version source build-system - args inputs propagated-inputs native-inputs - self-native-input? outputs) + ((and self + ($ name version source build-system + args inputs propagated-inputs native-inputs + self-native-input? outputs)) ;; Even though we prefer to use "@" to separate the package ;; name from the package version in various user-facing parts ;; of Guix, checkStoreName (in nix/libstore/store-api.cc) @@ -1036,15 +1037,15 @@ and return it." #:system system #:target target #:source source - #:inputs (append (inputs) - (propagated-inputs)) + #:inputs (append (inputs self) + (propagated-inputs self)) #:outputs outputs #:native-inputs `(,@(if (and target self-native-input?) - `(("self" ,package)) + `(("self" ,self)) '()) - ,@(native-inputs)) - #:arguments (args)) + ,@(native-inputs self)) + #:arguments (args self)) (raise (if target (condition (&package-cross-build-system-error -- cgit v1.2.3 From adb6462c4ce51fcdc94d3608ad6efb4adf716018 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 29 Mar 2019 22:49:00 +0100 Subject: packages: Define 'this-package' and 'this-origin'. * guix/packages.scm (): Choose 'this-origin' as the 'this' identifier. (): Choose 'this-package'. * gnu/packages/gnucash.scm (gnucash)[arguments]: Use 'this-package' instead of 'this-record'. * gnu/packages/version-control.scm (git)[arguments]: Likewise. --- gnu/packages/gnucash.scm | 5 ++--- gnu/packages/version-control.scm | 5 ++--- guix/packages.scm | 4 ++++ 3 files changed, 8 insertions(+), 6 deletions(-) (limited to 'guix/packages.scm') diff --git a/gnu/packages/gnucash.scm b/gnu/packages/gnucash.scm index 342df650aa..5b4da97e5d 100644 --- a/gnu/packages/gnucash.scm +++ b/gnu/packages/gnucash.scm @@ -27,7 +27,6 @@ #:use-module (guix download) #:use-module (guix build-system gnu) #:use-module (guix build-system cmake) - #:use-module ((guix records) #:select (this-record)) #:use-module (gnu packages) #:use-module (gnu packages autotools) #:use-module (gnu packages base) @@ -165,14 +164,14 @@ ,@(transitive-input-references 'inputs (map (lambda (l) - (assoc l (package-inputs this-record))) + (assoc l (package-inputs this-package))) '("perl-finance-quote" "perl-date-manip")))) (list ,@(transitive-input-references 'inputs (map (lambda (l) - (assoc l (package-inputs this-record))) + (assoc l (package-inputs this-package))) '("perl-finance-quote"))))))))) '("gnucash" "gnc-fq-check" diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm index fe9b64ba5c..667b2881b1 100644 --- a/gnu/packages/version-control.scm +++ b/gnu/packages/version-control.scm @@ -51,7 +51,6 @@ #:use-module (guix build-system haskell) #:use-module (guix build-system python) #:use-module (guix build-system trivial) - #:use-module ((guix records) #:select (this-record)) #:use-module (gnu packages apr) #:use-module (gnu packages autotools) #:use-module (gnu packages documentation) @@ -409,7 +408,7 @@ as well as the classic centralized workflow.") ,@(transitive-input-references 'inputs (map (lambda (l) - (assoc l (package-inputs this-record))) + (assoc l (package-inputs this-package))) '("perl-authen-sasl" "perl-net-smtp-ssl" "perl-io-socket-ssl"))))))) @@ -422,7 +421,7 @@ as well as the classic centralized workflow.") ,@(transitive-input-references 'inputs (map (lambda (l) - (assoc l (package-inputs this-record))) + (assoc l (package-inputs this-package))) '("perl-cgi"))))))) ;; Tell 'git-submodule' where Perl is. diff --git a/guix/packages.scm b/guix/packages.scm index 9d83de3d48..b402637508 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -48,6 +48,7 @@ search-path-specification) ;for convenience #:export (origin origin? + this-origin origin-uri origin-method origin-sha256 @@ -63,6 +64,7 @@ package package? + this-package package-name package-upstream-name package-version @@ -156,6 +158,7 @@ (define-record-type* origin make-origin origin? + this-origin (uri origin-uri) ; string (method origin-method) ; procedure (sha256 origin-sha256) ; bytevector @@ -247,6 +250,7 @@ name of its URI." (define-record-type* package make-package package? + this-package (name package-name) ; string (version package-version) ; string (source package-source) ; instance -- cgit v1.2.3 From a7646bc5e17a829d23519d0b199a576fb1edbd04 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 30 Mar 2019 14:59:26 +0100 Subject: packages: Remove 'self-native-input?' field. This field has become unnecessary with the addition of 'this-package'. * guix/packages.scm ()[self-native-input?]: Remove. (package->bag): Adjust accordingly. * doc/guix.texi (package Reference): Remove 'self-native-input?'. --- doc/guix.texi | 4 ---- guix/packages.scm | 11 ++--------- 2 files changed, 2 insertions(+), 13 deletions(-) (limited to 'guix/packages.scm') diff --git a/doc/guix.texi b/doc/guix.texi index d6dda9904c..527f9bcd10 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -5361,10 +5361,6 @@ more. To ensure that libraries written in those languages can find library code they depend on at run time, run-time dependencies must be listed in @code{propagated-inputs} rather than @code{inputs}. -@item @code{self-native-input?} (default: @code{#f}) -This is a Boolean field telling whether the package should use itself as -a native input when cross-compiling. - @item @code{outputs} (default: @code{'("out")}) The list of output names of the package. @xref{Packages with Multiple Outputs}, for typical uses of additional outputs. diff --git a/guix/packages.scm b/guix/packages.scm index b402637508..1d3d99ba65 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -264,9 +264,6 @@ name of its URI." (default '()) (thunked)) (native-inputs package-native-inputs ; native input packages/derivations (default '()) (thunked)) - (self-native-input? package-self-native-input? ; whether to use itself as - ; a native input when cross- - (default #f)) ; compiling (outputs package-outputs ; list of strings (default '("out"))) @@ -1032,7 +1029,7 @@ and return it." ((and self ($ name version source build-system args inputs propagated-inputs native-inputs - self-native-input? outputs)) + outputs)) ;; Even though we prefer to use "@" to separate the package ;; name from the package version in various user-facing parts ;; of Guix, checkStoreName (in nix/libstore/store-api.cc) @@ -1044,11 +1041,7 @@ and return it." #:inputs (append (inputs self) (propagated-inputs self)) #:outputs outputs - #:native-inputs `(,@(if (and target - self-native-input?) - `(("self" ,self)) - '()) - ,@(native-inputs self)) + #:native-inputs (native-inputs self) #:arguments (args self)) (raise (if target (condition -- cgit v1.2.3 From 154f1f0937754fafac0c6288dd458b66b332e6bb Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 30 Mar 2019 15:00:41 +0100 Subject: packages: Remove 'maintainers' field. This field was never used and doesn't match the way we collectively maintain packages. * guix/packages.scm ()[maintainers]: Remove. --- guix/packages.scm | 2 -- 1 file changed, 2 deletions(-) (limited to 'guix/packages.scm') diff --git a/guix/packages.scm b/guix/packages.scm index 1d3d99ba65..c2981dda8b 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -84,7 +84,6 @@ package-license package-home-page package-supported-systems - package-maintainers package-properties package-location hidden-package @@ -286,7 +285,6 @@ name of its URI." (home-page package-home-page) (supported-systems package-supported-systems ; list of strings (default %supported-systems)) - (maintainers package-maintainers (default '())) (properties package-properties (default '())) ; alist for anything else -- cgit v1.2.3 From a31174e896047e6a0f42b69db331fdeebb3cc995 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 4 Apr 2019 17:18:06 +0200 Subject: gexp: 'compiled-modules' loads modules before compiling them. This works around in the context of modules specified with 'with-imported-modules'. * guix/gexp.scm (gexp->derivation): Add #:pre-load-modules? parameter and pass it to 'compiled-modules'. (compiled-modules): Add #:pre-load-modules? parameter and honor it. * guix/packages.scm (patch-and-repack): Pass #:pre-load-modules? to 'gexp->derivation'. --- guix/gexp.scm | 47 +++++++++++++++++++++++++++++++++++++++++++++-- guix/packages.scm | 3 +++ 2 files changed, 48 insertions(+), 2 deletions(-) (limited to 'guix/packages.scm') diff --git a/guix/gexp.scm b/guix/gexp.scm index 5b5b064b59..4f2adba90a 100644 --- a/guix/gexp.scm +++ b/guix/gexp.scm @@ -634,6 +634,11 @@ names and file names suitable for the #:allowed-references argument to local-build? (substitutable? #t) (properties '()) + ;; TODO: This parameter is transitional; it's here + ;; to avoid a full rebuild. Remove it on the next + ;; rebuild cycle. + (pre-load-modules? #t) + deprecation-warnings (script-name (string-append name "-builder"))) "Return a derivation NAME that runs EXP (a gexp) with GUILE-FOR-BUILD (a @@ -738,6 +743,8 @@ The other arguments are as for 'derivation'." #:module-path module-path #:extensions extensions #:guile guile-for-build + #:pre-load-modules? + pre-load-modules? #:deprecation-warnings deprecation-warnings) (return #f))) @@ -1213,7 +1220,11 @@ last one is created from the given object." (guile (%guile-for-build)) (module-path %load-path) (extensions '()) - (deprecation-warnings #f)) + (deprecation-warnings #f) + + ;; TODO: This flag is here to prevent a full + ;; rebuild. Remove it on the next rebuild cycle. + (pre-load-modules? #t)) "Return a derivation that builds a tree containing the `.go' files corresponding to MODULES. All the MODULES are built in a context where they can refer to each other." @@ -1246,7 +1257,12 @@ they can refer to each other." (let* ((base (basename entry ".scm")) (output (string-append output "/" base ".go"))) (format #t "[~2@a/~2@a] Compiling '~a'...~%" - (+ 1 processed) (ungexp total) entry) + (+ 1 processed + (ungexp-splicing (if pre-load-modules? + (gexp ((ungexp total))) + (gexp ())))) + (ungexp (* total (if pre-load-modules? 2 1))) + entry) (compile-file entry #:output-file output #:opts %auto-compilation-options) @@ -1293,6 +1309,33 @@ they can refer to each other." (mkdir (ungexp output)) (chdir (ungexp modules)) + + (ungexp-splicing + (if pre-load-modules? + (gexp ((define* (load-from-directory directory + #:optional (loaded 0)) + "Load all the source files found in DIRECTORY." + ;; XXX: This works around . + (let ((entries (map (cut string-append directory "/" <>) + (scandir directory regular?)))) + (fold (lambda (file loaded) + (if (file-is-directory? file) + (load-from-directory file loaded) + (begin + (format #t "[~2@a/~2@a] Loading '~a'...~%" + (+ 1 loaded) + (ungexp (* 2 total)) + file) + (save-module-excursion + (lambda () + (primitive-load file))) + (+ 1 loaded)))) + loaded + entries))) + + (load-from-directory "."))) + (gexp ()))) + (process-directory "." (ungexp output) 0)))) ;; TODO: Pass MODULES as an environment variable. diff --git a/guix/packages.scm b/guix/packages.scm index c2981dda8b..c94a651f27 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -642,6 +642,9 @@ specifies modules in scope when evaluating SNIPPET." (let ((name (tarxz-name original-file-name))) (gexp->derivation name build + ;; TODO: Remove this on the next rebuild cycle. + #:pre-load-modules? #f + #:graft? #f #:system system #:deprecation-warnings #t ;to avoid a rebuild -- cgit v1.2.3