summaryrefslogtreecommitdiff
path: root/guix/profiles.scm
AgeCommit message (Collapse)Author
2020-05-01profiles: Mark manual database as non-substitutable.Ludovic Courtès
Fixes <https://bugs.gnu.org/40381>. Reported by pkill9 <pkill9@runbox.com>. * guix/profiles.scm (manual-database): Pass #:substitutable? #f.
2020-04-26profiles: Add lowerable <profile> record type.Ludovic Courtès
* guix/profiles.scm (<profile>): New record type. * tests/profiles.scm ("<profile>"): New test.
2020-04-22profiles: Add #:name parameter to 'profile-derivation'.Ludovic Courtès
* guix/profiles.scm (profile-derivation): Add #:name and pass it to 'gexp->derivation'.
2020-03-31profiles: Compute manual database entries in parallel.Arne Babenhauserheide
This provides a 36% speedup on an SSD and 4 cores for the 1.5K man pages in the manual database derivation of: guix environment --ad-hoc jupyter python-ipython python-ipykernel * guix/profiles.scm (manual-database)[build]: Add 'print-string', 'print', and 'compute-entry'. Change 'compute-entries' to call 'compute-entry' in 'n-par-map'. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2020-03-31guix package: Do not misdiagnose upgrades when there are propagated inputs.Ludovic Courtès
Fixes <https://bugs.gnu.org/35872>. Reported by Andy Tai <atai@atai.org>. * guix/profiles.scm (list=?, manifest-entry=?): New procedures. * guix/scripts/package.scm (transaction-upgrade-entry): In the '=' case, use 'manifest-entry=?' to determine whether it's an upgrade. * tests/packages.scm ("transaction-upgrade-entry, zero upgrades, propagated inputs"): New test.
2020-03-31profiles: 'lower-manifest-entry' recurses on dependencies.Ludovic Courtès
* guix/profiles.scm (lower-manifest-entry)[recurse]: New procedure. Call it on dependencies and set the 'dependencies' field accordingly.
2020-03-31guix package: 'transaction-upgrade-entry' uses 'lower-manifest-entry'.Ludovic Courtès
* guix/profiles.scm (lower-manifest-entry): Export. * guix/scripts/package.scm (transaction-upgrade-entry)[lower-manifest-entry*] [upgrade]: New procedures. Use 'lower-manifest-entry*' instead of 'package-derivation' to compute the output file name of PKG.
2020-03-29profiles: Use 'mapm/accumulate-builds'.Ludovic Courtès
* guix/profiles.scm (check-for-collisions): Use 'mapm/accumulate-builds' to lower manifest entries. Call 'foldm' over the already-lowered entries. (profile-derivation): Use 'mapm/accumulate-builds' instead of 'mapm' when calling HOOKS.
2020-03-26profiles: 'profile-derivation' sets a 'type' property.Ludovic Courtès
* guix/profiles.scm (profile-derivation): Pass #:properties to 'gexp->derivation'.
2020-03-22system: Add kernel-loadable-modules to operating-system.Danny Milosavljevic
* gnu/system.scm (<operating-system>): Add kernel-loadable-modules. (operating-system-directory-base-entries): Use it. * doc/guix.texi (operating-system Reference): Document KERNEL-LOADABLE-MODULES. * gnu/build/linux-modules.scm (depmod): New procedure. (make-linux-module-directory): New procedure. Export it. * guix/profiles.scm (linux-module-database): New procedure. Export it. * gnu/tests/linux-modules.scm: New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. * gnu/packages/linux.scm (make-linux-libre*)[arguments]<#:phases>[install]: Disable depmod. Remove "build" and "source" symlinks. [native-inputs]: Remove kmod.
2019-12-29profiles: Fix profile-derivation cross-compilation.Mathieu Othacehe
* guix/store.scm (current-target-system): New exported monadic procedure. * guix/profiles.scm (profile-derivation): Set target at bind time using the above procedure.
2019-12-29profiles: Add 'map-manifest-entries'.Ludovic Courtès
* guix/scripts/pack.scm (map-manifest-entries): Move to... * guix/profiles.scm (map-manifest-entries): ... here.
2019-12-10profiles: Use 'getpwuid' when $USER and $LOGNAME are undefined.Ludovic Courtès
Reported by YOANN P <yoann_mac_donald@hotmail.com>. * guix/profiles.scm (%profile-directory): Fall back to 'getpwuid' when "USER" and "LOGNAME" are undefined.
2019-11-22profiles: Add 'concatenate-manifests'.Ludovic Courtès
* guix/profiles.scm (concatenate-manifests): New procedure. * tests/profiles.scm ("concatenate-manifests"): New test.
2019-10-16daemon: Make 'profiles/per-user' non-world-writable.Ludovic Courtès
Fixes <https://bugs.gnu.org/37744>. Reported at <https://www.openwall.com/lists/oss-security/2019/10/09/4>. Based on Nix commit 5a303093dcae1e5ce9212616ef18f2ca51020b0d by Eelco Dolstra <edolstra@gmail.com>. * nix/libstore/local-store.cc (LocalStore::LocalStore): Set 'perUserDir' to #o755 instead of #o1777. (LocalStore::createUser): New function. * nix/libstore/local-store.hh (LocalStore): Add it. * nix/libstore/store-api.hh (StoreAPI): Add it. * nix/nix-daemon/nix-daemon.cc (performOp): In 'wopSetOptions', add condition to handle "user-name" property and honor it. (processConnection): Add 'userId' parameter. Call 'store->createUser' when userId is not -1. * guix/profiles.scm (ensure-profile-directory): Note that this is now handled by the daemon. * guix/store.scm (current-user-name): New procedure. (set-build-options): Add #:user-name parameter and pass it to the daemon. * tests/guix-daemon.sh: Test the creation of 'profiles/per-user' when listening on a TCP socket. * tests/store.scm ("profiles/per-user exists and is not writable") ("profiles/per-user/$USER exists"): New tests.
2019-07-03profiles: Adjust packages->manifest pattern for inferior packages.Kyle Meyer
* guix/profiles.scm (packages->manifest): Add package? predicate to `(package output)' pattern to avoid incorrectly matching `(inferior-package output)', which should be handled by a later clause. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2019-04-10profiles: Add 'generation-profile'.Ludovic Courtès
* guix/profiles.scm (%profile-generation-rx): New variable. (generation-profile): New procedure.
2019-02-07profiles: Raise an error for unmatched patterns.Ludovic Courtès
Previously, "guix package -r something-not-installed" would silently complete. Now an error is raised. * guix/profiles.scm (&unmatched-pattern-error): New condition type. (manifest-matching-entries): Rewrite to raise an error when one of PATTERNS is not matched. * guix/ui.scm (call-with-error-handling): Handle 'unmatched-pattern-error?'. * tests/guix-package.sh: Add test. * tests/profiles.scm ("manifest-matching-entries"): Don't try to remove unmatched pattern. ("manifest-matching-entries, no match"): New test. ("manifest-transaction-effects"): Remove 'remove' field.
2019-02-01profiles: 'manual-database' hook reports progress.Ludovic Courtès
* guix/profiles.scm (manual-database)[build](compute-entries): Write a progress report.
2019-01-18guix: Add guard to texlive-configuration profile hook.Christopher Baines
It is possible to generate a profile where this hook will crash, as the texmf.cnf file does not exist to be patched by substitute*. A simple example is the profile just containing texlive-fonts-txfonts. * guix/profiles.scm (texlive-configuration): Check that the texmf.cnf file exists before trying to change it.
2019-01-15guix: Add profile hook to build TeX live configuration.Ricardo Wurmus
* guix/profiles.scm (texlive-configuration): New procedure. (%default-profile-hooks): Add it. * guix/status.scm (hook-message): Handle "texlive-configuration" hook type.
2018-12-19Use 'mapm' instead of 'sequence' + 'map'.Ludovic Courtès
Previously we'd use the (sequence M (map P L)) idiom just because 'mapm' was slower (not specialized for the given monad). This is no longer the case since commit dcb95c1fc936d74dfdf84b7e59eff66cb99c5a63. * guix/gexp.scm (lower-inputs): Use (mapm M P L) instead of (sequence M (map P L)). (lower-references, gexp->sexp, imported-files): Likewise. * guix/profiles.scm (profile-derivation): Likewise. * guix/scripts/environment.scm (inputs->requisites): Likewise. * guix/scripts/system.scm (copy-closure): Likewise.
2018-12-19ui: Report profile hooks separately.Ricardo Wurmus
* guix/ui.scm (profile-hook-derivation?): New procedure. (show-what-to-build): Distinguish among BUILD derivations that match 'profile-hook-derivation?'. Report them separately. * guix/status.scm (hook-message): New procedure. (print-build-event): Display profile hooks with readable hook name. * guix/profiles.scm (info-dir-file, ghc-package-cache-file, ca-certificate-bundle, glib-schemas, gtk-icon-themes, gtk-im-modules, xdg-desktop-database, xdg-mime-database, fonts-dir-file, manual-database): Augment derivation with "type" and "hook" properties.
2018-10-26profiles: Fix typo in exports.Ludovic Courtès
* guix/profiles.scm (&profile-collistion-error): Fix typo in export list.
2018-10-12profiles: 'user-friendly-profile' now recognizes ~/.config/guix/current.Ludovic Courtès
* guix/profiles.scm (%known-shorthand-profiles): New variable. (user-friendly-profile): Use it.
2018-10-11profiles: Generalize 'canonicalize-profile'.Ludovic Courtès
* guix/profiles.scm (canonicalize-profile): Rewrite to work with any profile that lives under %PROFILE-DIRECTORY.
2018-10-11profiles: Add 'ensure-profile-directory'.Ludovic Courtès
* guix/scripts/package.scm (ensure-default-profile): Move /var/guix/profiles/per-user handling to... * guix/profiles.scm (ensure-profile-directory): ... here. New procedure. * po/guix/POTFILES.in: Add 'guix/profiles.scm'.
2018-10-09profiles: Make Geiser happy.Ludovic Courtès
* guix/profiles.scm (manual-database)[config.scm]: Use ungexp/quote trick to placate Geiser, which otherwise thinks it's in (guix config).
2018-09-21profiles: 'packages->manifest' now accepts inferior packages.Ludovic Courtès
* guix/profiles.scm (packages->manifest)[inferiors-loaded?]: New variable. [inferior->entry]: New procedure. Accept inferior packages when INFERIORS-LOADED? is true. * tests/guix-package.sh: Add test using a manifest with an inferior. * tests/inferior.scm ("packages->manifest"): New test.
2018-09-07guix package: Record package provenance in manifest entries.Ludovic Courtès
* guix/profiles.scm (package->manifest-entry): Add #:properties and honor it. * guix/scripts/package.scm (package-provenance) (package->manifest-entry*): New procedures. (transaction-upgrade-entry, options->installable): Use 'package->manifest-entry*' instead of 'package->manifest-entry'.
2018-07-13guix package: Use relative symlinks to generations.Ludovic Courtès
Reported by Roel Janssen <roel@gnu.org> at <https://lists.gnu.org/archive/html/guix-devel/2018-07/msg00036.html>. * guix/profiles.scm (switch-to-generation): Use (basename generation) as the symlink target. * guix/scripts/package.scm (build-and-use-profile): Likewise, use (basename name) as the symlink target. * tests/guix-package.sh: Adjust --roll-back test accordingly. Add explicitly test with '-p foo/prof'.
2018-07-11profiles: Introduce 'profile-search-paths' and use it.Ludovic Courtès
* guix/profiles.scm (profile-search-paths): New procedure. * guix/scripts/environment.scm (evaluate-search-paths): Remove. (create-environment): Replace 'paths' with 'manifest'. Use 'profile-search-paths' instead of 'evaluate-search-paths'. (show-search-paths): Likewise. (launch-environment): Replace 'paths' with 'manifest'. Make 'pure?' a keyword parameter. (launch-environment/fork, launch-environment/container): Likewise. (guix-environment): Remove 'paths' variable. Adjust callers of the above procedures accordingly.
2018-07-11profiles: Factorize 'manifest-search-paths'.Ludovic Courtès
* guix/profiles.scm (manifest-search-paths): New procedure. (profile-derivation)[builder]: Use it. * guix/build/profiles.scm (build-etc/profile): Remove $PATH.
2018-07-04profiles: 'info-dir-file' hook now produces 'dir.LANG' files.Ludovic Courtès
Previously, entries for 'guix.fr.info' would end up in 'dir', above the 'guix.info' entries; consequently, running 'info guix' would actually open 'guix.fr.info', which was confusing for non-French readers. * guix/profiles.scm (info-dir-file)[glibc-utf8-locales]: New variable. [build](info-file-language): New procedure. (install-info): Use it, to create 'dir.LANG' files. Set GUIX_LOCPATH.
2018-06-09profiles: Add 'properties' field to manifest entries.Ludovic Courtès
* guix/profiles.scm (<manifest-entry>)[properties]: New field. (manifest->gexp)[entry->gexp]: Serialize it. (sexp->manifest)[sexp->manifest-entry]: Deserialize it.
2018-06-09profiles: Add '%current-profile', 'user-friendly-profile', & co.Ludovic Courtès
* guix/scripts/package.scm (%user-profile-directory) (%profile-directory, %current-profile, canonicalize-profile) (user-friendly-profile): Move to... * guix/profiles.scm: ... here.
2018-06-01profiles: Use 'with-extensions'.Ludovic Courtès
* guix/profiles.scm (manual-database)[build]: Use 'with-extensions'. Remove 'add-to-load-path' call. * guix/man-db.scm: Use (gdbm) the normal way; remove 'module-autoload!' call.
2018-05-21profiles: Add hook to generate "gschemas.compiled".Danny Milosavljevic
* guix/profiles.scm (glib-schemas): New procedure. (%default-profile-hooks): Add it.
2018-05-10profiles: Allow lowerable objects other than packages in <manifest-entry>.Ludovic Courtès
* guix/profiles.scm (manifest-lookup-package)[entry-lookup-package]: Add case where 'manifest-entry-item' returns something that's neither a string nor a package.
2018-05-10profiles: Optionally use relative file names for symlink targets.Ludovic Courtès
* guix/build/union.scm (symlink-relative): New procedure. * guix/build/profiles.scm: Re-export it. (build-profile): Add #:symlink and pass it to 'union-build'. * guix/profiles.scm (profile-derivation): Add #:relative-symlinks?. Pass #:symlink to 'build-profile'. * tests/profiles.scm ("profile-derivation relative symlinks, one entry") ("profile-derivation relative symlinks, two entries"): New tests.
2018-03-01profiles: 'manifest-add' truly deletes duplicate entries.Ludovic Courtès
Fixes <https://bugs.gnu.org/30569>. Reported by Andreas Enge <andreas@enge.fr>. * guix/profiles.scm (manifest-add): Don't append ENTRIES as is. Instead, cons each element of ENTRIES as we fold over it. Remove unneeded ellispes in 'match' patterns.
2017-12-19Merge branch 'master' into core-updatesMarius Bakke
2017-12-17profiles: Use (guix man-db) to create the manual database.Ludovic Courtès
Fixes <https://bugs.gnu.org/29654>. Reported by Ruud van Asseldonk <dev+guix@veniogames.com>. This also speeds up database creation compared to "man-db --create" (less than half the time, on a warm cache, for 19k pages.) * guix/man-db.scm: New file. * Makefile.am (MODULES_NOT_COMPILED): Add it. * guix/profiles.scm (manual-database): Rewrite to use (guix man-db).
2017-12-05Merge branch 'master' into core-updatesMarius Bakke
2017-12-03profiles: Really disable deprecation warnings for 'profile-derivation'.Ludovic Courtès
This is a followup to 2815fca1423cf72e6f3d0e774f1058bcbf8dfdbf. * guix/profiles.scm (profile-derivation)[builder]: Remove 'debug-disable' call, which was ineffective. Pass #:env-vars to 'gexp->derivation'.
2017-12-03profile: Use _IO* but disable deprecation warning.Ludovic Courtès
This fixes a regression introduced in 2f60084f77815f454d1521396c2a383390ea2865, whereby the profile derivation would fail to run on Guile 2.0 (as is the case with "guix package --bootstrap"). Reported by Christopher Baines. * guix/profiles.scm (profile-derivation)[builder]: Use _IO* but add 'debug-disable' call.
2017-12-03profiles: Avoid _IO* in profile builder.Ludovic Courtès
* guix/profiles.scm (profile-derivation)[builder]: Avoid the deprecated _IO* constants.
2017-12-03profiles: Do not import the host's srfi-{19,26}.scm files.Ludovic Courtès
Previously the "manual-database" derivation would always import the host's srfi-{19,26}.scm files in the build side. In practice this means that different users could get different manual-database.drv depending on the Guile version they're using in the host. For example, the (gnu tests install) tests would fail if the host was running Guile 2.2.3 because the guest is running 2.2.2, and thus has different srfi-{19,26}.scm files. The manual-database.drv would need to be built from source, which would fail because prerequisites were missing. Reported by Mathieu Othacehe <m.othacehe@gmail.com> at <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=29409#96>. * guix/profiles.scm (manual-database): Do not pass #:modules to 'gexp->derivation'. Wrap 'build' gexp in 'with-imported-modules' form.
2017-12-03gnu: glibc: Don't use full version string in locale path.Marius Bakke
This is a follow-up to commit ee3ebf1a357bd4eb36a2fa1790a7b549cffb305a. Fixes <https://bugs.gnu.org/29537>. * gnu/packages/base.scm (glibc/linux)[version]: Change to 2.26.91-gaaa2eb83b8. [source](uri): Adjust accordingly. [arguments]: Use VERSION-MAJOR+MINOR for locales path. (glibc-locales, glibc-utf8-locales): Likewise. * guix/packages.scm (patch-and-repack): Likewise. * guix/profiles.scm (ca-certificate-bundle, profile-derivation): Likewise.
2017-08-09profiles: Only check file contents if the file exists.Ricardo Wurmus
* guix/profiles.scm (fonts-dir-file): Check that files exist before using "empty-file?".