A package named upstream like 'tmdb-python' now gets named 'python-tmdb'
instead of 'python-tmdb-python', which is ugly and doesn't match our
convention (info "(guix) Python Modules").
* guix/import/pypi.scm (python->package-name): Turn a -python suffix into a
python- prefix.
Change-Id: I7c0227d569c0afe6b16329d7cedb51728e4365b0
* guix/import/npm-binary.scm (<package-revision>)[license]: Handle the
case where a vector of licenses is used.
* tests/npm-binary.scm (foo-json): Redefine as a procedure with
license keyword.
(test-source-hash): Redefine with direct reference to test-source.
(foo-sexp): Redefine as a procedure with license keyword.
(npm-binary->guix-package test): Use foo-json and foo-sexp.
(npm-binary->guix-package with multiple licenses): Add test.
Change-Id: I9d6adb2ae2820678260fed1a67e91e22feb448b8
Signed-off-by: Jelle Licht <jlicht@fsfe.org>
This is a follow-up to 0881a674cce3af6ebe0c1c85000e2726cbe6fc54.
* guix/import/npm-binary.scm (npm-package->package-sexp): Use modify-json.
* tests/npm-binary.scm (npm-binary->guix-package test): Use modify-json.
Change-Id: I70523a890948b218c0d82d94a6edf8775521473e
Signed-off-by: Jelle Licht <jlicht@fsfe.org>
Introduce (modify-json), (delete-fields), and (replace-fields) to node-build-system
This change introduces helper procedures (modify-json) which takes in lambdas
which modify the target json #:file which defaults to package.json
This change also includes (delete-fields) and (replace-fields) to help deleting
and replacing the value of fields in a package.json file.
* guix/build/node-build-system.scm
(modify-json, modify-json-fields, delete-fields, replace-fields,
delete-dev-dependencies): New API exported procedures.
(with-atomic-json-file-replacement, delete-dependencies): Change
procedures to adapt to the new API.
* gnu/packages/node.scm (node-ms-bootstrap,
node-binary-search-bootstrap, node-debug-boostrap,
node-llparse-builder-bootstrap, node-llparse-frontend-boostrap,
node-llparse-bootstrap): Use new API procedures.
* gnu/packages/node-xyz.scm (node-acorn, node-addon-api,
node-buffer-crc32, node-crx3, node-debug, node-file-uri-to-path,
node-ieee754, node-inherits, node-irc, node-irc-colors, node-minimist,
node-ms, node-nan, node-normalize-path, node-once, node-path-key,
node-pbf, node-protocol-buffers-schema, node-readable-stream,
node-resolve-protobuf-schema, node-safe-buffer,
node-safe-stable-stringify, node-semver, node-serialport,
node-serialport-bindings, node-serialport-stream, node-sqlite3,
node-string-decoder, node-tiddlywiki, node-wrappy, node-yazl): Use new
API procedures.
Change-Id: I957f7ca814078d2136d5261985174820235f1369
Signed-off-by: Jelle Licht <jlicht@fsfe.org>
* guix/man-db.scm (man-page->entry): Extract man name and section from
.Dt macro.
Change-Id: I02dc99d73dceecdb077315805025efad9a650e91
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* guix/man-db.scm (man-macro-tokenize): New procedure to parse man
macros.
(man-page->entry): Parse macro line using man-macro-tokenize.
Change-Id: Iea0ffbc65290757df746138e0a6174646b5a3eb8
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Fixes a bug whereby (local-file (in-vicinity (getcwd) "xyz")) would
point to different files depending on the current working directory at
the time it is lowered.
* guix/gexp.scm (local-file): Expand FILE only once.
* tests/gexp.scm ("local-file, capture at the right time"): New test.
Change-Id: I2cc23296de3799e68f7d8b7be6061be3043e1176
This one was returning 404.
* guix/download.scm (%mirrors) <savannah>: Remove
"https://de.freedif.org/savannah/".
Change-Id: I0fd59ec87cf7c89459f07dafb9cafbbe12c11fd2
Otherwise, combining make-systemd-constructor with least-authority-wrapper
would not work correctly out of the box.
* guix/least-authority.scm (%precious-variables): Add "LISTEN_PID"
"LISTEN_FDS" "LISTEN_FDNAMES" environment variables.
Change-Id: Idd259b15463920965f530e1917d76bf97def3b7b
Reviewed-by: Ludovic Courtès <ludo@gnu.org>
Fixes a bug where ‘guix lint -c cve’ would crash when nvd.nist.gov
returns 503 or similar.
* guix/lint.scm (current-vulnerabilities*): Wrap
‘current-vulnerabilities’ call in ‘guard’ and return the empty list in
case of ‘http-get-error?’.
Change-Id: I76d5f22c260999154af7b73630f783555747aa7a
Reported in #73314: PyPI importer gives null at home-page for some
packages.
* guix/import/pypi.scm (<project-info>): [home-page]: Apply
NON-EMPTY-STRING-OR-FALSE to make it consistence with similar fields,
covering the case when PyPI's JSON file metadata file does not have the
information.
Change-Id: I501582988cf58b00bd201c12ad47e9b095988fae
Reported-by: Evgeny Pisemsky <mail@pisemsky.site>
Reviewed-by: Simon Tournier <zimon.toutoune@gmail.com>
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
Many thanks to Reepca Russelstein for their review and guidance on these
changes.
* nix/libstore/build.cc (guestUID, guestGID): New variables.
(DerivationGoal)[readiness]: New field.
(initializeUserNamespace): New function.
(DerivationGoal::runChild): When ‘readiness.readSide’ is positive, read
from it.
(DerivationGoal::startBuilder): Call ‘chown’
only when ‘buildUser.enabled()’ is true. Pass CLONE_NEWUSER to ‘clone’
when ‘buildUser.enabled()’ is false or not running as root. Retry
‘clone’ without CLONE_NEWUSER upon EPERM.
(DerivationGoal::registerOutputs): Make ‘actualPath’ writable before
‘rename’.
(DerivationGoal::deleteTmpDir): Catch ‘SysError’ around ‘_chown’ call.
* nix/libstore/local-store.cc (LocalStore::createUser): Do nothing if
‘dirs’ already exists. Warn instead of failing when failing to chown
‘dir’.
* guix/substitutes.scm (%narinfo-cache-directory): Check for
‘_NIX_OPTIONS’ rather than getuid() == 0 to determine the cache
location.
* doc/guix.texi (Build Environment Setup): Reorganize a bit. Add
section headings “Daemon Running as Root” and “The Isolated Build
Environment”. Add “Daemon Running Without Privileges” subsection.
Remove paragraph about ‘--disable-chroot’.
(Invoking guix-daemon): Warn against ‘--disable-chroot’ and explain why.
* tests/derivations.scm ("builder is outside the store"): New test.
Reviewed-by: Reepca Russelstein <reepca@russelstein.xyz>
Since these options were added for normal builds, those packages that used
these options couldn't be cross built. Supporting these options in
go-cross-build restores this functionality.
* guix/build-system/go.scm (go-cross-build): Support the #:parallel-build? and
#:parallel-tests? keyword arguments.
Change-Id: I9768c9562246b61c2ea875a3d5a42809924f3a7d
The previous fix introduced in commit 8176277487 ("import: Avoid duplicate
trailing '/' in computed import URL.") regressed on the handling of *file*
source URIs:
$ guix refresh cairo --update
Starting download of /tmp/guix-file.xUKazf
From https://cairographics.org/cairo-1.18.4.tar.xz...
download failed "https://cairographics.org/cairo-1.18.4.tar.xz" 404 "Not Found"
* guix/gnu-maintenance.scm (import-html-release): Revert commit 8176277487,
instead adding a trailing slash only if it doesn't already exist.
Change-Id: I6e3889f14badd8843bbf6436ad62a1594f553afe
* guix/lint.scm (check-inputs-should-not-be-an-input-at-all): Add tzdata and
nss-certs to the list of bad ideas.
Change-Id: I321d6989fc96013565d8be4480ee9928b7784245
Fixes <https://issues.guix.gnu.org/76376>.
This is a followup to 149de38d0a2560277ee9bdda2104fbd45608bcb2, which
did not suitably follow symlinks. The test case didn’t catch this
because, when using ‘--disable-chroot’, the symlink target is accessible
within the build environment.
* guix/gexp.scm (imported-files/derivation): Call ‘readlink*’ on ‘file-name’.
Co-authored-by: Ryan Sundberg <ryan@arctype.co>
Change-Id: Idc5b59cd8f0c1217e84c7cbfba64d97d5999429f
* guix/describe.scm (append-channels-to-load-path!): New function.
* gnu/packages.scm (%package-module-path): Call new function. Remove
the code that the function call replaces.
* guix/ui.scm (extension-directories): Call new function. Search
channels for guix extensions.
* guix/self.scm (compiled-guix)[*core-modules*]: Add 'guile-git' to
the list of extensions.
Change-Id: I53af828dc554485ca28389c9e2653ea6b4fb6b7e
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Fixes <https://issues.guix.gnu.org/76110>.
Fixes a regression introduced in
28e4018e59 where the system and target
system would be ignored.
* guix/packages.scm (input-graft, input-cross-graft): Wrap graft replacement
in ‘with-parameters’.
* tests/packages.scm ("package-grafts, indirect grafts")
("package-grafts, indirect grafts, propagated inputs")
("package-grafts, same replacement twice")
("package-grafts, dependency on several outputs")
("replacement also grafted"): Adjust accordingly by comparing the replacement
after lowering to a derivation.
("package-grafts, indirect grafts, #:system argument"): New test.
Change-Id: I1663f0cc50842bb9abb53ba4aa9935052022d1f4
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Reported-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
This is a follow-up to commit 79a46d6537 ("gnupg: Automatically fallback to
'always policy when non-interactive."), which introduced the following
problem:
guix refresh --update libvirt
-> guix refresh: error: invalid key-download policy: #f
* guix/scripts/refresh.scm (%default-options): Set default key-download option
value to 'auto.
(%options): Accept auto as a valid value from the command line.
Change-Id: I45ceee8e07d1a3a3c377e12ed017813f92289565
Partly fixes <https://issues.guix.gnu.org/76315>.
Fixes a bug whereby a service whose canonical name has changed would not
be restarted—e.g., if '(syslogd) has a replacement providing
'(system-log syslogd).
* gnu/services/shepherd.scm (shepherd-service-upgrade)[running?]:
Remove.
[to-restart]: Change to a subset of LIVE. Look up all the names of each
element of TARGET.
* guix/scripts/system/reconfigure.scm (upgrade-shepherd-services):
TO-RESTART is now a list of <live-service>; adjust accordingly.
* tests/services.scm ("shepherd-service-upgrade: one unchanged, one upgraded, one new"):
("shepherd-service-upgrade: service depended on is not unloaded"):
("shepherd-service-upgrade: obsolete services that depend on each other"):
("shepherd-service-upgrade: transient service"): Adjust accordingly.
("shepherd-service-upgrade: service has new canonical name"): New test.
Reported-by: Tomas Volf <~@wolfsden.cz>
Change-Id: I7cec495b4e824da5fad5518f039607cf92f935d9
Fixes <https://issues.guix.gnu.org/75679>.
Fixes this infamous error:
substitute: looking for substitutes on 'https://bordeaux.guix.gnu.org'... 0.0%guix substitute: error: TLS error in procedure 'write_to_session_record_port': Error in the push function.
guix system: error: `/gnu/store/…-guix-1.4.0-32.5f6fdad/bin/guix substitute' died unexpectedly
* guix/substitutes.scm (call-with-connection-error-handling): Report
‘error/push-error’ and ‘error/pull-error’ as mere warnings.
Reported-by: Timo Wilken <git@twilken.net>
Change-Id: Ibc507cb88b164cbb91dff95aa18d9974c573f7c9
So that this is evaluated when the main part of the script runs.
I'm looking at this to allow using setaffinity in the publish tests.
* guix/scripts/publish.scm (%default-options): Remove workers default.
(guix-publish): Move the default to here.
Change-Id: I83cd0d048f2641291b5bd8a932b479b23dd92d29
If the new-name matches the original name, just use the original package.
This avoids situations where there are several packages matching the name and
the behaviour will be inconsistent, occasionally picking different packages.
Since there are multiple glibc packages currently, I'm seeing this behaviour
with cl-posix-mqueue and ecl-cl-posix-mqueue, occasionally they'll use the
hurd glibc variant.
* guix/build-system/asdf.scm (package-with-build-system): Use the original
input packages unless the new-name differs.
Change-Id: I08a1f3ad1290689b5497d31950ada4dc0bfa3a3a
This fixes a few omissions in commit f13f076968 ("refresh: Add support for
partial target versions.").
* guix/gnu-maintenance.scm
(import-kernel.org-release): Add #:partial-version? argument.
* guix/gnu-maintenance.scm (import-savannah-release): Likewise.
(import-xorg-release): Likewise.
(import-kernel.org-release): Likewise.
(latest-sourceforge-release): Likewise (reporting an error). Use report-error
instead of error directly.
Change-Id: I188fa8fa7250a7165410b8d5c4870f428ea228af
Unlike for file names, duplicate slashes in URLs matter. For example
attempting to refresh 'qemu' would previously not find any result because it'd
try to find links from 'https://download.qemu.org//', which is unreachable.
* guix/gnu-maintenance.scm (import-html-release): Use canonicalize-url to join
BASE-URL and DIRECTORY, which handles trailing '/' correctly.
Change-Id: I108a542c4eede85c78a47f62921184273dc1ea01
* guix/scripts/build.scm (options->things-to-build): Wrap the manifest
build option with the result of the '--system' option.
Change-Id: I1c3ff93af56bb659ddc00e1872c769cfc5e7a0d5
Fixes a bug whereby the derivation of origins using one of these methods
would depend on whether grafts are enabled, in practice causing rebuilds
for anyone keeping grafts enabled—e.g., ‘java-xz’ and its 142
dependents.
* guix/download.scm (url-fetch/tarbomb, url-fetch/zipbomb):
Pass #:graft? #f when computing ‘guile’.
Reported-by: Ricardo Wurmus <rekado@elephly.net>
Change-Id: I75d634fcaf20c9912419c26ca251fff136c528c6
* guix/import/utils.scm (find-version): New procedure.
* guix/scripts/refresh.scm (<update-spec>) [partial?]: New field.
(update-spec-partial?): New accessor.
(update-spec): Add a PARTIAL? optional argument.
(update-specification->update-spec) <update-spec>: Call with its new PARTIAL?
optional argument when FALLBACK-VERSION is provided, i.e. when
'--target-version' was used.
(update-package): Remove the PACKAGE and VERSION positional arguments, and
replace them with UPDATE-SPEC. Update doc. Call `package-update' with its
new #:partial-version? argument.
(check-for-package-update) <package-latest-release>: Pass the new
#:partial-version? argument to it.
(guix-refresh) <update-package>: Adjust call accordingly.
(show-help): Udate doc.
* guix/upstream.scm (package-latest-release): Add #:partial-version? argument,
and apply it to the importer call.
(package-update): Add #:partial-version?> argument. Update doc. Pass it to
the `package-latest-release' call.
* guix/gnu-maintenance.scm (rewrite-url): Add #:partial-version? argument.
Update doc. Crawl URL for newer compatible versions when provided.
(import-html-release): Add #:partial-version? argument, and pass it to the
`rewrite-url' call. Use `find-version' to find the best version.
(import-release, import-ftp-release, import-gnu-release)
(import-release*): Add #:partial-version? argument and honor it.
(import-html-updatable-release): Add #:partial-version? argument, and pass it
to the `import-html-release' call.
* guix/import/gnome.scm (import-gnome-release)
<#:partial-version?>: Add new argument and honor it.
* guix/import/texlive.scm (latest-texlive-tag): Rename to...
(texlive-tags): ... this, and have it return all tags.
(texlive->guix-package): Adjust accordingly.
(latest-release): Add a #:partial-version? argument. Update doc.
* guix/import/stackage.scm (latest-lts-release): New #:partial-version?
argument.
* guix/import/pypi.scm (import-release): New #:partial-version? argument; pass
it to `pypi-package->upstream-source'.
* guix/import/opam.scm (latest-release): New #:partial-version? argument.
* guix/import/minetest.scm (latest-minetest-release): New #:partial-version?
argument.
(pypi-package->upstream-source): New #:partial-version? argument. Update doc.
* guix/import/launchpad.scm (latest-released-version): Rename to...
(release-versions): ... this, making it return all versions.
(import-release) <#:partial-version?>: New argument.
* guix/import/kde.scm (import-kde-release)
<#:partial-version?>: New argument. Update doc. Refactor to honor argument.
* guix/import/hexpm.scm (lookup-hexpm): Update doc.
(hexpm-latest-release): Rename to...
(hexpm-releases): ... this; return all release strings.
(hexpm->guix-package): Adjust accordingly.
(import-release): Add and honor a #:partial-version? argument. Update doc.
* guix/import/hackage.scm (import-release): New #:partial-version? argument.
* guix/import/cpan.scm (latest-release): New #:partial-version? argument.
* guix/import/crate.scm (max-crate-version-of-semver): Improve doc.
(import-release): Add a #:partial-version? argument and honor it.
* guix/import/egg.scm (find-latest-version): Rename to...
(get-versions): ... this, returning all versions.
(egg-metadata): Adjust accordingly.
(egg->guix-package): Likewise.
(import-release): Add a new #:partial-version? argument and honor it.
* guix/import/elpa.scm (latest-release): New #:partial-version? argument.
* guix/import/gem.scm (get-versions): New procedure.
(import-release): Add a new #:partial-version? argument and honor it.
* guix/import/git.scm (version-mapping): Update doc; streamline a bit.
(latest-tag): Rename to...
(get-tags): ... this, dropping the #:version keyword and returning the complete
tags alist. Update doc.
(latest-git-tag-version): Rename to...
(get-package-tags): ... this, returning the complete tags alist of the
package. Update doc.
(import-git-release): Add a new #:partial-version? argument and honor it.
Update doc.
* guix/import/github.scm (latest-released-version): Rename to...
(get-package-tags): ... this, returning all tags. Update doc.
(import-release): Add a new #:partial-version? argument and honor it.
* guix/import/cran.scm (latest-cran-release)
(latest-bioconductor-release): Add #:partial-version? argument.
* guix/import/composer.scm (latest-version): Delete procedure.
(composer-fetch): Add #:partial-version? keyword and honor it. Update doc.
(import-release): Likewise.
* guix/import/test.scm (import-release): Add #:partial-version? argument.
* tests/guix-refresh.sh: Add test.
* tests/gem.scm (test-foo-versions-json): New variable.
(package-latest-release): Mock new URL.
* tests/import-git.scm (latest-git-tag-version): New procedure.
* tests/gnu-maintenance.scm (libuv-dist-html)
(libuv-dist-1.46.0-html, libuv-dist-1.44.2-html)
(libuv-html-data): New variables.
(mock-http-fetch/cached): New procedure.
("rewrite-url, without to-version"): Rewrite using the above.
("rewrite-url, partial to-version"): New test.
* doc/guix.texi <"Invoking guix refresh">: Update doc.
Series-to: 75871@debbugs.gnu.org
Change-Id: I092a58b57ac42e54a2fa55e7761e8c6993af8ad4
Previously to this change, the 'guix refresh' download
policy (--key-download)would default to 'interactive', which would throw a
backtrace when guix was invoked with its stdin not connected to a peusdo
terminal (tty). This change makes the new default value 'auto' use
interactive only in an interactive environment, with 'always' used as
fallback.
* doc/guix.texi (Invoking guix refresh): Adjust doc.
* etc/completion/fish/guix.fish: Adjust accordingly.
* etc/completion/zsh/_guix (_guix_list_installed_packages): Likewise.
* guix/gnupg.scm (gnupg-verify*): Change default #:key-download argument value
to 'auto. Update doc. Validate argument. Raise an error in case read-line
returns #<eof>.
* guix/import/gnu.scm (gnu-package->sexp): <#:key-download>: Change default
value to 'auto.
* guix/import/gnu.scm (gnu->guix-package): <#:key-download>: Likewise.
* guix/scripts/import/gnu.scm (%options): Add "auto" to accepted
--key-download values.
(%default-options): Set default key-download option to the 'auto value.
(show-help): Update doc.
* guix/scripts/refresh.scm (show-help): Update doc.
(update-package) <#:key-download>: Change default value to 'auto. Update doc.
* guix/upstream.scm (download-tarball): <#:key-download>: Likewise.
(package-update): Likewise.
Change-Id: Id1ca8fd6d453ca4bc5b372534445e3beab9133a8
Fixes: https://issues.guix.gnu.org/76112
Reviewed-by: Ludovic Courtès <ludo@gnu.org>
This is a followup to 8bd013011d.
Previously, the call to ‘defined?’ would look for those bindings
in (current-module), where chances were that they would be missing;
consequently timeouts were never enabled. This fixes that.
* guix/git.scm (set-git-timeouts)[defined?]: New procedure.
Change-Id: Ia14a351fd6d508f760992d7bb68d2f4bb61f8468
The list of modules used by default was not public, so users of this build
system had to pick between copy&pasting the list, or using
%glib-or-gtk-build-system-modules. The former is sub-optimal, since it is
hard to keep it in sync. The latter is just wrong and leads to basically
fall-backing to gnu-build-system.
The solution is to export the default list giving the users option to use it
directly.
* guix/build-system/glib-or-gtk.scm
(%glib-or-gtk-build-system-default-modules): Renamed from %default-modules.
(define-module): Export it.
(glib-or-gtk-build), (glib-or-gtk-cross-build): Use it.
Change-Id: I331b2a3f0bdc3ce14eb9f2f80605e7873369168d
Signed-off-by: Andreas Enge <andreas@enge.fr>
* guix/import/utils.scm (beautify-description)[new-words]: Don't fail
the `match` when the package has an empty description.
Change-Id: I23e9cfeae1da98bb8705fcfc8ff81906d272d72e