* guix/packages/packages.scm (<package>): Clarify that the license
field takes a list of licenses rather than a generic list.
Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
* guix/import/utils.scm (spdx-string->license): Identify more
licenses (CC-BY-4.0, Freetype, HPND).
* guix/licenses.scm: Add a comment that mentions "MIT" so that people
who grep for MIT end up there.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* guix/import/print.scm (package->code)[variable-reference]
[object->code]: New procedures.
[package-lists->code]: Rewrite in terms of 'object->code'.
Pass the 'arguments' field through 'object->code'.
* tests/print.scm (pkg-with-arguments, pkg-with-arguments-source): New
variables.
("package with arguments"): New test.
* guix/import/print.scm (package->code)[source->code]: Handle patches
that are origins.
* tests/print.scm (pkg-with-origin-input): Add 'patches' field.
(pkg-with-origin-patch, pkg-with-origin-patch-source): New variables.
("package with origin patch"): New test.
* guix/import/print.scm (package->code)[factorized-uri-code]: New
procedure.
[source->code]: Use it, and factorize URI when it's a list.
* tests/print.scm (pkg-with-origin-input): Check origin URI to a list.
* guix/import/print.scm (package->code)[source->code]: Check whether
VERSION is true before calling 'factorize-uri'.
[package-lists->code]: Add clause for inputs that are origins.
* tests/print.scm (pkg-with-origin-input, pkg-with-origin-input-source):
New variables.
("package with origin input"): New test.
* guix/import/cran.scm (download): Handle the case where URL is a list.
(fetch-description-from-tarball): New procedure.
(fetch-description): Add #:version parameter. Honor it when REPOSITORY
is 'cran. Use 'fetch-description-from-tarball' when REPOSITORY is
'bioconductor.
(description->package): SOURCE-URL may now be a list.
(cran->guix-package): Pass VERSION to 'fetch-description'.
(cran-recursive-import): Add #:version parameter.
* guix/scripts/import/cran.scm (guix-import-cran): Expect a spec rather
than a mere package name.
* doc/guix.texi (Invoking guix import): Document it.
Previously, most actions would leave the cache as-is because
'guix-environment*' would indirectly call 'exit', and thus its
continuation was never reached.
* guix/scripts/shell.scm (guix-shell): Move call to
'maybe-remove-expired-cache-entries' to EXIT-HOOK.
Previously, 'read-error' exceptions other than "missing closing paren"
would not be reported; instead, we'd directly call (exit 1) without
printing anything.
Fixes <https://issues.guix.gnu.org/51463>.
Reported by Alice BRENON <alice.brenon@ens-lyon.fr>.
* guix/ui.scm (report-load-error): Report the error without re-throwing
upon 'read-error'.
* tests/guix-build.sh: Add test.
* guix/scripts/environment.scm (launch-environment): Call
'primitive-_exit' upon 'system-error.
(suggest-command-name, validate-exit-status): New procedures.
(launch-environment/fork): Call 'validate-exit-status'.
(launch-environment/container)[exit/status*]: New procedure.
Use it instead of 'exit/status'.
This allows us to skip the expensive man-db profile hook in most cases.
Suggested by Liliana Marie Prikler <liliana.prikler@gmail.com>.
* guix/profiles.scm (manual-database/optional): New procedure.
(%default-profile-hooks): Use it instead of 'manual-database'.
* doc/guix.texi (Documentation): Add footnote about 'man -k' database
creation.
This also makes automated ‘guix --h<Tab>’ completion possible.
* guix/ui.scm (show-guix-help): Document that an OPTION's an option,
and all valid options.
* guix/scripts/home/import.scm (manifest->code): Remove.
(manifest+configuration-files->code): New procedure.
(import-manifest): Use 'manifest+configuration-files->code' instead of
'manifest->code'.
* tests/home-import.scm (eval-test-with-home-environment): Likewise.
(match-home-environment-transformations): New procedure.
("manifest->code: No services, package transformations"): New test.
Suggested by Liliana Marie Prikler <liliana.prikler@gmail.com>.
* guix/scripts/home/import.scm (configurations+modules): Rename
'destination-directory' to 'configuration-directory'. Improve
docstring.
'procedure-name' is a debugging aid and cannot be reliably used to
check for procedure equality.
* guix/scripts/home/import.scm (configurations+modules): Remove use of
'procedure-name'.
Set the name of the file to just the basename of the file passed to
‘local-file’.
* guix/scripts/home/import.scm (basename+remove-dots): New procedure.
(generate-bash-configuration+modules): Use it.
* tests/home-import.scm (match-home-environment-bash-service): Adjust
accordingly.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Two different services might require the same module(s), so delete duplicates
when generating the ‘use-modules’ form.
* import.scm (manifest->code): Delete duplicate modules.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
‘slurp-file-gexp’ is not a bound procedure.
* guix/scripts/home/import.scm (generate-bash-configuration+modules): Don’t
use ‘slurp-file-gexp’.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Previously, only one module could be imported for each service, e.g., only
(gnu home-services shell) could be imported when generating the Bash service
declaration. However, for some services, multiple modules might need to be
imported in order for it to work.
* guix/scripts/home/import.scm (generate-bash-module+configuration): Rename to
...
(generate-bash-configuration+modules): ... this.
(%files-configurations-alist): Rename to ...
(%files+configurations-alist): ... this.
(modules+configurations): Rename to ...
(configurations+modules): ... this.
(manifest->code): Adjust accordingly.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Copy the appropriate the relevant configuration files to the destination
directory, and call ‘local-file’ on them.
Without this, ‘guix home import’ will generate a service declaration like this
(service
home-bash-service-type
(home-bash-configuration
(bashrc
(list (slurp-file-gexp
(local-file "/home/yoctocell/.bashrc"))))))
but when running ‘guix home reconfigure’, the ~/.bashrc file would be moved, so
when running ‘guix home reconfigure’ for the second time, it would read the
~/.bashrc which is itself a symlink to a file the store.
* guix/scripts/home/import.scm (generate-bash-module+configuration): Take
‘destination-directory’ parameter
(modules+configurations): Copy the user’s configuration file to
‘%destination-directory’.
* guix/scripts/home.scm (process-command): Adjust accordingly; create
‘destination’ if it doesn’t exist.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
The previous behavior was confusing: a warning would be printed and
'guix shell' would go on starting an empty environment.
Reported by Tobias Geerinckx-Rice <me@tobias.gr>.
* guix/scripts/shell.scm (auto-detect-manifest): Change "not loading"
case from warning to error.
* tests/guix-shell.sh: Adjust accordingly.
Previously 'guix search' & co. would crash when encountering invalid
Texinfo.
* guix/ui.scm (texi->plain-text*): New procedure.
(package-field-string, package->recutils): Use it.
This is a followup to b19250eec6,
providing a proper fix for <https://issues.guix.gnu.org/46756>.
* guix/remote.scm (remote-eval): Revert b19250eec6.
* guix/store.scm (build-accumulator): Turn into a procedure. Call
CONTINUE when the store is not eq? to the initial store.
(map/accumulate-builds): Adjust accordingly.
* tests/store.scm ("map/accumulate-builds and different store"): New test.
Fixes <https://issues.guix.gnu.org/46756>.
Reported by pkill9 <pkill9@runbox.com>,
Maxim Cournoyer <maxim.cournoyer@gmail.com>, and
Katherine Cox-Buday <cox.katherine.e@gmail.com>.
* guix/remote.scm (remote-eval): When BUILD-LOCALLY? is false, wrap
'build-derivations' call in 'with-build-handler'.
In particular, libutil is not found when running code on a
statically-linked Guile.
Reported by mahmooz on #guix.
* guix/build/syscalls.scm (syscall->procedure): Add #:library parameter
and honor it.
(openpty, login-tty): Use 'syscall->procedure' instead of calling
'dynamic-link' directly.
* guix/scripts/shell.scm (hint-directory, hint-file, record-hint)
(hint-given?): New procedures.
(guix-shell): Record and probe the 'shell-check' hint.
With this change, the wall-clock time of:
./pre-inst-env guile -c '(use-modules (gnu) (guix)(ice-9 time)) (time (pk (fold-packages (lambda (p r)(supported-package? p)(+ 1 r)) 0)))'
goes from 3.2s to 2.0s, a 37% improvement.
* guix/packages.scm (package-transitive-supported-systems): Change
'supported-systems' to 'supported-systems-procedure', returning an
'mlambdaq' instead of the original 'mlambda'. Add 'procs'. Adjust body
accordingly.
shell: Maintain a profile cache.
With this change, running "guix shell" (no arguments) is equivalent to:
guix environment -r ~/.cache/guix/profiles/some-root -l guix.scm
This is the cache miss. On cache hit, it's equivalent to:
guix environment -p ~/.cache/guix/profiles/some-root
... which can run in 0.1s.
* guix/scripts/shell.scm (options-with-caching): New procedure.
(parse-args): Use it.
(%profile-cache-directory): New variable.
(profile-cache-key, profile-cached-gc-root): New procedures.
(show-help, %options): Add '--rebuild-cache'.
(guix-shell)[cache-entries, entry-expiration]: New procedures.
Add call to 'maybe-remove-expired-cache-entries'.
* doc/guix.texi (Invoking guix shell): Document '--rebuild-cache'.
This further speeds up the 'guix environment -p PROFILE' case.
* guix/scripts/environment.scm (guix-environment*)[store-needed?]: New
variable.
[with-store/maybe]: New macro.
Use it instead of 'with-store', and remove 'with-build-handler' form.