Fixes <http://bugs.gnu.org/21536>.
Reported by Alex Kost <alezost@gmail.com>.
* guix/ui.scm (texi->plain-text): Wrap body in 'with-fluids'.
* tests/ui.scm ("package-description-string vs. Unicode"): New test.
Fixes a regression introduced in a8be7b9a.
* guix/build/download.scm (store-path-abbreviation): Return STORE-PATH
if it's not an actual store path. Fixes an out-of-range exception
when running tests/substitute.scm and tests/store.scm.
* guix/build/download.scm
(string-pad-middle): Allow resulting padded string to overflow.
(store-url-abbreviation): Remove unnecessary procedure.
(progress-proc): Use BASENAME as default for parameter 'abbreviation'.
(url-fetch): Display extra newlines for readability.
Fixes a regression introduced in b7c7c03eb5.
* guix/build/emacs-build-system.scm (package-name-version->elpa-name-version):
Remove unused 'name' binding. Do not abuse 'strip-store-file-name' to
remove the "emacs-" prefix, which worked before b7c7c03eb5 but not after.
* guix/scripts/lint.scm (%hanging-paren-rx): New variable.
(report-lone-parentheses): New procedure.
(%formatting-reporters): Use it.
* tests/lint.scm ("formatting: lonely parentheses"): New test.
* guix/build/download.scm
(string-pad-middle, store-url-abbreviation, store-path-abbreviation):
New procedures.
(progress-proc): Add #:abbreviation parameter and use it. Generate a
better indeterminate progress string.
* guix/scripts/substitute.scm (assert-valid-narinfo): Add newlines to output.
(process-substitution): Use byte-count->string and store-path-abbreviation.
Co-authored-by: Ludovic Courtès <ludo@gnu.org>
Fixes <http://bugs.gnu.org/21451>.
Reported by Steve Sprang <steve.sprang@gmail.com>.
* guix/scripts/system.scm (guix-system)[option-arguments]: Error out
when ACTION is #f.
Previously, the Ruby build system only knew how to work with gem archives,
which made it difficult to build unreleased gems from a Git repository or
released gems in tarball form.
* gnu/build/ruby-build-system.scm (gnu:unpack, gem-archive?): New procedures.
(unpack): Use GNU build system unpack phase for non-gem sources.
(build): Rebuild the gemspec iff the source is a gem archive.
* guix.texi ("ruby-build-system"): Mention that tarballs and directories are
acceptable.
* guix/scripts/build.scm (%default-log-urls): New variable.
(log-url): New procedure.
(guix-build): Use it.
* doc/guix.texi (Invoking guix build): Document it.
* guix/build/download.scm (seconds->string): New function.
(byte-count->string): New function.
(progress-bar): New function.
(throughput->string): Remove function.
(progress-proc): Display base file name, elapsed time, and progress bar.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Provide support for Texinfo's markup in package description.
* guix/ui.scm (%text-width): New parameter.
(texi->plain-text): New variable.
(package->recutils): Use them.
(package-description-string): New variable.
* emacs/guix-main.scm (%package-param-alist): Use it.
* gnu/packages/perl.scm (perl-devel-globaldestruction)
(perl-devel-lexalias, perl-exporter-lite): Adapt to Texinfo's markup.
* gnu/packages/python.scm (python2-empy): Likewise.
The intent is to make 'clone' behave a lot more like 'primitive-fork', which
calls clone(2) with SIGCHLD, CLONE_CHILD_CLEARTID, and CLONE_CHILD_SETTID
flags. Notably, running 'clone' at the REPL without these flags would break
the REPL beyond repair.
* guix/build/syscalls.scm (CLONE_CHILD_CLEARTID, CLONE_CHILD_SETTID): New
variables.
* gnu/build/linux-container.scm (namespaces->bit-mask): Add
CLONE_CHILD_CLEARTID and CLONE_CHILD_SETTID to bit mask.
Having the hash of the source gem in the source directory file name proved to
be problematic when running the test suite for the 'pg' gem that creates
UNIX-domain sockets in the source directory and exceeded the 108 character
limit on GNU/Linux systems.
* guix/build/ruby-build-system.scm (unpack): Rename unpacked gem directory to
"gem".
This is a followup to commit 92226a470d.
* guix/packages.scm (patch-and-repack)[build]: Determine if tar supports the
"--sort=name" option using a run-time test. If not supported, generate the
sorted file list with 'find-files' and pass it to tar using "--files-from".
Reported by Andy Wingo <wingo@igalia.com>.
* guix/monads.scm (define-lift) <fallback case>: Add missing #'. Remove
extra formal parameter.
* tests/monads.scm ("lift"): Add test with 'lift1' as a procedure.
* guix/scripts/publish.scm (narinfo-string): Catch 'system-error' around
'load-derivation' call; return BASE-INFO upon ENOENT. This allows us
to return the narinfo even if DERIVER is missing. Before that, the
exception would be uncaught, leading to 500 Internal Error on the
client side.
* guix/gexp.scm (%mkdir-p-definition): Remove.
(%utils-module): New variable.
(imported-files, compiled-modules): Have gexp load %UTILS-MODULE
instead of using %MKDIR-P-DEFINITION.
* guix/import/gem.scm (make-gem-sexp): Properly handle an empty list of
licenses. When rendering a list of licenses, cons 'list onto the front of
the expression.
* tests/gem.scm: New file.
* Makefile.am (SCM_TESTS): Add it.
* guix/build/utils.scm (strip-store-file-name): New procedure.
* guix/build/emacs-build-system.scm (store-directory->name-version):
Remove. Update callers to use 'strip-store-file-name'.
* gnu/packages/gcc.scm (make-libstdc++-doc)[arguments]: Use
'strip-store-file-name' instead of 'string-drop'.
* guix/build/gnu-build-system.scm (gnu-build)[elapsed-time]: New
procedure.
Use it, and use (current-time time-monotonic) instead
of (gettimeofday). Show one digit after the comma for the elapsed
time.
This significantly reduces churn in the store. It also reduces run time
of 'guix build inkscape -Sd' by ~10%.
* guix/download.scm (url-fetch)[mirror-file]: New variable.
[builder]: Get URL from the "guix download url" env. var. Get the mirrors
from MIRROR-FILE. Pass #:script-name and #:env-vars to 'gexp->derivation'.
* guix/import/pypi.scm (make-pypi-sexp): Factorize license to symbol
conversion code.
(string->license, snake-case, guix-hash-url): Move from here...
* guix/import/utils.scm: ... to here.
(license->symbol): New procedure.
* guix/gexp.scm (lower-object): New procedure.
(lower-inputs, lower-references, gexp->sexp): Use it.
* tests/gexp.scm ("lower-object"): New test.
* doc/guix.texi (G-Expressions): Document it.
* guix/scripts/package.scm (show-help): Add help text for --install-from-file
option.
(%options): Add --install-from-file option.
* tests/guix-package.sh: Test it.
* doc/guix.texi ("invoking guix package"): Document it.
* doc/package-hello.scm: New file.
* doc.am (EXTRA_DIST): Add it.
This removes all I/O, which obviously makes things faster.
* guix/scripts/size.scm (file-size, store-item-exists?): Remove.
(query-path-info*): New procedure.
(file-size*): Rename to...
(file-size): ... this; adjust caller. Use 'query-path-info*' instead of
'file-size'.
On systems with a glibc prior to 2.14, the 'setns' function is not available.
Thanks to Eric Bavier for reporting the issue.
* guix/build/syscalls.scm (setns): Wrap with 'false-if-exception'.
Reported by Eric Dvorsak <eric@dvorsak.fr> on #guix.
* guix/scripts/import/elpa.scm (%default-options): Remove redundant
quote which led to an error if --archive option was not specified.
Based on discussions with Rohan Prinja <rohan.prinja@gmail.com>.
* guix/build/syscalls.scm (<interface>): New record type.
(write-interface, values->interface, unfold-interface-list,
network-interfaces, free-ifaddrs): New procedures.
(ifaddrs): New C struct.
(%struct-ifaddrs-type, %sizeof-ifaddrs): New macros.
* tests/syscalls.scm ("network-interfaces returns one or more interfaces",
"network-interfaces returns \"lo\""): New tests.
* guix/build/syscalls.scm (alignof*, align): New macros.
(write-types, read-types): Use 'align' to compute the actual offset to
read/write a value of TYPE0.
* guix/build/syscalls.scm (PF_PACKET, AF_PACKET): New variables.
(read-socket-address): Make 'index' optional. Return (vector FAMILY) when
FAMILY is neither AF_INET nor AF_INET6.