Commit Graph

5681 Commits

Author SHA1 Message Date
Ludovic Courtès
673e5276f6
http-client: Don't drop failed query when reconnecting.
Reported by Christopher Baines <mail@cbaines.net>.

* guix/http-client.scm (http-multiple-get): Change 2nd argument to
'drop' to PROCESSED when (false-if-networking-error ...) returns #f.
2021-03-28 22:30:59 +02:00
Ludovic Courtès
45fce38fb0
http-client: 'http-multiple-get' is tail-recursive again.
Fixes <https://bugs.gnu.org/47283>.

Commit 205833b72c5517915a47a50dbe28e7024dc74e57 made 'http-multiple-get'
non-tail-recursive.  Each recursive call would install an exception
handler.  As the number of iterations grows beyond 1,000, quadratic
complexity of 'raise-exception' would show and we'd spend most of our
time there.

* guix/http-client.scm (false-if-networking-error): New macro.
(http-multiple-get): Use it around 'write-request' and 'put-bytevector'
calls, and around 'read-response' call, in lieu of the inline 'catch'
forms.
2021-03-27 22:52:51 +01:00
Ludovic Courtès
96aa98b6ca
import: print: Improve origin method name guesswork.
Fixes <https://bugs.gnu.org/47375>.
Reported by Léo Le Bouter <lle-bout@zaclys.net>.

* guix/import/print.scm (package->code): For METHOD, use 'variable-name'
preferably, and call 'procedure-name' as a last resort.
2021-03-26 00:04:04 +01:00
Ludovic Courtès
4ac3e010c9
lint: archival: Gracefully handle packages with a #f hash value.
Fixes <https://bugs.gnu.org/47293>.
Reported by Luis Felipe.

* guix/lint.scm (check-archival): Check whether 'content-hash-value'
returns true.
2021-03-26 00:04:04 +01:00
Chris Marusich
93f21e1a35
utils: Fix target-64bit? on powerpc64le-linux.
* guix/utils.scm (target-64bit?): Change the string from "ppc64" to
"powerpc64", which matches Guix system names like "powerpc64le-linux".
2021-03-23 23:19:58 -07:00
Chris Marusich
c29bfbfc78
syscalls: Fix RNDADDTOENTCNT on powerpc64le-linux.
This fixes the failing test add-to-entropy-count in tests/syscalls.scm on
powerpc64le-linux.

* guix/build/syscalls.scm (RNDADDTOENTCNT): When %host-type starts with
"powerpc64le", set this to #x80045201.  Otherwise, set it to #x40045201 as
before.
2021-03-23 23:19:58 -07:00
Chris Marusich
b57de27d03
syscalls: Fix clone on powerpc64le-linux.
This makes the clone procedure work correctly and fixes some test failures on
powerpc64le-linux, including tests/containers.scm.

* guix/build/syscalls.scm (clone): Add an entry for ppc64le.
2021-03-23 23:19:57 -07:00
Chris Marusich
a16eb6c5f9
Add powerpc64le-linux as a supported Guix architecture.
This makes powerpc64le-linux a supported architecture for Guix, but not for
Guix System.

* Makefile.am (SUPPORTED_SYSTEMS): Add an entry for powerpc64le-linux.
* etc/guix-install.sh (chk_sys_arch): Same.
* guix/packages.scm (%supported-systems): Same.
* m4/guix.m4 (GUIX_ASSERT_SUPPORTED_SYSTEM): Same.
* tests/guix-build.sh (all_systems): Same.
2021-03-23 23:19:57 -07:00
Chris Marusich
fc7cf0c1ec
utils: Add target-powerpc? procedure.
* guix/utils.scm (target-powerpc?): New exported procedure.
2021-03-23 23:19:55 -07:00
Ludovic Courtès
cab1831528
gnu-maintenance: Exclude GNU Radio from the 'gnu-ftp' updater predicate.
'gnu-ftp' would only list old GNU Radio releases since new releases are
no longer uploaded to ftp.gnu.org.  With this change, 'generic-html' is
picked up instead.

* guix/gnu-maintenance.scm (pure-gnu-package?): Return #f for GNU Radio.
2021-03-21 23:41:02 +01:00
Ludovic Courtès
9da5ec7099
substitute: Choose compression method based on past CPU usage.
This stems from the observation that substitute download can be
CPU-bound when high-speed networks are in use:

  https://lists.gnu.org/archive/html/guix-devel/2020-12/msg00177.html

* guix/narinfo.scm (decompresses-faster?): New procedure.
(narinfo-best-uri): Add #:fast-decompression?.
* guix/scripts/substitute.scm (%prefer-fast-decompression?): New
variable.
(call-with-cpu-usage-monitoring): New procedure.
(with-cpu-usage-monitoring): New macro.
(display-narinfo-data, process-substitution): Pass #:fast-decompression?
to 'narinfo-best-uri'.
(process-substitution): Wrap 'restore-file' call in
'with-cpu-usage-monitoring'.  Set '%prefer-fast-decompression?'.
2021-03-21 23:41:01 +01:00
Ludovic Courtès
1710e8cb59
gnu-maintenance: Accept underscores as package/version separators.
Fixes <https://bugs.gnu.org/47256>.
Reported by Léo Le Bouter <lle-bout@zaclys.net>.

* guix/gnu-maintenance.scm (%tarball-rx, %package-name-rx): Accept
underscore as the package/version separator in tarball names.
* tests/gnu-maintenance.scm ("release-file?"): Add "mediainfo" test.
2021-03-20 22:29:14 +01:00
Ludovic Courtès
43937666ba
download: 'tls-wrap' treats premature TLS termination as EOF.
This is a backport of Guile commit
076276c4f580368b4106316a77752d69c8f1494a.

* guix/build/download.scm (tls-wrap)[read!]: Wrap 'get-bytevector-n!'
call in 'catch' and handle 'error/premature-termination' GnuTLS errors.
2021-03-19 21:44:36 +01:00
Ludovic Courtès
813cddfa57
build-system/node: Remove unnecessary imports.
* guix/build-system/node.scm: Remove unnecessary imports.
2021-03-19 13:23:27 +01:00
Ludovic Courtès
f7008ca713
download: Autoload (guix build download).
* guix/download.scm: Autoload (guix build download).
(url-fetch): Rename to...
(url-fetch*): ... this, locally, to allow for #:autoload.
* guix/status.scm: Autoload (guix build download).
2021-03-19 13:23:27 +01:00
Ludovic Courtès
c1940fde43
git-download: Autoload Guile-Git.
* guix/git-download.scm: Autoload (git ...) modules.
2021-03-19 13:23:27 +01:00
Ludovic Courtès
065d832fc2
guix package: Autoload Guile-JSON and (guix describe).
* guix/scripts/build.scm: Autoload (guix import json).
* guix/scripts/package.scm: Autoload (guix import json) and (guix
describe).
2021-03-19 13:23:27 +01:00
Ludovic Courtès
4f04155232
guix describe: Autoload Guile-JSON.
* guix/scripts/describe.scm: Autoload (json).
2021-03-19 13:23:27 +01:00
Ludovic Courtès
a0f83602f8
gnu-maintenance: Better handle empty #:directory for 'latest-html-release'.
In particular, this makes sure we don't add a trailing slash when the
user specified a 'release-monitoring-url' property for the
'generic-html' updater.

* guix/gnu-maintenance.scm (latest-html-release): When DIRECTORY is
empty, do not append it.
2021-03-19 13:23:26 +01:00
Christopher Baines
806125e52f
weather: Only show request statistics when requests were made.
This avoids the script crashing if all data is fetched from the cache.

* guix/scripts/weather.scm (report-server-coverage): Only show request
statistics when some requests have been made.
2021-03-17 23:12:31 +00:00
Ludovic Courtès
62c1b0b744
import: gnome: Silence URL redirect messages.
* guix/import/gnome.scm (latest-gnome-release): Pass #:log-port to
'http-fetch/cached'.
2021-03-17 23:10:19 +01:00
Ludovic Courtès
dbfc6a32bb
http-client: 'http-fetch' and 'http-fetch/cached' accept #:log-port.
* guix/http-client.scm (http-fetch, http-fetch/cached): Add #:log-port
and honor it.
2021-03-17 23:10:19 +01:00
Ludovic Courtès
c81eeabb99
import: gnome: Exclude version numbers that do not start with a digit.
Fixes a bug whereby NetworkManager would be updated to version "rc2".

* guix/import/gnome.scm (latest-gnome-release)[even-minor-version?]:
Change catch-all case to return #f when the first part is not a digit.
2021-03-17 23:10:19 +01:00
Christopher Baines
c37f78a9f5
scripts: weather: Provide more representative request statistics.
Previously, the "seconds per request" and "requests per second" statistics
really reported (cache lookups + requests) per second.  By looking at the
actual number of requests made within lookup-narinfos, a more representative
value can be reported.

* guix/scripts/weather.scm (let/time): Allow for multiple return values.
(report-server-coverage): Alter the reporting of request statistics.
2021-03-17 20:46:21 +00:00
Christopher Baines
c5ab78f90b
substitutes: lookup-narinfos: Return the number of requests made.
As an additional value, in addition to the narinfos.  This value is useful in
the weather script for reporting how many requests to the substitute server
were made.

* guix/substitutes.scm (lookup-narinfos): Additionally return the number of
requests made.
2021-03-17 20:46:20 +00:00
Christopher Baines
b48204259a
scripts: substitute: Tweak error reporting in process-substitution.
The call-with-connection-error-handling was added in
20c08a8a45d0f137ead7c05e720456b2aea44402, but that error handling was
previously inside of open-connection-for-uri/maybe, which is related
to (call-)with-cached-connection which was used in process-substitution, but
only actually used with call-with-cached-connection when used in
fetch-narinfos.

There's some handling for similar errors within with-networking, which is used
within process-substitution.

* guix/scripts/substitute.scm (process-substitution): Remove
call-with-connection-error-handling call.
2021-03-17 20:41:13 +00:00
Christopher Baines
c37e3b92ad
scripts: substitute: Add back some error handling.
In f50f5751fff4cfc6d5abba9681054569694b7a5c, the way fetch was called within
process-substitution was changed.  As call-with-cached-connection actually
includes important error handling for the opening of a HTTP request, this
change removed some error handling.  This commit adds that back.

Fixes <https://bugs.gnu.org/47157>.

* guix/scripts/substitute.scm (call-with-cached-connection): New procedure.
(with-cached-connection): New syntax rule.
(process-substitution): Retry once for some errors when making HTTP requests
to fetch substitutes.
2021-03-17 20:41:10 +00:00
Ludovic Courtès
728c90862e
gnu-maintenance: Add a timeout on FTP connection establishment.
* guix/gnu-maintenance.scm (latest-ftp-release): Pass #:timeout to
'ftp-open'.
2021-03-17 12:03:25 +01:00
Ludovic Courtès
29330b57e2
gnu-maintenance: Remove unused parameters of 'latest-ftp-release'.
* guix/gnu-maintenance.scm (latest-ftp-release): Remove #:ftp-open, #:ftp-close,
and #:keep-file?.
2021-03-17 12:03:25 +01:00
Ludovic Courtès
af9af2180e
gnu-maintenance: Add 'generic-html' updater.
This brings total updater coverage, as reported by 'guix refresh
--list-updaters', from 78% to 88.3%.  Among many other things, it covers
freedesktop.org packages.

* guix/gnu-maintenance.scm (html-updatable-package?)
(latest-html-updatable-release): New procedures.
(%generic-html-updater): New variable.
* doc/guix.texi (Invoking guix refresh): Document it.
2021-03-17 12:03:24 +01:00
Ludovic Courtès
1d5a946ce5
gnu-maintenance: 'latest-html-release' better computes version number.
* guix/gnu-maintenance.scm (latest-html-release): Use 'tarball->version'
rather than 'package-name->name+version' to extract the version number.
This fixes problems with packages like 'netsurf' and 'libdom' that have
"-src" in their tarball name, where "src" would be taken as the new
version number.
2021-03-17 12:03:24 +01:00
Ludovic Courtès
99f42e14d4
gnu-maintenance: 'latest-html-release' can determine signature file name.
* guix/gnu-maintenance.scm (latest-html-release): #:file->signature
defaults to #f.
[file->signature/guess]: New procedure.
[url->release]: Use it when FILE->SIGNATURE is #f.
Introduce 'links' variable.
(url-prefix-rewrite): Check whether URL is true before calling
'string-prefix?'.
(latest-savannah-release): Adjust comment about detached signatures.
2021-03-17 12:03:24 +01:00
Ludovic Courtès
9e75b31b39
gnu-maintenance: 'release-file?' rejects checksum files.
* guix/gnu-maintenance.scm (release-file?): Reject ".md5sum",
".sha1sum", and ".sha256sum".
2021-03-17 12:03:24 +01:00
Ludovic Courtès
db69ebb9de
gnu-maintenance: 'latest-html-release' considers non-relative URLs.
* guix/gnu-maintenance.scm (latest-html-release): Allow for URL to be an
arbitrary URL rather than a relative URL reference.
2021-03-17 12:03:24 +01:00
Ludovic Courtès
71f6acd28d
gnu-maintenance: Use (htmlprag) for 'latest-html-release'.
* guix/gnu-maintenance.scm (html->sxml): Remove.  Autoload (htmlprag)
instead.
* doc/guix.texi (Requirements): Mention 'guix refresh' for the Guile-Lib
dependency.
2021-03-17 12:03:24 +01:00
Mark H Weaver
1a265842e6
gnu: Use PACKAGE/INHERIT in more places.
* gnu/packages/algebra.scm (fftwf, fftw-openmpi),
gnu/packages/audio.scm (ztoolkit-rsvg),
gnu/packages/bioinformatics.scm (python2-dendropy),
gnu/packages/boost.scm (boost-with-python2),
gnu/packages/check.scm (python2-mock, python2-pytest-mock),
gnu/packages/cups.scm (hplip-minimal),
gnu/packages/freedesktop.scm (libinput-minimal),
gnu/packages/gettext.scm (gnu-gettext),
gnu/packages/glib.scm (python2-pygobject),
gnu/packages/gnome.scm (gdl-minimal, libsoup-minimal, python2-pyatspi),
gnu/packages/groff.scm (groff-minimal),
gnu/packages/jami.scm (ffmpeg-jami),
gnu/packages/libcanberra.scm (libcanberra/gtk+-2),
gnu/packages/lirc.scm (python2-lirc),
gnu/packages/llvm.scm (clang-runtime-3.5),
gnu/packages/mpi.scm (java-openmpi, openmpi-thread-multiple),
gnu/packages/node.scm (libnode),
gnu/packages/onc-rpc.scm (libtirpc/hurd),
gnu/packages/python-compression.scm (bitshuffle-for-snappy),
gnu/packages/python-crypto.scm (python2-pycrypto, python2-cryptography)
(python2-cryptography, python2-m2crypto),
gnu/packages/python-web.scm (python2-html2text, python2-tornado)
(python2-terminado, python2-ndg-httpsclient, python2-websocket-client)
(python2-rauth, python2-url, python2-s3transfer),
gnu/packages/python-xyz.scm (python2-psutil, python2-serpent)
(python2-humanfriendly, python2-empy, python2-parse-type, python2-polib)
(python2-jsonschema, python2-pystache, python2-cython, python2-numpydoc)
(python2-ipyparallel, python2-traitlets, python2-dbus)
(python2-beautifulsoup4, python2-pep517, python2-flake8, python2-llfuse)
(python2-tlsh, python-file, python2-notebook, python-jupyter-console-minimal)
(python2-contextlib2, python2-promise, python2-anyjson, python2-amqp)
(python2-kombu, python2-billiard, python2-celery, python2-whoosh)
(python2-jellyfish, python-rope, ptpython-2, python2-binaryornot)
(python2-setproctitle, python2-argcomplete, python2-xopen, python2-isort)
(python2-radon, python2-rfc6555, python2-activepapers, python2-send2trash)
(python2-cloudpickle, python2-reparser),
gnu/packages/python.scm (python2-called-python),
gnu/packages/qt.scm (python2-sip, python-pyqt-without-qtwebkit, python2-pyqt)
(python-qscintilla, python-pyqt+qscintilla),
gnu/packages/scanner.scm (sane-backends),
gnu/packages/sdl.scm (guile3.0-sdl2),
gnu/packages/selinux.scm (checkpolicy, libselinux, libsemanage, secilc)
(python-sepolgen, policycoreutils),
gnu/packages/serialization.scm (lua5.1-libmpack, lua5.2-libmpack),
gnu/packages/simulation.scm (fenics),
gnu/packages/statistics.scm (python2-statsmodels),
gnu/packages/texinfo.scm (info-reader),
gnu/packages/wxwidgets.scm (wxwidgets-gtk2, wxwidgets-gtk2-3.1),
gnu/packages/xml.scm (xmlsec-nss),
gnu/packages/xorg.scm (uim-gtk, uim-qt),
guix/build-system/python.scm (package-with-explicit-python)
(strip-python2-variant): Use PACKAGE/INHERIT.
2021-03-17 03:58:10 -04:00
Chris Marusich
341dfe7eda
syscalls: mounts: Fix a matching bug.
On some systems, the columns in /proc/self/mountinfo look like this:

23 28 0:21 / /proc rw,nosuid,nodev,noexec,relatime shared:11 - proc proc rw

Before this change, the mounts procedure was written with the assumption that
the type and source could always be found in columns 8 and 9, respectively.
However, the proc(5) man page explains that there can be zero or more optional
fields starting at column 7 (e.g., "shared:11" above), so this assumption is
false in some situations.

* guix/build/syscalls.scm (mounts): Update the match pattern to use ellipsis
to match zero or more optional fields followed by a single hyphen.  Remove the
trailing ellipsis, since multiple ellipses are not allowed in the same level.
The proc(5) man page indicates that there are no additional columns, so it is
probably OK to match an exact number of columns at the end like this.
2021-03-15 21:22:43 -07:00
Efraim Flashner
78e7e178a3
build-system/cargo: Don't clobber packaged crates while building.
This fixes an issue where two packages share a common dependent.

* guix/build/cargo-build-system.scm (unpack-rust-crates): Only copy rust
crates into the target directory if there isn't one already there with
the same name.
2021-03-15 15:53:11 +02:00
Efraim Flashner
4d00185d66
build-system/cargo: Propagate crates across builds.
* guix/build-system/cargo.scm (cargo-build): Add cargo-package-flags,
install-source flags.
* guix/build/cargo-build-system.scm (unpack-rust-crates, package): New
procedures.
(install): Also install crate sources.
(%standard-phases): Add new phases.
* doc/guix.texi (Packaging-guidelines)[Rust Crates]: Adjust to changes
in the cargo-build-system.
2021-03-14 19:52:44 +02:00
Ludovic Courtès
8ff958f59d
gnu-maintenance: Autoload (zlib).
* guix/gnu-maintenance.scm: Autoload (zlib).
2021-03-13 22:51:18 +01:00
Ludovic Courtès
2569bd994b
inferior: Add <inferior> printer.
This avoids printing the whole package table in backtraces and such.

* guix/inferior.scm (write-inferior): New procedure.
<top level>: Call 'set-record-type-printer!'.
2021-03-13 22:51:18 +01:00
Ludovic Courtès
a04aef2430
utils: Use Guile-zlib for gzip compression and decompression.
Fixes <https://bugs.gnu.org/46967>.

* guix/utils.scm (decompressed-port): Call 'make-zlib-input-port'
instead of invoking %GZIP.
(compressed-output-port): Call 'make-zlib-output-port' instead of
invoking %GZIP.
* doc/guix.texi (Requirements): Require Guile-zlib >= 0.1.0.
2021-03-12 15:59:46 +01:00
zimoun
f1c4df15c3
time-machine: Fail when unrecognized option.
* guix/scripts/time-machine (parse-args): Fail when unrecognized option.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2021-03-11 23:19:53 +01:00
Ludovic Courtès
b168acae2a
download: 'tls-wrap' returns an unbuffered custom port.
Partly fixes <https://bugs.gnu.org/46967>.

* guix/build/download.scm (tls-wrap)[unbuffered]: New procedure.
Pass the result of 'make-custom-binary-input/output-port' to
'unbuffered'.
2021-03-11 23:19:52 +01:00
Ludovic Courtès
279d932b1c
download: 'tls-wrap' avoids intermediate buffer.
* guix/build/download.scm (tls-wrap)[read!]: Read straight into BV
instead of calling 'get-bytevector-some' and 'unget-bytevector'.
2021-03-11 23:19:52 +01:00
Ludovic Courtès
9a6ea2f8dc
syscalls: Define the ST_* constants and add 'statfs-flags->mount-flags'.
* guix/build/syscalls.scm (linux?): New variable.
(define-statfs-flags): New macro.
(ST_RDONLY, ST_NOSUID, ST_NODEV, ST_NOEXEC, ST_SYNCHRONOUS)
(ST_MANDLOCK, ST_WRITE, ST_APPEND, ST_IMMUTABLE, ST_NOATIME)
(ST_NODIRATIME, ST_RELATIME): New variables.
(statfs-flags->mount-flags): New procedure.
2021-03-10 23:21:33 +01:00
Ludovic Courtès
d028aef31c
import: go: Compute the hash of Git checkouts.
* guix/import/go.scm (vcs-file?, file-hash, git-checkout-hash): New
procedures.
(vcs->origin): Use 'git-checkout-hash' in the 'git case.
2021-03-10 18:01:48 +01:00
Katherine Cox-Buday
02e2e093e8
import: Add Go importer.
This patch adds a 'guix import go' command.

* doc/guix.texi (Requirements): Mention Guile-Lib dependency.
(Invoking guix import): Document 'guix import go'.
* gnu/packages/package-management.scm (guix)[inputs, propagated-inputs]:
Add GUILE-LIB.
* guix/self.scm (compiled-guix)[guile-lib]: New variable.
[dependencies]: Add it.
(specification->package): Add "guile-lib".
* guix/build-system/go.scm (go-version->git-ref): New procedure.
* guix/import/go.scm, guix/scripts/import/go.scm, tests/go.scm: New files.
* guix/scripts/import.scm: Declare subcommand guix import go
* po/guix/POTFILES.in: Add 'guix/scripts/import/go.scm'.
* Makefile.am (MODULES): Add 'guix/import/go.scm' and
'guix/scripts/import/go.scm'.
(SCM_TESTS): Add 'tests/go.scm'.

Co-Authored-By: Helio Machado <0x2b3bfa0@gmail.com>
Co-Authored-By: Francois Joulaud <francois.joulaud@radiofrance.com>
Co-Authored-By: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Co-Authored-by: Ludovic Courtès <ludo@gnu.org>
2021-03-10 18:01:48 +01:00
Mathieu Othacehe
8f999e1ac2
channels: Add the channel branch in sexp->channel.
* guix/channels.scm (sexp->channel): Add the channel branch.
2021-03-10 16:53:51 +01:00
Mathieu Othacehe
a831ff6bc3
inferior: Use a safe symlink monadic procedure.
This is a follow-up of 6ee7e3d26b8f5d2a234518cc2ab1bfeba7cd7c18.

* guix/inferior.scm (cached-channel-instance): Introduce "symlink/safe" and
use it instead of symlink. Remove the duplicated "file-exists?" call.
2021-03-10 13:09:23 +01:00