Like in other build-systems, make proper procedures to resolve the
build-system build-inputs bindings.
* guix/build-system/android-ndk.scm (default-android-build,
default-android-googletest): Add procedures.
(lower): Use them.
Signed-off-by: Christopher Baines <mail@cbaines.net>
* guix/build-system/ruby.scm
(ruby-cross-build): Use with-imported-modules around the
ruby-cross-build builder gexp.
Change-Id: I1051124f034f2082ccef531e9bcf37913d5a9449
Signed-off-by: Christopher Baines <mail@cbaines.net>
* guix/build-system/waf.scm
(waf-build): Use with-imported-modules around the waf-build builder gexp.
Change-Id: Id242046eb4bfef90dba60d7c3b1b68597ddf502e
Signed-off-by: Christopher Baines <mail@cbaines.net>
* guix/build-system/glib-or-gtk.scm
(glib-or-gtk-cross-build): Use with-imported-modules around the
glib-or-gtk-cross-build builder gexp.
Change-Id: I8eaa032ffc0a3f8dbf02c96a4ecee85475c32111
Signed-off-by: Christopher Baines <mail@cbaines.net>
* guix/build-system/gnu.scm
(gnu-cross-build): Use with-imported-modules around the
gnu-cross-build builder gexp.
Change-Id: I47246571b1d84a82a67a8c289fd5ad4b5a3b5aeb
Signed-off-by: Christopher Baines <mail@cbaines.net>
Previously, 'guix refresh --update' would do actually rewrite the file with
the same version/hash information when the target version was the same as the
current version:
guix refresh --update idutils=4.6
idutils.scm: warning: downgrading 'idutils' from 4.6 to 4.6
[...]
idutils.scm: idutils: updating from version 4.6 to version 4.6...
This changes handles this case so that it does and prints nothing.
* guix/upstream.scm (package-update): Use `version-compare' to distinguish the
equal versions case.
Change-Id: I079e030d573f5968725ef13b3f626e2f8d02cb2f
Signed-off-by: Christopher Baines <mail@cbaines.net>
Previously the profile will produce a new symlink for each icon file, now it
will reuse existed ones if possible.
* guix/profiles.scm (gtk-icon-themes): Only install 'icon-theme.cache' files
into the output. Adjust produce docstring.
Fixes: https://issues.guix.gnu.org/77487
Change-Id: Ia452565768753b8a60baf4fc075f6fe5ebb4fa39
Signed-off-by: 宋文武 <iyzsong@member.fsf.org>
The #:refspecs argument was added in Guile-Git 0.10.0.
* guix/git.scm (update-cached-checkout): Define ‘symref-list’. Pass it
as #:refspecs to ‘remote-fetch’.
Change-Id: Ib7874e2a30f97e51fdfdc2231a3bc5a3b45a177d
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Fixes <https://issues.guix.gnu.org/66268>.
Fixes a bug whereby ‘commit-relation’ and ‘commit-descendant?’ would
provide an incorrect result when two distinct <commit> objects would
exist for the same commit, which happens when the commit’s metadata is
beyond 4 KiB at least as of libgit2 1.8/1.9.
This, in turn, would lead ‘guix pull’ & co. to wrongfully report an
attempt to downgrade and pull to an unrelated commit.
* guix/git.scm (commit-relation): When (git graph) is available,
rewrite in terms of ‘graph-descendant?’.
(commit-descendant?): Likewise.
Change-Id: Ie52b188a8dfa90c95a73387c3ab2fdd04d2bf3e9
Reported-by: Tomas Volf <~@wolfsden.cz>
This is consistent with the ‘guix’ package and will prove helpful when
people want to replace /etc/systemd/system/guix*.service with newer
versions thereof.
* guix/self.scm (parameterized-file): New procedure, based on…
(selinux-policy): … this. Use ‘parameterized-file’.
(systemd-file): New procedure.
(miscellaneous-files): Add systemd files.
Change-Id: Ia489a955347cf648a86000cc1265769d66c3f0e8
Fixes <https://issues.guix.gnu.org/76141>.
* guix/scripts/locate.scm (guix-locate): Use writable db when --clear is given.
Change-Id: I2e4e945cef022b08dd6af4c252e67c2a4d5bf38c
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Fixes <https://issues.guix.gnu.org/77606>.
Calling ‘fdatasync’ for each and every narinfo file created by ‘guix
substitute’ proved to be too expensive on spinning HDDs and/or under
load (from 0.1s to 1.3s for the ‘fdatasync’ call alone).
* guix/git-authenticate.scm (cache-authenticated-commit): Pass #:sync? #f.
* guix/http-client.scm (http-fetch/cached): Likewise.
* guix/scripts/discover.scm (write-publish-file): Likewise.
* guix/scripts/style.scm (format-whole-file): Likewise.
* guix/substitutes.scm (cache-narinfo!): Likewise.
Reported-by: Christopher Baines <mail@cbaines.net>
Change-Id: I82297eae737bc5aae8a3f7604119e9f3d4b625bf
Fixes <https://issues.guix.gnu.org/77214>.
Fixes a bug whereby setting ‘core.autocrlf’ to ‘true’ in ~/.gitconfig
would lead ‘guix pull’ & co. to obtain non-bit-identical files,
including possibly syntactically-invalid Scheme files.
* guix/git.scm (clone*): Set ‘core.autocrlf’ to ‘input’.
Reported-by: Jodi Jodingtonstinski <jodijodingtondev@gmail.com>
Change-Id: I11fb20813a9fc1e14828ca8ebf5092c4b1181e5c
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