summaryrefslogtreecommitdiff
path: root/guix
AgeCommit message (Collapse)Author
2022-03-13gexp: Correctly handle #$output in 'gexp->approximate-sexp'.Maxime Devos
This addresses the following backtrace from "guix lint -c wrapper-inputs hostapd": Backtrace:ostapd@2.10 [wrapper-inputs]... [...] 174:9 3 (gexp->approximate-sexp #<gexp (modify-phases %standard?>) In srfi/srfi-1.scm: 586:17 2 (map1 (#<gexp-output out> #<gexp-input "pkg-config":o?>)) In guix/gexp.scm: 175:16 1 (_ _) In ice-9/boot-9.scm: 1685:16 0 (raise-exception _ #:continuable? _) ice-9/boot-9.scm:1685:16: In procedure raise-exception: Throw to key `match-error' with args `("match" "no matching pattern" #<gexp-output out>)'. * guix/gexp.scm (gexp->approximate-sexp): Handle the case where 'reference' is a <gexp-output>,, by returning (*approximate*). * tests/gexp.scm ("gexp->approximate-sexp, outputs"): Test it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-03-13gexp: Correctly handle unquoting S-exp objects.Maxime Devos
This fixes a false-positive in the linter: guix lint -c 'wrapper-inputs' libaio * guix/gexp.scm (gexp->approximate-sexp): Allow the 'thing' in <gexp-input> to be a sexp, without approximation, by testing if it is a record. * tests/gexp.scm ("unquoted sexp (not a gexp!)"): Test it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-03-11lint: check-tests-true: Allow #:tests? #t for some build systems.Maxime Devos
emacs-build-system sets #:tests? #f by default, so the linter shouldn't warn if #:tests? #t is set for packages using emacs-build-system. Likewise for texlive-build-system. * guix/lint.scm (check-tests-true): Do not warn if the build system is emacs-build-system or texlive-build-system. * tests/lint.scm ("tests-true: #:tests? #t acceptable for emacs packages") ("tests-true: #:tests? #t acceptable for texlive packages"): New tests. Fixes: <https://issues.guix.gnu.org/50299> Reported-by: Maxim Cournoyer <maxim.cournoyer@gmail.com> Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2022-03-07import: hackage: Use SRFI-71 instead of SRFI-11.Ludovic Courtès
* guix/import/hackage.scm (read-cabal-and-hash) (hackage-fetch-and-hash, hackage-fetch) (hackage->guix-package): Use 'let' and 'let*' instead of 'let-values' and 'let*-values'.
2022-03-07import: hackage: Avoid pointless use of 'compose'.Ludovic Courtès
* guix/import/hackage.scm (hackage-module->sexp): Unroll pointless calls to 'compose'. (hackage->guix-package): Likewise.
2022-03-07scripts: import: gem: Fix recursive error handling.zimoun
Partly fixes <https://bugs.gnu.org/44115>. * guix/scripts/import/gem.scm (guix-import-gem): Handle error. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-03-07import: cran: Return multiple values for unknown packages.zimoun
Partly fixes <https://bugs.gnu.org/44115>. * guix/import/pypi.scm (cran->guix-package): Return 'values'. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-03-07import: elpa: Return multiple values for unknown packages.zimoun
Partly fixes <https://bugs.gnu.org/44115>. * guix/import/elpa.scm (elpa->guix-package): Return values. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-03-07import: hackage: Return multiple values for unknown packages.zimoun
Partly fixes <https://bugs.gnu.org/44115>. * guix/import/hackage.scm (hackage->guix-package): Return 'values'. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-03-07import: pypi: Return multiple values for unknown packages.zimoun
Partly fixes <https://bugs.gnu.org/44115>. * guix/import/pypi.scm (pypi->guix-package): Return two values when PROJECT is false. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2022-03-07import: pypi: Gracefully handle missing project home page.Ludovic Courtès
Fixes <https://issues.guix.gnu.org/54259>. Reported by Ricardo Wurmus <rekado@elephly.net>. * guix/import/pypi.scm (pypi->guix-package): Upon 'missing-source-error?', raise '&fix-hint' only if 'project-info-home-page' returns a non-empty string.
2022-03-07derivations: Coalesce inputs that have the same output path.Ludovic Courtès
Fixes <https://issues.guix.gnu.org/54209>. * guix/derivations.scm (coalesce-duplicate-inputs): Use the output paths of DRV as a hash table key. * tests/derivations.scm ("derivation with duplicate fixed-output inputs"): Expect a single input for FINAL. ("derivation with equivalent fixed-output inputs"): New test.
2022-03-07build-system/meson: Add more cross-compilation targets.Efraim Flashner
* guix/build-system/meson.scm (make-machine-alist): Add riscv64-linux option for cpu_family. Add riscv64-linux and powerpc-linux options for endian.
2022-03-06import: github: Reuse HTTP connection for the /tags URL fallback.Ludovic Courtès
* guix/import/github.scm (fetch-releases-or-tags): Call 'open-connection-for-uri' and reuse the same connection for the two 'http-fetch' calls. * .dir-locals.el (scheme-mode): Add 'call-with-port'.
2022-03-06http-client: Correctly handle redirects when #:keep-alive? #t.Ludovic Courtès
Previously PORT would be closed unconditionally, which broke redirects when #:keep-alive? #t is given. * guix/http-client.scm (http-fetch): Make 'port' a parameter of 'loop'. Upon 3xx responses, do not close PORT is KEEP-ALIVE? is true, but consume RESP's body. Add second argument to 'loop'.
2022-03-06import: github: Gracefully handle rate limit exhaustion.Ludovic Courtès
Previously, 'guix refresh' would literally crash when the rate limit was reached due to the call to 'error'. With this change, the updater notices when the rate limit is reached and it turns itself into a no-op until the rate limit has been reset. When running "guix refresh" (with no arguments), the 'github' updater gets used until the rate limit has been reached, after which "guix refresh" automatically picks up the next valid updater, typically 'generic-git'. * guix/import/github.scm (fetch-releases-or-tags): Use 'http-fetch' directly instead of 'json-fetch' to let 'http-get-error?' exceptions through. Handle 403 errors with an 'X-RateLimit-Remaining' header. (%rate-limit-reset-time): New variable. (update-rate-limit-reset-time!, request-rate-limit-reached?): New procedures. (latest-released-version): Remove calls to 'error'.
2022-03-06http-client: Add response headers to '&http-get-error'.Ludovic Courtès
* guix/http-client.scm (&http-get-error)[headers]: New field. (http-fetch): Initialize the 'headers' field.
2022-03-03download: Fix typo in procedure name.Ludovic Courtès
* guix/build/download.scm (make-credendials-with-ca-trust-files): Rename to... (make-credentials-with-ca-trust-files): ... this.
2022-03-03download: Load X.509 certificates only once.Ludovic Courtès
Previously we'd load /etc/ssl/certs/*.pem (or similar) every time 'http-fetch' is called. * guix/build/download.scm (make-credendials-with-ca-trust-files): Wrap in 'mlambda'.
2022-03-03download: Remove obsolete bit from docstring.Ludovic Courtès
This is a followup to f4cde9ac4aedb516c050a30fd999673da434bfa0. * guix/build/download.scm (open-connection-for-uri): Remove bit about 'close-connection' from the docstring.
2022-03-02shell: Disable caching when '-p' is passed.Ludovic Courtès
Fixes <https://issues.guix.gnu.org/53658>. Reported by Guillaume Le Vaillant <glv@posteo.net>. Previously we would wrongfully cache things, by adding a new (profile . _) pair to the option alist, when the user runs: guix shell -p /path/to/profile -q * guix/scripts/shell.scm (profile-cached-gc-root): Add ('profile . _) case.
2022-03-02guix: Index the man-db database via man pages names.Maxim Cournoyer
Fixes <https://issues.guix.gnu.org/38838>. * guix/man-db.scm (write-mandb-database): Use the abbreviated base name of the man page as the key, not its full file name.
2022-02-27pull: No longer print upgraded/added packages upon completion.Ludovic Courtès
* guix/scripts/pull.scm (build-and-install): Remove call to 'display-profile-news' and adjust accordingly.
2022-02-27pull: '--news' no longer shows package lists.Ludovic Courtès
* guix/scripts/pull.scm (display-channel-news): Return #t when news were displayed. (display-news): Add #:profile-news? parameter and honor it. Print something there were no news. (process-query): For 'display-news', call 'display-channel-news' directly. * doc/guix.texi (Invoking guix pull): Adjust accordingly.
2022-02-24build: julia-build-system: Fix corner-case for parallel tests.zimoun
* guix/build/julia-build-system.scm (check): Do not run parallel tests when '--cores=1'. Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
2022-02-24build: julia: Add 'julia-package-dependencies' as keyword.Efraim Flashner
* guix/build-system/julia.scm (link-depot): Accept julia-package-dependencies keyword and use it for 'julia-create-package-toml' function. (julia-create-package-toml): Use pattern matching. (julia-build): Add 'julia-pacakge-dependencies'. * guix/build/julia-build-system.scm (julia-build): Add '#:julia-package-dependencies' keyword. Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
2022-02-18guix build: Warn when attempting to build an unsupported package.Ludovic Courtès
Fixes <https://issues.guix.gnu.org/51801>. Reported by Maxim Cournoyer <maxim.cournoyer@gmail.com>. * guix/scripts/build.scm (options->derivations)[warn-if-unsupported]: New procedure. [compute-derivation]: Use it. * tests/guix-build.sh: Add test.
2022-02-18profiles: 'profile-derivation' rejects unsupported packages.Ludovic Courtès
Previously user-facing commands would happily start building packages even if they do not support that system. With this change, all the user-facing commands reject unsupported packages without going further. * guix/profiles.scm (profile-derivation): Add #:allow-unsupported-packages?. Define 'check-supported-packages' and honor #:allow-unsupported-packages?. * tests/guix-pack.sh, tests/guix-package.sh, tests/guix-shell.sh: Ensure that unsupported packages are rejected. * tests/guix-system.sh: Pass "--system=armhf-linux" when attempting to build gnu/system/examples/asus-c201.tmpl.
2022-02-18packages: 'package-transitive-supported-systems' ignores ↵Ludovic Courtès
'%current-target-system'. Previously 'package-transitive-supported-systems' would enter an infinite loop over the cross-compilation tool chain if %CURRENT-TARGET-SYSTEM was set. * guix/packages.scm (package-transitive-supported-systems)[supported-systems-procedure]: Pass explicit SYSTEM and TARGET parameters. * tests/packages.scm ("supported-package? vs. %current-target-system"): New test.
2022-02-16status: Do not pass a non-literal format string to 'format'.Ludovic Courtès
* guix/status.scm (print-build-event): Use 'display' instead of 'format' for hooks.
2022-02-16status: Use bold more sparsely at -v1.Ludovic Courtès
Until now, at -v1, all the "apply N grafts" messages (for instance) would be displayed in bold. This would typically result in several subsequent lines all bold, although none of them is particularly interesting. This improves on that by avoiding bold at -v1 for these messages. * guix/status.scm (print-build-event)[emph]: New variable. Use it for the "View build log", "expected hash", and "offloading build" messages. [info]: Default to 'identity' when PRINT-URLS? and PRINT-LOG? are both false.
2022-02-16status: Do not print .drv file names for grafts.Ludovic Courtès
With this change, "guix build vim-full" prints: applying 15 grafts for vim-full-8.2.4306 ... instead of showing /gnu/store/…-vim-full-8.2.4306.drv. * guix/status.scm (print-build-event): In the 'graft' case, print just the "package name" part of DRV.
2022-02-16gexp: Preserve source location for #~ and #$ read extensions.Ludovic Courtès
Read hash extensions preserve source location info as source properties on their result. However, in Guile 3.0.8, that location would be dismissed, leading 'local-file' to fail to resolve file names relative to the source directory. Fixes <https://issues.guix.gnu.org/54003>. Reported by Aleksandr Vityazev <avityazev@posteo.org>. * guix/gexp.scm <eval-when> [read-syntax-redefined?, read-procedure] [read-syntax*]: New variables. [read-ungexp]: Adjust to expect either sexps or syntax objects. [read-gexp]: Call 'read-procedure'. * tests/gexp.scm ("local-file, relative file name, within gexp") ("local-file, relative file name, within gexp, compiled"): New tests.
2022-02-15guix system: Fix 'describe' when booting the latest generation.Ludovic Courtès
Fixes a regression introduced in 9679123ce083c69cdfd1505d95a4066d41280394, whereby 'guix system describe' would error out when /run/current-system points to /gnu/store/…-system, which is the case when booting the latest generation or after reconfigure. * guix/scripts/system.scm (process-command): For 'describe'. Try 'generation-number' with and without the optional argument.
2022-02-15gexp: 'computed-file' always uses a native Guile.Ludovic Courtès
Fixes a regression whereby, when cross-compiling, 'computed-file' would use a cross-compiled Guile as its builder, which would fail to run. Regression introduced in af57d1bf6c46f47d82dbc234dde1e16fa8634e9d (the problem had always been there but was hidden before behind the (not guile) condition.) * guix/gexp.scm (computed-file-compiler): For 'guile', pass #:target #f. * tests/gexp.scm ("lower-object, computed-file, #:target"): New test.
2022-02-14profiles: texlive-font-maps: Create ls-R file.Ricardo Wurmus
* guix/profiles.scm (texlive-font-maps): Run mktexlsr on resulting tree to provide ls-R file.
2022-02-14pull: '--list-generations' pipes its output to the pager.Ludovic Courtès
* guix/scripts/pull.scm (process-query): For 'list-generations queries, use 'with-paginated-output-port'. (display-news-entry-title): Pass second argument to 'highlight'. (display-news-entry): Pass second argument to 'dim'.
2022-02-14ui: 'display-generation' uses color when talking to a pager.Ludovic Courtès
This makes sure that, say, 'guix pull -l' benefits from colors when its output is piped to a pager, as long as the underlying terminal supports it. * guix/ui.scm (display-generation): Add second argument to 'highlight'.
2022-02-14ui: 'with-paginated-output-port' gives access to the wrapped port.Ludovic Courtès
* guix/ui.scm (pager-port-mapping): New variable. (pager-wrapped-port): New procedure. (call-with-paginated-output-port): Parameterize 'pager-port-mapping'.
2022-02-14pull: '--list-generations' lists packages only with '--details'.Ludovic Courtès
* guix/scripts/pull.scm (show-help, %options): Add "--details". (process-query): Honor it. * doc/guix.texi (Invoking guix pull): Document it.
2022-02-14publish: Do not sign the URL/Compression/FileSize narinfo fields.Ludovic Courtès
This will allow mirror operators to alter these non-normative bits of a narinfo without having to resign narinfos. * guix/scripts/publish.scm (narinfo-string): Remove URL/Compression/FileSize from BASE-INFO. Move them after "Signature". * tests/publish.scm ("/*.narinfo") ("/*.narinfo with properly encoded '+' sign") ("/*.narinfo with lzip + gzip") ("with cache, lzip + gzip"): Adjust accordingly. * tests/substitute.scm ("query narinfo with signature over relevant subset"): New test.
2022-02-14git-authenticate: Ensure the target is a descendant of the introductory commit.Ludovic Courtès
Fixes a bug whereby authentication of a commit *not* descending from the introductory commit could succeed, provided the commit verifies the authorization invariant. In the example below, A is a common ancestor of the introductory commit I and of commit X. Authentication of X would succeed, even though it is not a descendant of I, as long as X is authorized according to the '.guix-authorizations' in A: X I \ / A This is because, 'authenticate-repository' would not check whether X descends from I, and the call (commit-difference X I) would return X. In practice that only affects forks because it means that ancestors of the introductory commit already contain a '.guix-authorizations' file. * guix/git-authenticate.scm (authenticate-repository): Add call to 'commit-descendant?'. * tests/channels.scm ("authenticate-channel, not a descendant of introductory commit"): New test. * tests/git-authenticate.scm ("authenticate-repository, target not a descendant of intro"): New test. * tests/guix-git-authenticate.sh: Expect earlier test to fail since 9549f0283a78fe36f2d4ff2a04ef8ad6b0c02604 is not a descendant of $intro_commit. Add new test targeting an ancestor of the introductory commit, and another test targeting the v1.2.0 commit. * doc/guix.texi (Specifying Channel Authorizations): Add a sentence.
2022-02-14git: Add 'commit-descendant?'.Ludovic Courtès
* guix/git.scm (commit-descendant?): New procedure. * tests/git.scm ("commit-descendant?"): New test.
2022-02-14tests: Set a hard build timeout.Ludovic Courtès
* guix/tests.scm (open-connection-for-tests): Pass #:timeout to 'set-build-options'. (call-with-external-store): Add call to 'set-build-options'.
2022-02-13gnu: cpu: Add detection for AMD CPUs.Efraim Flashner
* guix/cpu.scm <cpu>: Add vendor field. (current-cpu): Also fill in the 'vendor' field. (cpu->gcc-architecture): Add detection logic for AMD CPUs.
2022-02-13guix: cpu: Rewrite based on feature flags.Efraim Flashner
* guix/cpu.scm (cpu->gcc-architecture): Rewrite detection based on detected feature flags.
2022-02-11tests: Pass #:guile to 'computed-file' & co.Ludovic Courtès
Fixes a regression introduced in af57d1bf6c46f47d82dbc234dde1e16fa8634e9d whereby tests would end up building the world. * guix/gexp.scm (mixed-text-file): Add #:guile parameter and honor it. * tests/gexp.scm ("mixed-text-file"): Pass #:guile to 'mixed-text-file'. ("file-union"): Pass #:guile to 'file-union'. ("lower-object, computed-file"): Pass #:guile to 'computed-file'. ("lower-object, computed-file + grafts"): Likewise. * tests/packages.scm ("origin->derivation, single file with snippet"): Likewise. * tests/profiles.scm ("profile-derivation, ordering & collisions"): Likewise. * guix/tests.scm (test-file): Likewise.
2022-02-11build-system/texlive: Be explicit about #:guile-for-build.Ludovic Courtès
This ensures package derivations are not a function of the value of (%guile-for-build). * guix/build-system/texlive.scm (texlive-build): Explicitly pass #:guile-for-build to 'gexp->derivation'.
2022-02-11gexp: <computed-file> does not honor (%guile-for-build).Ludovic Courtès
* guix/gexp.scm (computed-file-compiler): Default to (default-guile). That way, lowering of <computed-file> is not affected by the '%guile-for-build' parameter. (file-union): Add #:guile parameter and honor it. * gnu/packages/ruby.scm (ruby-tzinfo-data): Pass #:guile to 'file-union'.
2022-02-08deprecation: Refine the old daemon deprecation warning message.Maxim Cournoyer
* guix/deprecation.scm (warn-about-old-daemon): Mention a direct consequence of failing to upgrade the daemon. * guix/store.scm (build-things): Add a comment explaining the rationale to emit a deprecation warning for a daemon older than version 0x163. Suggested-by: Ricardo Wurmus <rekado@elephly.net>