Commit Graph

165 Commits

Author SHA1 Message Date
Ludovic Courtès f9a8dd053c
utils: Move '&fix-hint' to (guix diagnostics).
* 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-07-25 19:11:36 +02:00
Ludovic Courtès 05f79da93f
profiles: 'linux-module-database' hooks gracefully handles module-less kernels.
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-18 14:48:17 +02:00
Ludovic Courtès fea072d727
profiles: Reindent 'linux-module-database'.
* guix/profiles.scm (linux-module-database): Reindent.
2020-06-18 14:48:17 +02:00
Ludovic Courtès 993023a28e
lint: Add 'check-for-collisions' checker.
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-14 15:34:42 +02:00
Ludovic Courtès 9acac9f9c6
profiles: Fix pathological performance of 'manifest-transitive-entries'.
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-06-14 15:34:41 +02:00
Marius Bakke 50e6c1bf2e
Merge branch 'master' into core-updates 2020-05-02 17:31:28 +02:00
Ludovic Courtès 69de98391d
profiles: Mark manual database as non-substitutable.
Fixes <https://bugs.gnu.org/40381>.
Reported by pkill9 <pkill9@runbox.com>.

* guix/profiles.scm (manual-database): Pass #:substitutable? #f.
2020-05-01 01:21:03 +02:00
Marius Bakke 8bf8cd9b85
Merge branch 'master' into core-updates
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-30 23:47:49 +02:00
Ludovic Courtès ef674a24c5
profiles: Add lowerable <profile> record type.
* guix/profiles.scm (<profile>): New record type.
* tests/profiles.scm ("<profile>"): New test.
2020-04-26 22:49:48 +02:00
Marius Bakke 030f6f489f
Merge branch 'master' into core-updates
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-23 13:33:09 +02:00
Ludovic Courtès 416f7f4f14
profiles: Add #:name parameter to 'profile-derivation'.
* guix/profiles.scm (profile-derivation): Add #:name and pass it to
'gexp->derivation'.
2020-04-22 19:23:57 +02:00
Marius Bakke 2778302399
Merge branch 'master' into core-updates
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-04-08 13:00:50 +02:00
Arne Babenhauserheide ef4b5f2fed
profiles: Compute manual database entries in parallel.
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-31 14:55:42 +02:00
Ludovic Courtès a357849f5b
guix package: Do not misdiagnose upgrades when there are propagated inputs.
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-31 00:06:36 +02:00
Ludovic Courtès 1a9a373eb4
profiles: 'lower-manifest-entry' recurses on dependencies.
* guix/profiles.scm (lower-manifest-entry)[recurse]: New procedure.
Call it on dependencies and set the 'dependencies' field accordingly.
2020-03-31 00:06:36 +02:00
Ludovic Courtès 190ddfe21e
guix package: 'transaction-upgrade-entry' uses 'lower-manifest-entry'.
* 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-31 00:06:36 +02:00
Marius Bakke ae0badf5bb
Merge branch 'master' into core-updates
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-30 12:17:33 +02:00
Ludovic Courtès 25af35fa32
profiles: Use 'mapm/accumulate-builds'.
* 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-29 15:32:17 +02:00
Marius Bakke 18af687037
Merge branch 'master' into core-updates
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-27 00:12:15 +01:00
Ludovic Courtès e7570ec2da
profiles: 'profile-derivation' sets a 'type' property.
* guix/profiles.scm (profile-derivation): Pass #:properties to
'gexp->derivation'.
2020-03-26 13:07:19 +01:00
Danny Milosavljevic 5c79f23863
system: Add kernel-loadable-modules to operating-system.
* 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-22 12:51:50 +01:00
Ludovic Courtès 39569dbb5f
profiles: 'profile-derivation' uses _IOLBF on Guile 2.0 only.
* guix/profiles.scm (profile-derivation)[builder]: Use _IOLBF on Guile
2.0 only.
2020-03-17 16:10:58 +01:00
Mathieu Othacehe ce9383c090
Merge remote-tracking branch 'master' into core-updates. 2019-12-31 11:04:51 +01:00
Mathieu Othacehe e51de34309
profiles: Fix profile-derivation cross-compilation.
* 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-29 21:26:11 +01:00
Ludovic Courtès 8a705ae4c6
profiles: Add 'map-manifest-entries'.
* guix/scripts/pack.scm (map-manifest-entries): Move to...
* guix/profiles.scm (map-manifest-entries): ... here.
2019-12-29 18:24:54 +01:00
Mathieu Othacehe 91be09de61
profiles: Fix profile-derivation cross-compilation.
* 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-26 20:02:16 +01:00
Efraim Flashner 28292d8c5c
guix: Fix typo.
This is a follow-up to e8cbebb476.

* guix/profiles.scm (gtk-im-modules): Corectly refer to gtk+-2 package.
2019-12-15 19:21:18 +02:00
Julien Lepiller e8cbebb476
gnu: gtk+-2: Split binaries.
* 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-14 20:54:06 +01:00
Ludovic Courtès c20ba18304
profiles: Use 'getpwuid' when $USER and $LOGNAME are undefined.
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-12-10 20:56:06 +01:00
Ludovic Courtès ce30a0eb7e
profiles: Add 'concatenate-manifests'.
* guix/profiles.scm (concatenate-manifests): New procedure.
* tests/profiles.scm ("concatenate-manifests"): New test.
2019-11-22 15:07:58 +01:00
Ludovic Courtès 81c580c866
daemon: Make 'profiles/per-user' non-world-writable.
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-10-16 22:53:40 +02:00
Kyle Meyer 723f5b1dc9
profiles: Adjust packages->manifest pattern for inferior packages.
* 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-07-03 12:03:07 +02:00
Ludovic Courtès c872b952c5
profiles: Add 'generation-profile'.
* guix/profiles.scm (%profile-generation-rx): New variable.
(generation-profile): New procedure.
2019-04-10 17:09:47 +02:00
Ludovic Courtès 487cbb0164
profiles: Raise an error for unmatched patterns.
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-07 15:46:45 +01:00
Ludovic Courtès f6fe7da372
profiles: 'manual-database' hook reports progress.
* guix/profiles.scm (manual-database)[build](compute-entries): Write a
progress report.
2019-02-01 19:31:34 +01:00
Christopher Baines cf22e99f02
guix: Add guard to texlive-configuration profile hook.
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-18 16:15:33 +00:00
Ricardo Wurmus 743497b565
guix: Add profile hook to build TeX live configuration.
* guix/profiles.scm (texlive-configuration): New procedure.
(%default-profile-hooks): Add it.
* guix/status.scm (hook-message): Handle "texlive-configuration" hook type.
2019-01-15 13:05:22 +01:00
Ludovic Courtès b334674fe5
Use 'mapm' instead of 'sequence' + 'map'.
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 dcb95c1fc9.

* 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-19 23:52:24 +01:00
Ricardo Wurmus 80eebee9f7
ui: Report profile hooks separately.
* 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-12-19 23:46:38 +01:00
Ludovic Courtès fdc4f665dc
profiles: Fix typo in exports.
* guix/profiles.scm (&profile-collistion-error): Fix typo in export list.
2018-10-26 20:05:21 +02:00
Ludovic Courtès 1c795c4fd2
profiles: 'user-friendly-profile' now recognizes ~/.config/guix/current.
* guix/profiles.scm (%known-shorthand-profiles): New variable.
(user-friendly-profile): Use it.
2018-10-12 00:13:14 +02:00
Ludovic Courtès 50c72ecd9e
profiles: Generalize 'canonicalize-profile'.
* guix/profiles.scm (canonicalize-profile): Rewrite to work with any
profile that lives under %PROFILE-DIRECTORY.
2018-10-11 18:29:11 +02:00
Ludovic Courtès 77dcfb4c02
profiles: Add 'ensure-profile-directory'.
* 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-11 18:29:11 +02:00
Ludovic Courtès 88d9eccc11
profiles: Make Geiser happy.
* guix/profiles.scm (manual-database)[config.scm]: Use ungexp/quote
trick to placate Geiser, which otherwise thinks it's in (guix config).
2018-10-09 18:54:12 +02:00
Ludovic Courtès 811b21fb15
profiles: 'packages->manifest' now accepts inferior packages.
* 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-21 17:04:37 +02:00
Ludovic Courtès 2b73d82830
guix package: Record package provenance in manifest entries.
* 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-09-07 11:40:25 +02:00
Ludovic Courtès bc6e291ef0
guix package: Use relative symlinks to generations.
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-13 17:28:39 +02:00
Ludovic Courtès 78d55b703d
profiles: Introduce 'profile-search-paths' and use it.
* 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-11 00:52:36 +02:00
Ludovic Courtès f03df3ee75
profiles: Factorize 'manifest-search-paths'.
* guix/profiles.scm (manifest-search-paths): New procedure.
(profile-derivation)[builder]: Use it.
* guix/build/profiles.scm (build-etc/profile): Remove $PATH.
2018-07-11 00:52:36 +02:00
Ludovic Courtès 5b0c648a7c
profiles: 'info-dir-file' hook now produces 'dir.LANG' files.
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-07-04 10:52:59 +02:00