summaryrefslogtreecommitdiff
path: root/guix/profiles.scm
AgeCommit message (Collapse)Author
2021-06-28guix: Delete duplicates from emacs-load-path.Leo Prikler
It has been reported in IRC, that directories may show up multiple times in subdirs.el, probably a result of propagation. This can for instance be seen by ‘guix environment --ad-hoc emacs emacs-guix’, which will generate multiple references to dash. With this patch only one reference per package is generated. * guix/profiles.scm (emacs-subdirs): wrap subdirs added to ‘normal-top-level-add-to-load-path’ in ‘delete-duplictes’.
2021-06-18profiles: Add "XAUTHORITY" to the precious variables.Ludovic Courtès
Suggested by Maxime Devos <maximedevos@telenet.be>. * guix/profiles.scm (%precious-variables): Add "XAUTHORITY".
2021-06-18profiles: Add 'load-profile'.Ludovic Courtès
* guix/profiles.scm (%precious-variables): New variable. (purify-environment, load-profile): New procedures. * guix/scripts/environment.scm (%precious-variables) (purify-environment, create-environment): Remove. (launch-environment): Call 'load-profile' instead of 'create-environment'. * tests/profiles.scm ("load-profile"): New test.
2021-06-12profiles: Move some of the work to the build side.Ludovic Courtès
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'.
2021-06-05profiles: 'check-for-collisions' filters out more non-collisions upfront.Ludovic Courtès
When running: GUIX_PROFILING="gc object-cache" ./pre-inst-env \ guix install gnome -p /tmp/sdsdfsd --no-grafts -n this reduces the number of object cache lookup from 115K to 96K, with a slight CPU and memory usage reduction as well. * guix/profiles.scm (check-for-collisions)[candidates]: Exclude entries if their 'item' fields are eq?.
2021-05-20guix: Build texlive-configuration only when texlive-base is present.Ricardo Wurmus
Fixes <https://bugs.gnu.org/48519>. * guix/profiles.scm (texlive-configuration): Build only if texlive-base is present in the profile's manifest.
2021-05-05profiles: texlive-configuration: Handle updmap.cfg conflict.Ricardo Wurmus
The profile hook would fail when preparing an environment for a package using texlive-union, because the union already had a updmap.cfg file. Reported-by: Lars-Dominik Braun <ldb@leibniz-psychology.org>. * guix/profiles.scm (texlive-configuration): Delete updmap.cfg if it exists.
2021-05-03profiles: texlive-configuration: Refresh font maps.Ricardo Wurmus
* guix/profiles.scm (texlive-configuration): Run updmap to generate font maps necessary for pdflatex and other tools.
2021-05-01profiles: Add hook for Emacs subdirs.Leo Prikler
* guix/profiles.scm (emacs-subdirs): New variable. (%default-profile-hooks): Add it here. * guix/status.scm (hook-message): Add a message for emacs-subdirs.
2021-03-05profiles: 'package->manifest-entry' preserves transformations by default.Ludovic Courtès
Previously, transformations applied from a manifest (rather than via "guix install") would be lost. This change fixes that and simplifies things. Reported by zimoun at <https://lists.gnu.org/archive/html/guix-devel/2021-02/msg00153.html>. * guix/profiles.scm (default-properties): New procedure. (package->manifest-entry): Use it for #:properties. * guix/scripts/pack.scm (guix-pack)[with-transformations]: Remove. Remove caller. * guix/scripts/package.scm (transaction-upgrade-entry): Remove calls to 'manifest-entry-with-transformations'. * tests/guix-package.sh: Add test. * tests/transformations.scm ("options->transformation + package->manifest-entry"): New test.
2021-02-01profiles: Add 'manifest->code'.Ludovic Courtès
* guix/profiles.scm (manifest->code): New procedure. * tests/profiles.scm ("manifest->code, simple") ("manifest->code, simple, versions") ("manifest->code, transformations"): New tests.
2020-12-07profiles: Delete duplicate manifest entries in packages->manifest.Leo Prikler
* gnu/profiles.scm (packages->manifest): Delete duplicate entries. * tests/profiles.scm ("packages->manifest, no duplicates"): New test. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2020-12-07profiles: Remove duplicates in manifest transactions.Leo Prikler
Fixes <https://bugs.gnu.org/23874>. Reported by Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>. * guix/profiles.scm (manifest-transaction-effects): Delete duplicates in install and remove. Let multiple upgrades and downgrades shadow previous transactions of the same kind. * tests/profiles.scm ("manifest-transaction-effects no double install or upgrades") ("manifest-transaction-effects no double downgrade") ("manifest-transaction-effects no double removal"): New tests. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2020-11-02profiles: Add fast path for 'xdg-mime-database' hook.Ludovic Courtès
Partly fixes <https://bugs.gnu.org/44053>. Reported by Joshua Branson <jbranso@dismail.de> and Maxim Cournoyer <maxim.cournoyer@gmail.com>. * guix/profiles.scm (xdg-mime-database): When PKGDIRS contains only one element, symlink directly to it. Invoke 'update-mime-database' only when PKGDIRS contains two or more elements, which is less frequent.
2020-08-25linux-libre: Support module compression.Mathieu Othacehe
This commit adds support for GZIP compression for linux-libre kernel modules. The initrd modules are kept uncompressed as the initrd is already compressed as a whole. The linux-libre kernel also supports XZ compression, but as Guix does not have any available bindings for now, and the compression time is far more significant, GZIP seems to be a better option. * gnu/build/linux-modules.scm (modinfo-section-contents): Use 'call-with-gzip-input-port' to read from a module file using '.gz' extension, (strip-extension): new procedure, (dot-ko): adapt to support compression, (ensure-dot-ko): ditto, (file-name->module-name): ditto, (find-module-file): ditto, (load-linux-module*): ditto, (module-name->file-name/guess): ditto, (module-name-lookup): ditto, (write-module-name-database): ditto, (write-module-alias-database): ditto, (write-module-device-database): ditto. * gnu/installer.scm (installer-program): Add "guile-zlib" to the extensions. * gnu/machine/ssh.scm (machine-check-initrd-modules): Ditto. * gnu/services.scm (activation-script): Ditto. * gnu/services/base.scm (default-serial-port): Ditto, (agetty-shepherd-service): ditto, (udev-service-type): ditto. * gnu/system/image.scm (gcrypt-sqlite3&co): Ditto. * gnu/system/linux-initrd.scm (flat-linux-module-directory): Add "guile-zlib" to the extensions and make sure that the initrd only contains uncompressed module files. * gnu/system/shadow.scm (account-shepherd-service): Add "guile-zlib" to the extensions. * guix/profiles.scm (linux-module-database): Ditto.
2020-08-24Use "guile-zlib" and "guile-lzlib" instead of (guix config).Mathieu Othacehe
* Makefile.am (MODULES): Remove guix/zlib.scm and guix/lzlib.scm, (SCM_TESTS): remove tests/zlib.scm, tests/lzlib.scm. * build-aux/build-self.scm (make-config.scm): Remove unused %libz variable. * configure.ac: Remove LIBZ and LIBLZ variables and check instead for Guile-zlib and Guile-lzlib. * doc/guix.texi ("Requirements"): Remove zlib requirement and add Guile-zlib and Guile-lzlib instead. * gnu/packages/package-management.scm (guix)[native-inputs]: Add "guile-zlib" and "guile-lzlib", [inputs]: remove "zlib" and "lzlib", [propagated-inputs]: ditto, [arguments]: add "guile-zlib" and "guile-lzlib" to Guile load path. * guix/config.scm.in (%libz, %liblz): Remove them. * guix/lzlib.scm: Remove it. * guix/man-db.scm: Use (zlib) instead of (guix zlib). * guix/profiles.scm (manual-database): Do not stub (guix config) in imported modules list, instead add "guile-zlib" to the extension list. * guix/scripts/publish.scm: Use (zlib) instead of (guix zlib) and (lzlib) instead of (guix lzlib), (string->compression-type, effective-compression): do not check for zlib and lzlib availability. * guix/scripts/substitute.scm (%compression-methods): Do not check for lzlib availability. * guix/self.scm (specification->package): Add "guile-zlib" and "guile-lzlib" and remove "zlib" and "lzlib", (compiled-guix): remove "zlib" and "lzlib" arguments and add guile-zlib and guile-lzlib to the dependencies, also do not pass "zlib" and "lzlib" to "make-config.scm" procedure, (make-config.scm): remove "zlib" and "lzlib" arguments as well as %libz and %liblz variables. * guix/utils.scm (lzip-port): Use (lzlib) instead of (guix lzlib) and do not check for lzlib availability. * guix/zlib.scm: Remove it. * m4/guix.m4 (GUIX_LIBZ_LIBDIR, GUIX_LIBLZ_FILE_NAME): Remove them. * tests/lzlib.scm: Use (zlib) instead of (guix zlib) and (lzlib) instead of (guix lzlib), and do not check for zlib and lzlib availability. * tests/publish.scm: Ditto. * tests/substitute.scm: Do not check for lzlib availability. * tests/utils.scm: Ditto. * tests/zlib.scm: Remove it.
2020-07-25utils: Move '&fix-hint' to (guix diagnostics).Ludovic Courtès
* guix/utils.scm (&fix-hint): Move to... * guix/diagnostics.scm (&fix-hint): ... here. * gnu.scm: Adjust imports accordingly. * gnu/system/mapped-devices.scm: Likewise. * guix/channels.scm: Likewise. * guix/profiles.scm: Likewise. * guix/scripts/system/reconfigure.scm: Likewise. * guix/ssh.scm: Likewise.
2020-06-18profiles: 'linux-module-database' hooks gracefully handles module-less kernels.Ludovic Courtès
Fixes <https://bugs.gnu.org/41924>. * guix/profiles.scm (linux-module-database)[build]: Arrange so 'directory-entries' always returns a list. Add 'match' clause for the empty list. Co-authored-by: Ivan Kozlov <kanichos@yandex.ru>
2020-06-18profiles: Reindent 'linux-module-database'.Ludovic Courtès
* guix/profiles.scm (linux-module-database): Reindent.
2020-06-14lint: Add 'check-for-collisions' checker.Ludovic Courtès
Suggested by Edouard Klein <edk@beaver-labs.com>. * guix/profiles.scm (check-for-collisions): Export. * guix/lint.scm (check-profile-collisions): New procedure. (%local-checkers): Add 'profile-collisions' checker. * tests/lint.scm ("profile-collisions: no warnings") ("profile-collisions: propagated inputs collide") ("profile-collisions: propagated inputs collide, store items"): New tests. * doc/guix.texi (Invoking guix lint): Document it.
2020-06-14profiles: Fix pathological performance of 'manifest-transitive-entries'.Ludovic Courtès
For packages with lots of propagated inputs, 'manifest-transitive-entries', as called from 'check-for-collisions', would exhibit pathological behavior. For example, "guix install cl-ana" wouldn't complete in 1mn; now, it's down to 20s. The issue was that manifest entries would never be 'equal?' due to the delayed field in <manifest-entry>. * guix/profiles.scm (manifest-transitive-entries): Use a vhash instead of a set. Use 'manifest-entry=?' instead of 'equal?' when checking for equality.
2020-05-02Merge branch 'master' into core-updatesMarius Bakke
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-30Merge branch 'master' into core-updatesMarius Bakke
Conflicts: gnu/local.mk gnu/packages/backup.scm gnu/packages/emacs-xyz.scm gnu/packages/guile.scm gnu/packages/lisp.scm gnu/packages/openldap.scm gnu/packages/package-management.scm gnu/packages/web.scm gnu/packages/xorg.scm
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-23Merge branch 'master' into core-updatesMarius Bakke
Conflicts: etc/news.scm gnu/local.mk gnu/packages/bootloaders.scm gnu/packages/linphone.scm gnu/packages/linux.scm gnu/packages/tls.scm gnu/system.scm
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-04-08Merge branch 'master' into core-updatesMarius Bakke
Conflicts: etc/news.scm gnu/local.mk gnu/packages/check.scm gnu/packages/cross-base.scm gnu/packages/gimp.scm gnu/packages/java.scm gnu/packages/mail.scm gnu/packages/sdl.scm gnu/packages/texinfo.scm gnu/packages/tls.scm gnu/packages/version-control.scm
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-30Merge branch 'master' into core-updatesMarius Bakke
Conflicts: gnu/packages/admin.scm gnu/packages/commencement.scm gnu/packages/guile.scm gnu/packages/linux.scm gnu/packages/package-management.scm gnu/packages/pulseaudio.scm gnu/packages/web.scm
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-27Merge branch 'master' into core-updatesMarius Bakke
Conflicts: gnu/packages/icu4c.scm gnu/packages/man.scm gnu/packages/python-xyz.scm guix/scripts/environment.scm guix/scripts/pack.scm guix/scripts/package.scm guix/scripts/pull.scm guix/store.scm
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.
2020-03-17profiles: 'profile-derivation' uses _IOLBF on Guile 2.0 only.Ludovic Courtès
* guix/profiles.scm (profile-derivation)[builder]: Use _IOLBF on Guile 2.0 only.
2019-12-31Merge remote-tracking branch 'master' into core-updates.Mathieu Othacehe
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-26profiles: 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-15guix: Fix typo.Efraim Flashner
This is a follow-up to e8cbebb4769328f6ad49a4b5868f9c935e7e5372. * guix/profiles.scm (gtk-im-modules): Corectly refer to gtk+-2 package.
2019-12-14gnu: gtk+-2: Split binaries.Julien Lepiller
* gnu/packages/gtk.scm (gtk+-2): Add "bin" output. * guix/profiles.scm (gtk-im-modules): Use "bin" output for generating gtk+-2 immodules cache file.
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.