From 8cef92d0633850d97c1a1d4521812268f56672be Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 5 Jun 2021 22:47:10 +0200 Subject: profiles: Move some of the work to the build side. When running: guix environment --ad-hoc gnome --no-grafts --search-paths this reduces wall-clock time by ~5%. The number of object cache lookups goes down from 96K to 89K. (Note that 'gnome' is an interesting example because it has many propagated inputs, which themselves have propagated inputs too, which would lead to a long input list and a long manifest in the 'profile-derivation' gexp.) * guix/profiles.scm (profile-derivation)[inputs, search-paths]: Remove. [extra-inputs]: New variable. [builder]: Adjust call to 'build-profile'. * guix/build/profiles.scm (manifest-sexp->inputs+search-paths): New procedure. (build-profile): Remove 'inputs' parameter; make 'manifest' the 2nd positional parameter and add #:extra-inputs. Call 'manifest-sexp->inputs+search-paths' to obtain 'inputs' and 'search-paths'. --- guix/build/profiles.scm | 86 ++++++++++++++++++++++++++++++++----------------- 1 file changed, 57 insertions(+), 29 deletions(-) (limited to 'guix/build') diff --git a/guix/build/profiles.scm b/guix/build/profiles.scm index a40c3f96de..9249977bed 100644 --- a/guix/build/profiles.scm +++ b/guix/build/profiles.scm @@ -20,6 +20,8 @@ #:use-module (guix build union) #:use-module (guix build utils) #:use-module (guix search-paths) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-11) #:use-module (srfi srfi-26) #:use-module (ice-9 ftw) #:use-module (ice-9 match) @@ -143,45 +145,71 @@ instead make DIRECTORY a \"real\" directory containing symlinks." directory)))) (apply throw args)))))) -(define* (build-profile output inputs - #:key manifest search-paths - (symlink symlink)) - "Build a user profile from INPUTS in directory OUTPUT, using SYMLINK to -create symlinks. Write MANIFEST, an sexp, to OUTPUT/manifest. Create -OUTPUT/etc/profile with Bash definitions for -all the variables listed in -SEARCH-PATHS." +(define (manifest-sexp->inputs+search-paths manifest) + "Parse MANIFEST, an sexp as produced by 'manifest->gexp', and return two +values: the list of store items of its manifest entries, and the list of +search path specifications." + (match manifest ;this must match 'manifest->gexp' + (('manifest ('version 3) + ('packages (entries ...))) + (let loop ((entries entries) + (inputs '()) + (search-paths '())) + (match entries + (((name version output item + ('propagated-inputs deps) + ('search-paths paths) _ ...) . rest) + (loop (append deps rest) + (cons item inputs) + (append paths search-paths))) + (() + (values inputs + (delete-duplicates + (cons $PATH + (map sexp->search-path-specification + search-paths)))))))))) + +(define* (build-profile output manifest + #:key (extra-inputs '()) (symlink symlink)) + "Build a user profile from MANIFEST, an sexp, and EXTRA-INPUTS, a list of +store items, in directory OUTPUT, using SYMLINK to create symlinks. Create +OUTPUT/etc/profile with Bash definitions for all the variables listed in the +search paths of MANIFEST's entries." (define manifest-file (string-append output "/manifest")) - ;; Make the symlinks. - (union-build output inputs - #:symlink symlink - #:log-port (%make-void-port "w")) + (let-values (((inputs search-paths) + (manifest-sexp->inputs+search-paths manifest))) - ;; If one of the INPUTS provides a '/manifest' file, delete it. That can - ;; happen if MANIFEST contains something such as a Guix instance, which is - ;; ultimately built as a profile. - (when (file-exists? manifest-file) - (delete-file manifest-file)) + ;; Make the symlinks. + (union-build output (append extra-inputs inputs) + #:symlink symlink + #:log-port (%make-void-port "w")) - ;; Store meta-data. - (call-with-output-file manifest-file - (lambda (p) - (display "\ + ;; If one of the INPUTS provides a '/manifest' file, delete it. That can + ;; happen if MANIFEST contains something such as a Guix instance, which is + ;; ultimately built as a profile. + (when (file-exists? manifest-file) + (delete-file manifest-file)) + + ;; Store meta-data. + (call-with-output-file manifest-file + (lambda (p) + (display "\ ;; This file was automatically generated and is for internal use only. ;; It cannot be passed to the '--manifest' option. ;; Run 'guix package --export-manifest' if you want to export a file ;; suitable for '--manifest'.\n\n" - p) - (pretty-print manifest p))) + p) + (pretty-print manifest p))) - ;; Make sure we can write to 'OUTPUT/etc'. 'union-build' above could have - ;; made 'etc' a symlink to a read-only sub-directory in the store so we need - ;; to work around that. - (ensure-writable-directory (string-append output "/etc") - #:symlink symlink) + ;; Make sure we can write to 'OUTPUT/etc'. 'union-build' above could have + ;; made 'etc' a symlink to a read-only sub-directory in the store so we + ;; need to work around that. + (ensure-writable-directory (string-append output "/etc") + #:symlink symlink) - ;; Write 'OUTPUT/etc/profile'. - (build-etc/profile output search-paths)) + ;; Write 'OUTPUT/etc/profile'. + (build-etc/profile output search-paths))) ;;; profile.scm ends here -- cgit v1.2.3 From 483f537081b9b5ccf026373d6743761aba6946e3 Mon Sep 17 00:00:00 2001 From: "Paul A. Patience" Date: Sun, 6 Jun 2021 19:55:50 -0400 Subject: doc, gnu, guix: Fix typos. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * doc/guix.texi: Fix various typos and reword a sentence. * gnu/packages/cpp.scm (cpplint)[description]: Fix typo. * gnu/packages/dns.scm (ldns): Fix typo in comment. * gnu/packages/games.scm (yamagi-quake2): Fix typo in comment. * gnu/packages/qt.scm (python-pyqtwebengine): Fix typo in comment. * gnu/packages/rails.scm (ruby-autoprefixer-rails): Fix typo in comment. * gnu/packages/syndication.scm (quiterss)[description]: Fix typo. * gnu/packages/terminals.scm (kmscon): Fix typo in comment. * gnu/packages/xml.scm (perl-xml-sax-base)[description]: Fix typo. (python-elementpath)[description]: Fix typo. * guix/build/asdf-build-system.scm (output-translation): Fix typo in docstring. Signed-off-by: Ludovic Courtès --- doc/guix.texi | 8 ++++---- gnu/packages/cpp.scm | 2 +- gnu/packages/dns.scm | 2 +- gnu/packages/games.scm | 2 +- gnu/packages/qt.scm | 2 +- gnu/packages/rails.scm | 4 ++-- gnu/packages/syndication.scm | 2 +- gnu/packages/terminals.scm | 2 +- gnu/packages/xml.scm | 4 ++-- guix/build/asdf-build-system.scm | 3 +-- 10 files changed, 15 insertions(+), 16 deletions(-) (limited to 'guix/build') diff --git a/doc/guix.texi b/doc/guix.texi index 59b4ac11b4..e7c783bd95 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -7807,7 +7807,7 @@ MbedTLS package: Some older packages that aren't using @file{Package.toml} yet, will require this file to be created, too. The function @code{julia-create-package-toml} helps creating the file. You need to pass the outputs and the source of the -package, it's name (the same as the @code{file-name} parameter), the package +package, its name (the same as the @code{file-name} parameter), the package uuid, the package version, and a list of dependencies specified by their name and their uuid. @end defvr @@ -21755,7 +21755,7 @@ Available @code{getmail-options-configuration} fields are: If set to @samp{0}, getmail will only print warnings and errors. A value of @samp{1} means that messages will be printed about retrieving and deleting messages. If set to @samp{2}, getmail will print messages -about each of it's actions. +about each of its actions. Defaults to @samp{1}. @@ -25502,7 +25502,7 @@ directives} for comprehensive documentation on the acceptable @deftp {Data type} php-fpm-dynamic-process-manager-configuration Data Type for the @code{dynamic} php-fpm process manager. With the @code{dynamic} process manager, spare worker processes are kept around -based on it's configured limits. +based on its configured limits. @table @asis @item @code{max-children} (default: @code{5}) Maximum of worker processes. @@ -31570,7 +31570,7 @@ notifications. The kernel module loader service allows one to load loadable kernel modules at boot. This is especially useful for modules that don't -autoload and need to be manually loaded, as it's the case with +autoload and need to be manually loaded, as is the case with @code{ddcci}. @deffn {Scheme Variable} kernel-module-loader-service-type diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm index 3089094eb8..54f9da4b27 100644 --- a/gnu/packages/cpp.scm +++ b/gnu/packages/cpp.scm @@ -587,7 +587,7 @@ tools: (synopsis "Static code checker for C++") (description "@code{cpplint} is a command-line tool to check C/C++ files for style issues following Google’s C++ style guide. While Google maintains -it's own version of the tool, this is a fork that aims to be more responsive +its own version of the tool, this is a fork that aims to be more responsive and make @code{cpplint} usable in wider contexts.") (license license:bsd-3))) diff --git a/gnu/packages/dns.scm b/gnu/packages/dns.scm index 641681320c..199b876369 100644 --- a/gnu/packages/dns.scm +++ b/gnu/packages/dns.scm @@ -101,7 +101,7 @@ (base32 "0ac242n7996fswq1a3nlh1bbbhrsdwsq4mx7xq8ffq6aplb4rj4a")) (patches (search-patches - ;; To create make-flag vairables, + ;; To create make-flag variables, ;; for splitting installation of drill and examples. "ldns-drill-examples.patch")))) (build-system gnu-build-system) diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm index 2eaea5868e..26d3567024 100644 --- a/gnu/packages/games.scm +++ b/gnu/packages/games.scm @@ -7151,7 +7151,7 @@ some graphical niceities, and numerous bug-fixes and other improvements.") (mkdir-p (string-append out "/lib")) (mkdir-p (string-append out "/bin")) ;; The yamagi-quake2 binary must be in the same directory - ;; as it's engine libraries, but symlinking it to /bin is okay + ;; as its engine libraries, but symlinking it to /bin is okay. ;; https://github.com/yquake2/yquake2/blob/master/stuff/packaging.md (copy-recursively "release" (string-append out "/lib/yamagi-quake2")) diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm index 6bb1281570..f992314777 100644 --- a/gnu/packages/qt.scm +++ b/gnu/packages/qt.scm @@ -2068,7 +2068,7 @@ contain over 620 classes.") "--sipdir" sipdir "--pyqt-sipdir" pyqt-sipdir)))) ;; Because this has a different prefix than python-pyqt then we need - ;; to make this a namespace of it's own + ;; to make this a namespace of its own. (add-after 'install 'make-namespace (lambda* (#:key inputs outputs #:allow-other-keys) (let* ((__init__.py (string-append diff --git a/gnu/packages/rails.scm b/gnu/packages/rails.scm index e9c390a1a0..76ed4df6e4 100644 --- a/gnu/packages/rails.scm +++ b/gnu/packages/rails.scm @@ -142,8 +142,8 @@ API.") (modify-phases %standard-phases (add-after 'extract-gemspec 'remove-unnecessary-dependencies (lambda _ - ;; Remove the testing of compass, as it's use is deprecated, and - ;; it's unpackaged for Guix + ;; Remove the testing of compass, as its use is deprecated, and + ;; it's unpackaged for Guix. (substitute* "autoprefixer-rails.gemspec" ((".*%q.*") "\n") (("\"spec/compass_spec\\.rb\"\\.freeze, ") "")) diff --git a/gnu/packages/syndication.scm b/gnu/packages/syndication.scm index fc4efb24f6..9d4325ffdf 100644 --- a/gnu/packages/syndication.scm +++ b/gnu/packages/syndication.scm @@ -576,7 +576,7 @@ formats, including all versions of RSS and Atom.") (home-page "https://quiterss.org/") (synopsis "RSS/Atom news feeds reader written on Qt/C++") (description "QuiteRSS is an RSS/Atom news feeds reader written on Qt/C++ -that aims to be quite fast and comfortable to it's user.") +that aims to be quite fast and comfortable to its user.") (license license:gpl3+))) (define-public gfeeds diff --git a/gnu/packages/terminals.scm b/gnu/packages/terminals.scm index 37636c7cdc..06ace5e238 100644 --- a/gnu/packages/terminals.scm +++ b/gnu/packages/terminals.scm @@ -326,7 +326,7 @@ compatibility to existing emulators like xterm, gnome-terminal, konsole, etc.") ("libxkbcommon" ,libxkbcommon) ("logind" ,elogind) ;; MESA can be used for accelerated video output via OpenGLESv2, but - ;; it's a bit dependency that we'd rather avoid in the installation + ;; it's a big dependency that we'd rather avoid in the installation ;; image. ;; ("mesa" ,mesa) ("pango" ,pango) diff --git a/gnu/packages/xml.scm b/gnu/packages/xml.scm index 9ddd02a613..e2d5ca8176 100644 --- a/gnu/packages/xml.scm +++ b/gnu/packages/xml.scm @@ -878,7 +878,7 @@ building Perl SAX2 XML parsers, filters, and drivers.") (home-page "https://metacpan.org/release/XML-SAX-Base") (synopsis "Base class for SAX Drivers and Filters") (description "This module has a very simple task - to be a base class for -PerlSAX drivers and filters. It's default behaviour is to pass the input +PerlSAX drivers and filters. Its default behaviour is to pass the input directly to the output unchanged. It can be useful to use this module as a base class so you don't have to, for example, implement the characters() callback.") @@ -2587,7 +2587,7 @@ for Python's ElementTree XML data structures, both for the standard ElementTree library and for the @uref{http://lxml.de, lxml.etree} library. For lxml.etree this package can be useful for providing XPath 2.0 selectors, -because lxml.etree already has it's own implementation of XPath 1.0.") +because lxml.etree already has its own implementation of XPath 1.0.") (license license:expat))) (define-public python-lxml diff --git a/guix/build/asdf-build-system.scm b/guix/build/asdf-build-system.scm index 7f1037c4f9..6186613e52 100644 --- a/guix/build/asdf-build-system.scm +++ b/guix/build/asdf-build-system.scm @@ -72,8 +72,7 @@ (define (output-translation source-path object-output) - "Return a translation for the system's source path -to it's binary output." + "Return a translation for the system's source path to its binary output." `((,source-path :**/ :*.*.*) (,(library-directory object-output) -- cgit v1.2.3