summaryrefslogtreecommitdiff
path: root/guix/ui.scm
Commit message (Collapse)AuthorAge
* ui: Do not display error messages with bare format strings.Ludovic Courtès2020-01-24
| | | | | | | | | | On Guile 3, with, say, an error in ~/.guile, we'd get: $ guix repl guix repl: error: Unbound variable: ~S * guix/ui.scm (call-with-error-handling): Add '&exception-with-kind-and-args' case.
* ui: Ignore 'raise-exception' frames when reporting exceptions.Ludovic Courtès2020-01-17
| | | | | * guix/ui.scm (last-frame-with-source): Check whether FRAME corresponds to 'raise-exception' and skip it if it does.
* records: Improve reporting of "invalid field specifier" errors.Ludovic Courtès2020-01-16
| | | | | | | | | | | | | | | | | | | Previously users would just see: error: invalid field specifier without source location or hints. * guix/records.scm (expand): Add optional 'parent-form' parameter and pass it to 'syntax-violation' when it is true. (make-syntactic-constructor): Pass S as a third argument to 'report-invalid-field-specifier'. * guix/ui.scm (report-load-error): For 'syntax-error', show SUBFORM or FORM in the message. * tests/records.scm ("define-record-type* & wrong field specifier"): Add a 'subform' parameter and adjust test accordingly. ("define-record-type* & wrong field specifier, identifier"): New test. * tests/guix-system.sh: Add test.
* Avoid warnings for the 'delete' binding of (guix build utils).Ludovic Courtès2020-01-15
| | | | | | | | | On Guile 3, importing (guix build utils) leads to warnings such as: WARNING: (gnu packages embedded): imported module (guix build utils) overrides core binding `delete' * gnu/packages/embedded.scm: Select 'alist-replace' from (guix build utils). * guix/ui.scm: Hide 'delete' from (guix build utils).
* ui: It's 2020 now!Ludovic Courtès2020-01-02
| | | | * guix/ui.scm (show-version-and-exit): Change year to 2020.
* ui: 'with-profile-lock' keeps going upon ENOLCK.Ludovic Courtès2019-11-29
| | | | | | * guix/build/syscalls.scm (call-with-file-lock/no-wait): Really pass ARGS to HANDLER. Return #f when HANDLER is called. * guix/ui.scm (profile-lock-handler): Emit a mere warning upon ENOLCK.
* ui: Factorize 'with-profile-lock'.Ludovic Courtès2019-11-29
| | | | | | | | | * guix/ui.scm (profile-lock-handler, profile-lock-file): New procedures. (with-profile-lock): New macro. * guix/scripts/package.scm (process-actions): Use 'with-profile-lock' instead of 'with-file-lock/no-wait'. * guix/scripts/pull.scm (guix-pull): Likewise.
* pull, describe: Emit hyperlinks for commit identifiers.Ludovic Courtès2019-11-28
| | | | | | | | | | * guix/scripts/pull.scm (%vcs-web-views): New variable. (channel-commit-hyperlink): New procedure. (display-news-entry): Add 'channel' parameter. When 'supports-hyperlinks?' returns true, call 'channel-commit-hyperlink'. (display-profile-content): Likewise, and define CHANNEL. (display-channel-specific-news): Pass CHANNEL to 'display-news-entry'. * guix/ui.scm (hyperlink): Make public.
* ui: 'display-generation' emits a hyperlink for the generation.Ludovic Courtès2019-11-28
| | | | | | * guix/ui.scm (supports-hyperlinks?): Make 'port' optional. (display-generation): Use 'file-hyperlink' for the heading when 'supports-hyperlinks?' returns true.
* ui: Add 'file-hyperlink'.Ludovic Courtès2019-11-28
| | | | | * guix/ui.scm (file-hyperlink): New procedure. (location->hyperlink): Use it.
* ui: Adjust SRFI-34 exception handling to Guile 2.9.5.Ludovic Courtès2019-11-27
| | | | | | * guix/ui.scm (report-load-error, warn-about-load-error) (read/eval): Match (or 'srfi-34 '%exception) instead of just 'srfi-34 to match what Guile 2.9.5 does.
* ui: Emit hyperlinks for 'license' in package search results.Ludovic Courtès2019-11-09
| | | | | * guix/ui.scm (package->recutils): When HYPERLINKS is true, call 'hyperlink' for the 'license' field.
* ui: Produce hyperlinks for the 'location' field of search results.Ludovic Courtès2019-11-09
| | | | | | | | | | | | This affects the output of 'guix show', 'guix search', and 'guix system search'. * guix/ui.scm (hyperlink, supports-hyperlinks?, location->hyperlink): New procedures. (package->recutils): Add #:hyperlinks? and honor it. (display-search-results): Pass #:hyperlinks? to PRINT. * guix/scripts/system/search.scm (service-type->recutils): Add #:hyperlinks? and honor it.
* ui: 'show-what-to-build' colorizes store file names.Ludovic Courtès2019-10-01
| | | | | | * guix/ui.scm (colorize-store-file-name): New procedure. (show-what-to-build)[colorize-store-item]: New variable. Use it throughout.
* ui: Add 'current-message-language'.Ludovic Courtès2019-09-23
| | | | | * guix/ui.scm (%default-message-language): New variable. (current-message-language): New procedure.
* ui: 'relevance' connects regexps with a logical and.zimoun2019-09-19
| | | | | | | | | | | | | Fixes <https://bugs.gnu.org/36763>. Previously, the logical and connecting the regexps did not output the expected results (introduced in 8874faaaac665100a095ef25e39c9a389f5a397f). * guix/ui.scm (relevance) [score]: Change its arguments. [regexp->score]: New procedure. * tests/ui.scm ("package-relevance"): Add test. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* ui: 'warn-about-load-error' provides hints for unbound variables.Ludovic Courtès2019-07-20
| | | | | * guix/ui.scm (warn-about-load-error): Add 'unbound-variable' clause. * tests/guix-build.sh: Add test.
* ui: 'warn-about-load-error' warns about file/module name mismatches.Ludovic Courtès2019-07-20
| | | | | | | | | | * guix/discovery.scm (scheme-modules): Rename the inner 'file' to 'relative'. Pass FILE as an addition argument to WARN. * guix/ui.scm (warn-about-load-error): Add 'module' argument (actually, what was called 'file' really contained a module name.) Call 'check-module-matches-file' in the catch-all error case. (check-module-matches-file): New procedure. * tests/guix-build.sh: Test it.
* guix gc: Correctly handle '--delete-generations' with no arguments.Ludovic Courtès2019-07-11
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously, 'guix gc --delete-generations' would crash: the "" pattern would be passed to 'matching-generations', which would return #f instead of returning a list. Reported by Raghav Gururajan <rvgn@disroot.org> in <https://bugs.gnu.org/36466>. * guix/ui.scm (matching-generations): Raise an error when passed an invalid pattern. * guix/scripts/gc.scm (delete-old-generations): Check if PATTERN is true. (%options): Leave ARG as-is for 'delete-generations'. (guix-gc): Use 'assq' instead of 'assoc-ref' for 'delete-generations'. * guix/scripts/package.scm (delete-matching-generations): Replace (string-null? pattern) with (not pattern). Remove 'else' clause. (%options): Leave ARG as-is for 'delete-generations'. * guix/scripts/pull.scm (%options): Leave ARG as-is for 'list-generations'. (process-query): Replace (string-null? pattern) with (not pattern). * guix/scripts/system.scm (list-generations): Likewise, and remove 'else' clause. (process-command): Use #f instead of "" when no pattern is given.
* derivations: Simplify 'substitution-oracle'.Ludovic Courtès2019-07-05
| | | | | | | | | * guix/derivations.scm (substitution-oracle)[valid?, dependencies]: Remove. [closure]: New procedure. Rename parameter from 'drv' to 'inputs-or-drv' and adjust accordingly. (derivation-build-plan): Pass INPUTS directly to 'substitution-oracle'. * guix/ui.scm (show-what-to-build)[substitutable-info]: Likewise.
* derivations: 'derivation-build-plan' recurses on substituables.Ludovic Courtès2019-07-05
| | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a bug whereby "guix build texlive -n" would report: 0.0 MB would be downloaded: /gnu/store/…-texlive-20180414 instead of: The following derivation would be built: /gnu/store/…-texlive-texmf-20180414.drv 2,595.2 MB would be downloaded: /gnu/store/…-texlive-20180414-texmf.tar.xz /gnu/store/…-texlive-20180414 where 'texlive-texmf' is a non-substitutable dependency of 'texlive'. * guix/derivations.scm (dependencies-of-substitutables): New procedure. (derivation-build-plan): When 'input-substitutable-info' returns true, append the subset of DEPS that corresponds to SUBSTITUABLES to the first argument of 'loop'. * guix/ui.scm (show-what-to-build): Remove half-baked traversal of DOWNLOAD. * tests/derivations.scm ("derivation-build-plan and substitutes, non-substitutable dep"): New test.
* ui: 'show-derivation-outputs' accepts <derivation-input> records.Ludovic Courtès2019-06-27
| | | | | * guix/ui.scm (show-derivation-outputs): Handle <derivation-input> records.
* ui: 'show-what-to-build' accepts derivation inputs.Ludovic Courtès2019-06-27
| | | | | | | | This is a followup to f8a9f99cd602ce1dc5307cb0c21ae718ad8796bb. * guix/ui.scm (show-what-to-build)[inputs]: New variables. [substitutable-info]: Build the derivation list from INPUTS. Pass INPUTS to 'derivation-build-plan'.
* ui: 'show-what-to-build' uses 'derivation-build-plan'.Ludovic Courtès2019-06-27
| | | | | | | * guix/ui.scm (show-what-to-build)[build-or-substitutable?]: Remove. Use 'derivation-build-plan' instead of 'derivation-prerequisites-to-build', passing it all of DRV at once, and remove 'fold2' shenanigans and postprocessing of BUILD.
* ui: Add 'display-search-results' and use it.Ludovic Courtès2019-06-27
| | | | | | | | | | * guix/ui.scm (display-search-results): New procedure. * guix/scripts/package.scm (find-packages-by-description): Remove 'unzip2' call and return a list of pairs. (process-query): Change to use 'display-search-results'. * guix/scripts/system/search.scm (find-service-types): Remove 'unzip2' call and return a list of pairs. (guix-system-search): Use 'display-search-results'.
* ui: 'relevance' considers regexps connected with a logical and.Ludovic Courtès2019-06-27
| | | | | | * guix/ui.scm (relevance)[score]: Change to return 0 when one of REGEXPS doesn't match. * tests/ui.scm ("package-relevance"): New test.
* Add (guix diagnostics).Ludovic Courtès2019-06-03
| | | | | | | | | | * guix/ui.scm (warning, info, report-error, leave) (location->string, guix-warning-port, program-name) (highlight-argument, %highlight-argument, define-diagnostic) (%warning-color, %info-color, %error-color) (print-diagnostic-prefix): Move to... * guix/diagnostics.scm: ... here. New file. * Makefile.am (MODULES): Add it.
* ui: Make package outputs searchable.Chris Marusich2019-05-09
| | | | | | | | | | | | * guix/ui.scm (relevance): Allow the "field" procedure of a metric to return a list, and handle that case appropriately. Update docstring. (%package-metrics): Add a metric for package outputs. * guix/scripts/package.scm (find-packages-by-description): Update docstring. * tests/guix-package.sh: Add a test case to verify that package outputs are included in search results. Co-authored-by: Tobias Geerinckx-Rice <me@tobias.gr>
* ui: Highlight heading of generation lists.Ludovic Courtès2019-04-14
| | | | * guix/ui.scm (display-generation): Highlight the "Generation" heading.
* colors: Add 'highlight'.Ludovic Courtès2019-04-14
| | | | | | | * guix/colors.scm (%highlight-color): New variable. (highlight): New procedure. * guix/ui.scm (%highlight-argument)[highlight]: Remove. (%highlight-color): Remove.
* colors: Introduce a disjoint type and pre-compute ANSI escapes.Ludovic Courtès2019-04-11
| | | | | | | | | | | | | | | | | | * guix/colors.scm (color-table, color): Remove. (<color>): New record type. (print-color): New procedure. (define-color-table, color): New macros. (color-codes->ansi): New procedure. (%reset): New variable. (colorize-string): Rewrite accordingly. (color-rules): Adjust accordingly. * guix/status.scm (print-build-event): Adjust to new 'colorize-string' interface. * guix/ui.scm (%highlight-argument): Likewise. (%warning-colors, %info-colors, %error-colors, %hint-colors) (%highlight-colors): Remove. (%warning-color, %info-color, %error-color, %hint-color) (%highlight-color): New variables.
* ui: Highlight diagnostic format string arguments.Ludovic Courtès2019-04-10
| | | | | | * guix/ui.scm (highlight-argument): New macro. (%highlight-argument): New procedure. (define-diagnostic): Use 'highlight-argument'.
* ui: Colorize hints.Ludovic Courtès2019-04-10
| | | | | | * guix/ui.scm (%info-colors): Remove CYAN. (%hint-colors): New variable. (display-hint): Adjust so that the "hint:" prefix is colorized.
* ui: Colorize diagnostics.Ludovic Courtès2019-04-10
| | | | | | | | * guix/ui.scm (define-diagnostic): Add 'colors' parameter and pass it to 'print-diagnostic-prefix'. (warning, info, report-error): Add extra argument. (%warning-colors, %info-colors, %error-colors): New variables. (print-diagnostic-prefix): Add #:colors parameter and honor it.
* ui: Diagnostic procedures can display error location.Ludovic Courtès2019-04-10
| | | | | | | | | * guix/ui.scm (define-diagnostic): Add optional 'location' parameter. Pass it to 'print-diagnostic-prefix'. (print-diagnostic-prefix): Add optional 'location' parameter and honor it. (report-load-error): Use 'report-error' and 'warning' instead of (format (current-error-port) …).
* ui: Factorize 'print-diagnostic-prefix'.Ludovic Courtès2019-04-10
| | | | | * guix/ui.scm (define-diagnostic): Emit call to 'print-diagnostic-prefix'. (print-diagnostic-prefix): New procedure.
* ui: Make diagnostic message prefix translatable.Ludovic Courtès2019-04-10
| | | | | | * guix/ui.scm (define-diagnostic): Expect PREFIX to be enclosed in 'G_'. Emit call to 'gettext' on PREFIX. (warning, info, report-error): Wrap prefix in 'G_'.
* ui: Fix i18n for diagnostic messages.Ludovic Courtès2019-04-10
| | | | | | | | | | Until now, we'd pass 'gettext' the "augmented" format string, which 'gettext' would not find in message catalogs. Now we pass it FMT as is, which is what catalogs contain. * guix/ui.scm (define-diagnostic)[augmented-format-string]: Remove. Emit one 'format' call to print the prefix, and a second one to print the actual message.
* Add (guix colors).Ludovic Courtès2019-04-10
| | | | | | | * guix/colors.scm: New file. * Makefile.am (MODULES): Add it. * guix/ui.scm (color-table, color, colorize-string): Remove. * guix/status.scm (isatty?*, color-output? color-rules): Remove.
* ui: Bypass Texinfo parsing and rendering for searches.Ludovic Courtès2019-03-24
| | | | | | | | | | | | This makes search queries such as: LANGUAGE=fr guix package -s utilitaire -s recherche about 6 times faster. * guix/ui.scm (%package-metrics): Do not use 'package-synopsis-string' and 'package-description-string' to bypass Texinfo parsing and rendering.
* ui: Always print the exception upon load errors.Ludovic Courtès2019-02-11
| | | | | | | | | | | | Fixes <https://bugs.gnu.org/34402>. Reported by <pkill9@runbox.com>. Previously 'display-error' could be called with the wrong number of arguments (e.g., for 'git-error' exceptions), and thus nothing at all was displayed. * guix/ui.scm (report-load-error): Check whether ARGS matches the parameters for 'display-error' and call 'print-exception' otherwise.
* profiles: Raise an error for unmatched patterns.Ludovic Courtès2019-02-07
| | | | | | | | | | | | | | | Previously, "guix package -r something-not-installed" would silently complete. Now an error is raised. * guix/profiles.scm (&unmatched-pattern-error): New condition type. (manifest-matching-entries): Rewrite to raise an error when one of PATTERNS is not matched. * guix/ui.scm (call-with-error-handling): Handle 'unmatched-pattern-error?'. * tests/guix-package.sh: Add test. * tests/profiles.scm ("manifest-matching-entries"): Don't try to remove unmatched pattern. ("manifest-matching-entries, no match"): New test. ("manifest-transaction-effects"): Remove 'remove' field.
* ui: Don't report "build failed:" for daemon error messages.Ludovic Courtès2019-01-23
| | | | | | | | | | | | | | | | Until now we'd get things like: guix build: error: build failed: build of `/gnu/store/….drv' failed or: $ guix gc -d /sdf guix gc: error: build failed: path `/sdf' is not in the store which is kinda ridiculous. * guix/ui.scm (call-with-error-handling): Remove "build failed:" prefix for 'store-protocol-error?'.
* store: Rename '&nix-error' to '&store-error'.Ludovic Courtès2019-01-21
| | | | | | | | | | | | | | | | | | | * guix/store.scm (&nix-error): Rename to... (&store-error): ... this, and adjust users. (&nix-connection-error): Rename to... (&store-connection-error): ... this, and adjust users. (&nix-protocol-error): Rename to... (&store-protocol-error): ... this, adjust users. (&nix-error, &nix-connection-error, &nix-protocol-error): Define these condition types and their getters as deprecrated aliases. * build-aux/run-system-tests.scm, guix/derivations.scm, guix/grafts.scm, guix/scripts/challenge.scm, guix/scripts/graph.scm, guix/scripts/lint.scm, guix/scripts/offload.scm, guix/serialization.scm, guix/ssh.scm, guix/tests.scm, guix/ui.scm, tests/derivations.scm, tests/gexp.scm, tests/guix-daemon.sh, tests/packages.scm, tests/store.scm, doc/guix.texi: Adjust to use the new names.
* Remove most uses of the _IO*F constants.Ludovic Courtès2019-01-09
| | | | | | | | | | | | | | | | | | | | | | | | These constants, for use with 'setvbuf', were deprecated in Guile 2.2 and disappeared in Guile 3.0. Here we keep these constants in build-side code where removing them is not feasible. * guix/build/download-nar.scm (download-nar): Adjust 'setvbuf' calls to the Guile 2.2+ API. * guix/build/download.scm (open-socket-for-uri): Likewise. (open-connection-for-uri, url-fetch): Likewise. * guix/build/make-bootstrap.scm (make-stripped-libc): Likewise. * guix/build/union.scm (setvbuf) [guile-2.0]: New conditional wrapper. (union-build): Adjust to new API. * guix/ftp-client.scm (ftp-open, ftp-list, ftp-retr): Likewise. * guix/http-client.scm (http-fetch): Likewise. * guix/inferior.scm (proxy): Likewise. * guix/scripts/substitute.scm (fetch, http-multiple-get): Likewise. * guix/self.scm (compiled-modules): Likewise. * guix/ssh.scm (remote-daemon-channel, store-import-channel) (store-export-channel): Likewise. * guix/ui.scm (initialize-guix): Likewise. * tests/publish.scm (http-get-port): Likewise. * guix/store.scm (%newlines): Adjust comment.
* maint: Remove 'cond-expand' forms for Guile 2.0.Ludovic Courtès2019-01-09
| | | | | | | | | | | | | | | | | | | | | | Note: Leave 'cond-expand' forms used in the build-side modules that can run on %BOOTSTRAP-GUILE, which is currently Guile 2.0. * guix/build/compile.scm: Move 'use-modules' clause from 'cond-expand' to 'define-module' form. (%default-optimizations): Remove 'cond-expand'. * guix/build/download.scm (tls-wrap): Remove 'cond-expand'. * guix/build/syscalls.scm: Remove 'cond-expand' form around '%set-automatic-finalization-enabled?!' and 'without-automatic-finalization'. * guix/inferior.scm (port->inferior): Remove 'cond-expand'. * guix/scripts/pack.scm (wrapped-package)[build]: Remove 'cond-expand'. * guix/status.scm (build-event-output-port): Remove 'cond-expand'. * guix/store.scm (open-inet-socket): Remove 'cond-expand'. * guix/ui.scm (install-locale): Remove 'cond-expand'. * tests/status.scm ("current-build-output-port, UTF-8 + garbage"): Remove 'cond-expand'. * tests/store.scm ("current-build-output-port, UTF-8 + garbage"): Remove 'cond-expand'.
* ui: It's 2019 now!Ludovic Courtès2019-01-05
| | | | * guix/ui.scm (show-version-and-exit): Change year to 2019.
* ui: Report profile hooks separately.Ricardo Wurmus2018-12-19
| | | | | | | | | | | | * guix/ui.scm (profile-hook-derivation?): New procedure. (show-what-to-build): Distinguish among BUILD derivations that match 'profile-hook-derivation?'. Report them separately. * guix/status.scm (hook-message): New procedure. (print-build-event): Display profile hooks with readable hook name. * guix/profiles.scm (info-dir-file, ghc-package-cache-file, ca-certificate-bundle, glib-schemas, gtk-icon-themes, gtk-im-modules, xdg-desktop-database, xdg-mime-database, fonts-dir-file, manual-database): Augment derivation with "type" and "hook" properties.
* ui: Report file names in 'system-error' exceptions from 'execlp'.Timothy Sample2018-12-18
| | | | | | | | | Fixes <https://bugs.gnu.org/33755>. * guix/ui.scm (apply-formals): New macro. (execlp): New error-reporting wrapper. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* ui: 'show-what-to-build' reports grafts separately.Ludovic Courtès2018-11-28
| | | | | | * guix/ui.scm (graft-derivation?): New procedure. (show-what-to-build): Distinguish among BUILD derivations that match 'graft-derivation?'. Report them separately.