* guix/build/pull.scm (%default-optimizations)
(%lightweight-optimizations): New variables.
(optimization-options): New procedure. Taken from
build-aux/compile-all.scm.
(build-guix): Pass it to 'compile-file'.
Previously, 'guix pull' would always build with Guile 2.0.
Now it builds with the Guile that matches (effective-version).
* build-aux/build-self.scm (false-if-wrong-guile)
(package-for-current-guile): New procedures.
(guile-json, guile-ssh): Use it.
(guile-for-build): New procedure.
(build): Use (effective-version) instead of the hard-coded "/2.0".
Add (guix modules) closure to #:modules argument. Pass
\#:guile-for-build argument to 'gexp->derivation'.
* guix/build/pull.scm (depends-on-guile-ssh?, all-scheme-files): New
procedures.
(build-guix): Show the output of (version). Use the above procedures.
Filter out files that match 'depends-on-guile-ssh?' when (ssh session)
is missing.
Reported by Niall Dooley <dooleyn@gmail.com>
in <https://lists.gnu.org/archive/html/help-guix/2017-05/msg00038.html>.
* guix/scripts/pull.scm (%options): Add --dry-run and all of
%STANDARD-BUILD-OPTIONS.
(show-help): Add call to 'show-build-options-help'.
(%default-options): Add 'system', 'substitutes?', 'graft?',
'max-silent-time', and 'verbosity'.
(guix-pull)[parse-options]: Remove.
Use 'parse-command-line' instead. Honor --dry-run.
Previously, it the predicate would return #t for "m4/ChangeLog" if
"ChangeLog" (in the top-level directory) was in FILES. This commit
fixes the ambiguity.
* guix/git-download.scm (git-predicate): Add 'inodes' variable. Use it
to determine file membership.
* gnu/system/grub.scm (boot-parameters->menu-entry): New variable.
(grub-configuration-file): Use boot-parameters
instead of menu-entry where possible.
* guix/scripts/system.scm (profile-boot-parameters): Update docstring.
(reinstall-grub): Use profile-boot-parameters.
(perform-action): Use profile-boot-parameters.
* gnu/system.scm (read-boot-parameters): Remove export.
(read-boot-parameters-file): New variable. Export it.
* guix/scripts/system.scm (profile-boot-parameters): Use
read-boot-parameters-file.
(profile-grub-entries): Use read-boot-parameters-file.
(reinstall-grub): Use read-boot-parameters-file.
(display-system-generation): Use read-boot-parameters-file.
* guix/scripts/refresh.scm (maybe-updater, list-updaters): Remove.
(importer-modules): New procedure.
(%updaters): Define using 'fold-module-public-variables'. Turn into a
promise and adjust users.
* guix/monads.scm (%templates, %template-instances): New variables.
(register-template!, register-template-instance!): New procedures.
(template-directory, define-template): New macro.
(foldm, sequence, anym): Define using 'define-template'. Avoid replace
ellipses with dots.
(mapm): Likewise, but do not use 'foldm'.
* guix/store.scm: Add 'template-directory' invocation.
This allows us to download from site such as
<https://fusionforge.int-evry.fr> where the server does not recognize
the server name passed via the 'server_name' extension.
* guix/build/download.scm (tls-wrap): Catch 'gnutls-error' around
'handshake'. Upon ERROR/WARNING-ALERT-RECEIVED, print a message and
call 'handshake'.
* guix/scripts/publish.scm (narinfo-string): Add #:file-size parameter.
Produce a "FileSize" field when COMPRESSION is eq? to '%no-compression'
or when FILE-SIZE is true.
(bake-narinfo+nar): Pass #:file-size.
* tests/publish.scm ("/*.narinfo")
("/*.narinfo with properly encoded '+' sign")
("with cache"): Check for "FileSize".
* guix/scripts/refresh.scm (list-dependents)[full-name]: New procedure.
Use 'full-name' instead of 'package-full-name'.
* doc/guix.texi (Invoking guix refresh): Adjust example accordingly.
Reported by Mark H Weaver <mhw@netris.org>
at <https://lists.gnu.org/archive/html/guix-devel/2017-04/msg00457.html>.
* guix/derivations.scm (build-expression->derivation): Use a string
output port for the expression. This reverts part of
2dce88d5bb.
* tests/derivations.scm ("build-expression->derivation and builder
encoding"): New test.
This allows 'guix' commands to talk to a remote store over SSH.
* guix/store.scm (connect-to-daemon)[connect]: Call 'resolve-interface'
for unknown URI schemes.
* guix/store/ssh.scm: New file.
* Makefile.am (MODULES): Add it.
* doc/guix.texi (The Store): Document it. Mark remote access as
experimental.
On Guile 2.2.1, this yields a 5% speedup on:
guix build libreoffice xmonad certbot -n --no-substitutes --no-build-hook
* guix/derivations.scm (derivation->string): Rename to...
(derivation->bytevector): ... this. Use 'open-bytevector-output-port'
instead of 'call-with-output-string'.
(derivation-hash): Remove string-to-bytevector conversion before
'sha256' call.
(build-expression->derivation): Use 'add-data-to-store' and an
bytevector port instead of a string port for the expression.
Suggested by Quiliro <quiliro@riseup.net>
in <https://bugs.gnu.org/26567>.
* guix/scripts/publish.scm (render-home-page): New procedure.
(make-request-handler): Handle it.
* guix/scripts/publish.scm (narinfo-files): New procedure.
(render-narinfo/cached)[delete-file]: New procedure. Add call to
'maybe-remove-expired-cache-entries'.
* doc/guix.texi (Invoking guix publish): Document the interation between
--cache and --ttl.
* guix/cache.scm, tests/cache.scm: New files.
* Makefile.am (MODULES, SCM_TESTS): Add them.
* guix/scripts/substitute.scm (obsolete?): Remove.
(remove-expired-cached-narinfos): Rename to...
(cached-narinfo-expiration-time): ... this. Remove the removal part and
only keep the expiration time part.
(narinfo-cache-directories): Add optional 'directory' parameter and
honor it.
(maybe-remove-expired-cached-narinfo): Remove.
(cached-narinfo-files): New procedure.
(guix-substitute): Use 'maybe-remove-expired-cache-entries' instead of
'maybe-remove-expired-cached-narinfo'.
Fixes <http://bugs.gnu.org/26201>.
Reported by <dian_cecht@zoho.com>.
These options allow nars to be "baked" off-line and cached instead of
being compressed on the fly. As a side-effect, this allows us to
provide a 'Content-Length' header for nars.
* guix/scripts/publish.scm (show-help, %options): Add '--cache' and
'--workers'.
(%default-options): Add 'workers'.
(nar-cache-file, narinfo-cache-file, run-single-baker): New procedures.
(single-baker): New macro.
(render-narinfo/cached, bake-narinfo+nar)
(render-nar/cached): New procedures.
(make-request-handler): Add #:cache and #:pool parameters and honor
them.
(run-publish-server): Likewise.
(guix-publish): Honor '--cache' and '--workers'.
* tests/publish.scm ("with cache"): New test.
* doc/guix.texi (Invoking guix publish): Document it.
* guix/scripts/system.scm (%options, show-help): Adjust accordingly.
Keep "--no-grub" for compatibility reasons, but do not mention it in the help.
Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
Reported by Mathieu Othacehe <m.othacehe@gmail.com>
at <http://bugs.gnu.org/26498>.
* guix/scripts/lint.scm (warn-if-package-has-input): Rename to...
(package-input-intersection): ... this. Remove 'linted' and 'message'
parameters. Return a list of inputs.
(check-inputs-should-be-native): Adjust accordingly.
(check-inputs-should-not-be-an-input-at-all): Likewise.
* guix/scripts/system.scm (profile-boot-parameters): New variable.
(reinstall-grub): Use profile-boot-parameters.
(perform-action): Use profile-boot-parameters.
Follow-up to 2e58e05bb6.
* guix/scripts/system.scm (save-load-path-excursion,
save-environment-excursion): Move definitions to the top of the file.
It allows to use them in the whole file.
Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
* guix/scripts/system.scm (save-load-path-excursion,
save-environment-excursion): Move definitions to the top of the file.
It allows to use them in the whole file.
Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
* guix/build/cargo-build-system.scm (generate-checksums): Remove store
reference from comment. This comment was matching
assert-no-store-file-names regexp in Makefile.am.
Also, edit procedure docstring to precise that DIR-NAME is a store
directory.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* guix/monads.scm (mwhen, munless): Rename parameters from 'exp0' and 'exp' to
'mexp0' and 'mexp', respectively. This makes it more obvious that these
expressions must be monadic expressions.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* guix/build/syscalls.scm (mount): Use Guile core mount if called from
static Guile, otherwise use FFI based mount implementation.
(umount): Ditto.
This allows to use (guix build syscalls) from a module independently
of calling context.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
The mandb database file (index.db) is used by the "apropos" (whatis) or
"man -k" commands. This change introduces a profile hook to generate
such database file.
* guix/profiles.scm (manual-database): New procedure.
(%default-profile-hooks): Add it.
Co-authored-by: Ludovic Courtès <ludo@gnu.org>
* guix/build-system/python.scm (package-with-explicit-python)
[package-variant, cut?]: New procedures.
[transform]: Remove 'mlambdaq' form and input tuple handling.
Use 'package-mapping'.
* guix/packages.scm (package-mapping): New procedure.
(package-input-rewriting): Rewrite in terms of 'package-mapping'.
* tests/packages.scm ("package-mapping"): New test.
* doc/guix.texi (Defining Packages): Document it.
Fixes test failures related to xz compression in tests/utils.scm.
This is a followup to commit 63102406f2.
* guix/utils.scm (decompressed-port, compressed-port, compressed-output-port):
Split each shell argument into its own list element.
Reported by Thomas Sigurdsen <thomas.sigurdsen@gmail.com>
at <https://lists.gnu.org/archive/html/help-guix/2017-04/msg00007.html>.
* guix/packages.scm (expand-input): Add 'guard' form around call to
'package-source-derivation'.
* tests/packages.scm (dummy): New test.
* gnu/packages/bioinformatics.scm (python-pysam)[arguments] <check>:
Use (negate proc) instead of (compose not proc).
* guix/import/cran.scm (recursive-import): Likewise.
* guix/import/elpa.scm (filter-dependencies): Use 'remove' instead of
'(filter (compose not proc) ...)'.
Fixes a regression introduced in
a4f5423415.
Reported by Hartmut Goebel.
* guix/build/download.scm (ftp-fetch): Account for the case where
'uri-userinfo' returns #f. Remove the case where it returns "" since
that cannot happen.
This avoids connections to substitute servers for derivations that are
not substitutable anyway, such as profiles.
Reported by Andy Wingo.
* guix/derivations.scm (substitution-oracle): Skip derivations that do
not pass 'substitutable-derivation?'.
* tests/derivations.scm ("substitution-oracle and #:substitute? #f"):
New test.
* guix/ui.scm (package-field-string): New procedure.
(package-description-string): Use it.
(package-synopsis-string): New procedure.
(package->recutils): Use it.
* guix/scripts/lint.scm (check-synopsis-style)[check-texinfo-markup]:
New procedure. Use it in checks.
* tests/lint.scm: Test it.
* gnu/packages/perl.scm (perl-try-tiny)[synopsis]: Adjust for the
Texinfo markup.
* guix/build/download.scm (open-connection-for-uri): Add note about
same-named binding in Guile 2.2.0.
* guix/http-client.scm: Use 'guix:open-connection-for-uri' for the
procedure coming from (guix build download).
* guix/scripts/lint.scm: Likewise.
* guix/scripts/substitute.scm: Likewise.
* guix/scripts/pack.scm (self-contained-tarball): Add #:target.
(docker-image): Add #:target.
[build]: Pass it to 'build-docker-image'.
(%options, show-help): Add '--target'.
(guix-pack): Pass TARGET to 'profile-derivation' and to 'build-image'.
* guix/docker.scm (build-docker-image): Add #:system parameter and honor it.
* doc/guix.texi (Invoking guix pack): Document '--target'.
(Additional Build Options): Refer to the Autoconf manual instead of the
obsolete 'configure.info' for cross-compilation.
* guix/scripts/pack.scm (<compressor>)[package]: Remove.
[command]: Document as being a gexp with an absolute file name.
(%compressors): Adjust accordingly.
(self-contained-tarball): Simplify PATH expression. Move 'string-join'
for the compressor command on the build side.
(docker-image): Simplify PATH expression.
* tests/pack.scm (%gzip-compressor): Adjust accordingly.
* guix/build/cargo-build-system.scm (configure): Remove proprietary
dependencies. Add rust dependencies and configure Cargo to find them.
(build): Also build libraries, not just applications.
(file-sha256): New variable.
(generate-checksums): New variable. Export it.
(touch): New variable.
(install): Generate checksums so Cargo accepts the package.
* guix/gexp.scm (imported-files)[file-pair]: Add case for pairs where
the cdr is not a string.
(imported-modules): Support '=>' syntax in MODULES.
* tests/gexp.scm ("imported-files with file-like objects")
("gexp->derivation & with-imported-module & computed module"): New tests.
* doc/guix.texi (G-Expressions): Document '=>' syntax for
'with-imported-modules'.
Before that, something like:
(call-with-container
(lambda ()
(match (primitive-fork)
…)))
would hang in 'primitive-fork' as the child process (the one started in
the container) would try to pthread_join the finalization thread in
'stop_finalization_thread' in libguile, not knowing that this thread is
nonexistent.
* guix/build/syscalls.scm (%set-automatic-finalization-enabled?!): New
procedure.
(without-automatic-finalization): New macro.
(clone): Wrap PROC call in 'without-automatic-finalization'.
In 2.2, 'fport_close' no longer swallows EBADF and instead raises a
'system-error' for this. This commit adjusts for 2.2.
* guix/zlib.scm (close-procedure): Remove.
(make-gzip-input-port): Use 'port->fdes' instead of 'fileno'.
Use 'gzclose' instead of 'close-procedure'.
(make-gzip-output-port): Likewise.
* tests/zlib.scm ("compression/decompression pipe"): Don't check whether
PARENT is closed using 'port-closed?'. Instead, use 'seek' on the
underlying FD and check for EBADF.
* guix/scripts/pack.scm (self-contained-tarball): Add #:tar option.
[build](tar-supports-sort?): New variable. Use it.
* tests/pack.scm: New file.
* Makefile.am (SCM_TESTS): Add it.
* guix/scripts/pack.scm (<compressor>)[tar-option]: Remove.
[command]: New field.
(%compressors): Provide complete commands. Use '-9' or equivalent for
each compressor; use '-n' for gzip.
(self-contained-tarball)[build]: Adjust accordingly.
* guix/scripts/pack.scm (self-contained-tarball): Add #:localstatedir?
parameter and honor it.
(%options, show-help): Add '--localstatedir'.
(guix-pack): Honor it.
* gnu/build/install.scm (populate-single-profile-directory): Add
#:register? parameter and honor it.
* doc/guix.texi (Binary Installation): Use '--localstatedir' in
example.
(Invoking guix pack): Document it.
* guix/build/syscalls.scm (define-bits): Do not define NAMES... as
top-level variables since that prevents literal matches in 2.2.
Instead, determine constant values at expansion time.
Fixes a regression introduced in 7447aa36e1.
Reported by Ricardo Wurmus.
* guix/utils.scm: Revert 7447aa36e1. Use
#:prefix for (ice-9 iconv) to support both 2.0 and 2.2.
In Guile 2.2, (rnrs io ports) exports 'bytevector->string', which
conflicts with that of (ice-9 iconv).
* guix/utils.scm: Hide 'bytevector->string' from (rnrs io ports).
* guix/ui.scm (right-arrow): Call 'set-port-encoding!' to set PORT's
encoding; remove use of 'with-fluids'. This is for compatibility with
Guile 2.2 where the encoding of string ports is not influenced by
%DEFAULT-PORT-ENCODING.
* tests/ui.scm ("show-manifest-transaction"): Likewise.
* guix/ui.scm (fill-paragraph): Don't use '_' as a pattern variable
since that is shadowed by the top-level '_' binding on Guile 2.2.
(show-manifest-transaction): Likewise.