summaryrefslogtreecommitdiff
path: root/guix/ui.scm
AgeCommit message (Collapse)Author
2019-05-09ui: Make package outputs searchable.Chris Marusich
* 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>
2019-04-14ui: Highlight heading of generation lists.Ludovic Courtès
* guix/ui.scm (display-generation): Highlight the "Generation" heading.
2019-04-14colors: Add 'highlight'.Ludovic Courtès
* guix/colors.scm (%highlight-color): New variable. (highlight): New procedure. * guix/ui.scm (%highlight-argument)[highlight]: Remove. (%highlight-color): Remove.
2019-04-11colors: Introduce a disjoint type and pre-compute ANSI escapes.Ludovic Courtès
* 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.
2019-04-10ui: Highlight diagnostic format string arguments.Ludovic Courtès
* guix/ui.scm (highlight-argument): New macro. (%highlight-argument): New procedure. (define-diagnostic): Use 'highlight-argument'.
2019-04-10ui: Colorize hints.Ludovic Courtès
* guix/ui.scm (%info-colors): Remove CYAN. (%hint-colors): New variable. (display-hint): Adjust so that the "hint:" prefix is colorized.
2019-04-10ui: Colorize diagnostics.Ludovic Courtès
* 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.
2019-04-10ui: Diagnostic procedures can display error location.Ludovic Courtès
* 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) …).
2019-04-10ui: Factorize 'print-diagnostic-prefix'.Ludovic Courtès
* guix/ui.scm (define-diagnostic): Emit call to 'print-diagnostic-prefix'. (print-diagnostic-prefix): New procedure.
2019-04-10ui: Make diagnostic message prefix translatable.Ludovic Courtès
* 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_'.
2019-04-10ui: Fix i18n for diagnostic messages.Ludovic Courtès
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.
2019-04-10Add (guix colors).Ludovic Courtès
* 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.
2019-03-24ui: Bypass Texinfo parsing and rendering for searches.Ludovic Courtès
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.
2019-02-11ui: Always print the exception upon load errors.Ludovic Courtès
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.
2019-02-07profiles: Raise an error for unmatched patterns.Ludovic Courtès
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.
2019-01-23ui: Don't report "build failed:" for daemon error messages.Ludovic Courtès
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?'.
2019-01-21store: Rename '&nix-error' to '&store-error'.Ludovic Courtès
* 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.
2019-01-09Remove most uses of the _IO*F constants.Ludovic Courtès
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.
2019-01-09maint: Remove 'cond-expand' forms for Guile 2.0.Ludovic Courtès
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'.
2019-01-05ui: It's 2019 now!Ludovic Courtès
* guix/ui.scm (show-version-and-exit): Change year to 2019.
2018-12-19ui: Report profile hooks separately.Ricardo Wurmus
* 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.
2018-12-18ui: Report file names in 'system-error' exceptions from 'execlp'.Timothy Sample
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>
2018-11-28ui: 'show-what-to-build' reports grafts separately.Ludovic Courtès
* guix/ui.scm (graft-derivation?): New procedure. (show-what-to-build): Distinguish among BUILD derivations that match 'graft-derivation?'. Report them separately.
2018-09-27Add (guix status) and use it for pretty colored output.Ludovic Courtès
* guix/progress.scm (progress-reporter/trace): New procedure. (%progress-interval): New variable. (progress-reporter/file): Use it. * guix/scripts/build.scm (set-build-options-from-command-line): Pass #:print-extended-build-trace?. (%default-options): Add 'print-extended-build-trace?'. (guix-build): Parameterize CURRENT-TERMINAL-COLUMNS. Use 'build-status-updater'. * guix/scripts/environment.scm (%default-options): Add 'print-extended-build-trace?'. (guix-environment): Wrap body in 'with-status-report'. * guix/scripts/pack.scm (%default-options): Add 'print-build-trace?' and 'print-extended-build-trace?'. (guix-pack): Wrap body in 'with-status-report'. * guix/scripts/package.scm (%default-options, guix-package): Likewise. * guix/scripts/system.scm (%default-options, guix-system): Likewise. * guix/scripts/pull.scm (%default-options, guix-pull): Likewise. * guix/scripts/substitute.scm (progress-report-port): Don't call STOP when TOTAL is zero. (process-substitution): Add #:print-build-trace? and honor it. (guix-substitute)[print-build-trace?]: New variable. Pass #:print-build-trace? to 'process-substitution'. * guix/status.scm: New file. * guix/store.scm (set-build-options): Add #:print-extended-build-trace?; pass it into PAIRS. (%protocol-version): Bump. (protocol-version, nix-server-version): New procedures. (current-store-protocol-version): New variable. (with-store, build-things): Parameterize it. * guix/ui.scm (build-output-port): Remove. (colorize-string): Export. * po/guix/POTFILES.in: Add guix/status.scm. * tests/status.scm: New file. * Makefile.am (SCM_TESTS): Add it. * nix/libstore/worker-protocol.hh (PROTOCOL_VERSION): Bump to 0x162. * nix/libstore/build.cc (DerivationGoal::registerOutputs) (SubstitutionGoal::finished): Print a "@ hash-mismatch" trace before throwing.
2018-09-11ui: Do not filter hash mismatch lines.Ricardo Wurmus
Reported by Pjotr Prins <pjotr.public12@thebird.nl>. * guix/ui.scm (build-output-port): Add pattern for hash mismatch error; be more careful with error messages in verbose mode.
2018-09-09ui: Add soft port for styling and filtering build output.Ricardo Wurmus
* guix/ui.scm (build-output-port): New procedure. * guix/scripts/package.scm (%default-options): Print build trace. (guix-package): Use build-output-port. * guix/scripts/build.scm (guix-build): Use build-output-port. Co-authored-by: Sahithi Yarlagadda <sahi@swecha.net>
2018-09-09ui: Add support for colorization.Sahithi Yarlagadda
* guix/ui.scm (ansi-color-tables): New variable. (color, colorize-string): New procedures. Signed-off-by: Ricardo Wurmus <rekado@elephly.net>
2018-07-11ui: Fix typo.Ludovic Courtès
* guix/ui.scm (display-profile-content-diff): Fix typo in docstring.
2018-07-07ui: Add -V as short option for --version.Kyle Meyer
* guix/ui.scm (run-guix): Add -V as the short option for --version for consistency with most commands. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2018-07-03ui: Report file names in 'system-error' exceptions from 'delete-file'.Ludovic Courtès
* guix/ui.scm (delete-file): New error-reporting wrapper.
2018-07-03ui: Make 'check-available-space' public.Ludovic Courtès
* guix/ui.scm (check-available-space): Add optional 'directory' parameter, defaulting to (%store-prefix). Honor it. Make public.
2018-06-29ui: Increase relevance score for exact matches.Ludovic Courtès
Previously "guix package -s python" would have 'python2-zope-interface' as its first result (relevance: 10), followed by many other python-* packages with the same score, while 'python' itself would come later (relevance: 7). This change makes 'python' the first result (relevance: 27). Reported by Gábor Boskovits. * guix/ui.scm (relevance)[score]: Use 'fold-matches' instead of 'match:count' to counter the number of maches. Give more weight to exact matches.
2018-06-27ui: Hint at the installation of locale packages and 'GUIX_LOCPATH'.Ludovic Courtès
* guix/ui.scm (install-locale): Hide the "warning: failed to install locale" on Guile 2.2. Add a hint about 'glibc-utf8-locales' and 'GUIX_LOCPATH'.
2018-06-14guix: ui: Allow translation of dates.Julien Lepiller
* guix/ui.scm (display-generation): Allow translation of dates. The format string will show dates as month day year, but some languages use a different convention.
2018-06-09ui: Avoid #:select'ing bindings introduced in the latest (guix build utils).Ludovic Courtès
This should allow 'guix pull' to complete even when invoked from a Guix that predates commit 5d669883ecc104403c5d3ba7d172e9c02234577c. * guix/ui.scm: Use #:hide instead of #:select. This is a followup to 5d669883ecc104403c5d3ba7d172e9c02234577c.
2018-05-06Merge branch 'master' into core-updatesMarius Bakke
2018-05-04guix build: Nicely report unbound variables with hints.Ludovic Courtès
* guix/ui.scm (print-unbound-variable-error): Add "error:" to the message. (report-unbound-variable-error): New procedure, with code formerly in 'report-load-error'. (report-load-error): Use it. (call-with-unbound-variable-handling): New procedure. (with-unbound-variable-handling): New macro. * guix/scripts/build.scm (options->derivations): Wrap body in 'with-unbound-variable-handling'. * tests/guix-build.sh (GUIX_PACKAGE_PATH): Add test.
2018-05-04ui: Factorize 'last-frame-with-source'.Ludovic Courtès
* guix/ui.scm (last-frame-with-source): New procedure. (load*)[frame-with-source]: Remove. Use 'last-frame-with-source'.
2018-04-30Merge branch 'master' into core-updatesMark H Weaver
2018-04-27guix system: Report wrong file system 'device' fields.Ludovic Courtès
Previously, if you wrote (device "my-label") without (title 'label), you'd get: guix system: error: stat: No such file or directory: "my-label" Now you get a proper error and a hint. Reported by Pierre-Antoine Rouby. * guix/scripts/system.scm (check-file-system-availability)[literal]: New variable. Loop over LITERAL. * gnu/system/file-systems.scm (%pseudo-file-system-types): New variable. * guix/ui.scm (display-hint): Make public.
2018-03-16utils: invoke: Raise exceptions using SRFI-34 and SRFI-35.Mark H Weaver
* guix/build/utils.scm (&invoke-error): New condition type. (invoke-error?, invoke-error-program, invoke-error-arguments) (invoke-error-exit-status, invoke-error-term-signal) (invoke-error-stop-signal): New exported procedures. (invoke): Raise exceptions using SRFI-34 and SRFI-35. * guix/ui.scm (call-with-error-handling): Add a guard clause for &invoke-error conditions.
2018-03-07ui: 'display-hint' preserves Texinfo formatting.Ludovic Courtès
The previous method would mess up with @example formatting, for instance. * guix/ui.scm (display-hint): Parameterize '%text-width' instead of using 'fill-paragraph'.
2018-03-07ui: Display fix hints in the case where we have location info.Ludovic Courtès
* guix/ui.scm (call-with-error-handling): Display fix-hints in the error + message case.
2018-03-06ui: 'load*' no longer fails on Guile 2.2.3 upon EACCES or similar.Ludovic Courtès
Previously, if ~/.cache was not write-accessible, 'guix' would exit with code 1 without printing any message. That was because the 'make-stack' call would fail since the exception (a 'system-error) came from 'compile-file', which was called at a point where TAG wasn't installed yet. Secondly, to mimick auto-compilation behavior, we just swallow 'system-error raised by 'compile-file'. Reported by Clément Lassieur. * guix/ui.scm (load*): Move 'compile-file' call in the dynamic extent of TAG. Catch 'system-error around it and ignore it.
2018-03-05ui: Better workaround for lack of '%fresh-auto-compile' on 2.2.3.Ludovic Courtès
Fixes <https://bugs.gnu.org/29226> for the most part. * guix/ui.scm (load*): Add call to 'compile-file' on 2.2.3.
2018-01-15ui: Disable '%fresh-auto-compile' only for Guile 2.2.3.Ludovic Courtès
Mitigates <https://bugs.gnu.org/29881>. Reported by Diego Nicola Barbato <dnbarbato@posteo.de>. * guix/ui.scm (load*): Unset '%fresh-auto-compile' only on Guile 2.2.3.
2018-01-07ui: Display hints that come along with '&message' conditions.Ludovic Courtès
* guix/ui.scm (call-with-error-handling): Add case for message and fix-hint?.
2018-01-01ui: It's 2018 now!Ludovic Courtès
* guix/ui.scm (show-version-and-exit): Change year to 2018.
2017-12-18ui: Non-zero exit for compound '&message' and '&error-location' conditions.Ludovic Courtès
* guix/ui.scm (call-with-error-handling): When both 'message?' and 'error-location?' are true, add call to 'exit'.
2017-12-10ui: Display hints to resolve profile collisions.Ludovic Courtès
Fixes <https://bugs.gnu.org/29255>. Reported by Ben Sturmfels <ben@sturm.com.au>. * guix/ui.scm (display-collision-resolution-hint): New procedure. (call-with-error-handling): Call it upon '&profile-collistion-error'.