aboutsummaryrefslogtreecommitdiff
path: root/guix/progress.scm
Commit message (Collapse)AuthorAge
* tests: Import (guix build syscalls) when (guix build store-copy) is used.Ludovic Courtès2023-11-25
| | | | | | | | | | | | Fixes a test failure introduced in 189525412e3d803f3f77e15ec4a62aaa57f65a2d. * guix/progress.scm: Autoload (guix build syscalls). * tests/gexp.scm ("gexp->derivation, store copy"): Add (guix build syscalls) to the list of imported modules. Use ‘with-imported-modules’ rather than #:modules. Change-Id: I8d3fe90f564ef4b1a340f34cee6c08a741f7b836
* guix: Properly compute progress bar width.Julien Lepiller2023-11-11
| | | | | | | | | * guix/progress.scm (progress-reporter/bar): Take font width into account to compute progress bar width. * guix/git.scm (show-progress): Take font width into account to compute progress bar width. Change-Id: I946e447c1ea7c6eb4ff805400280f39e8f1a7c02
* guix: Show better progress bars.Julien Lepiller2023-02-19
| | | | | | | | | | | | | Style provides information on the characters to use before and after the progress bar content (`[` and `]` for the ascii style), as well as the character for filled step (`#` for ascii style). When supported, it provides intermediate steps. This is used for unicode style, to show better precision. * guix/progress.scm (<progress-bar-style>): New record type. (ascii-bar-style, unicode-bar-style): New variables. (progress-bar): Draw progress depending on style. When supported, use unicode style. Fall back to ascii style.
* progress: Rate limit drawing in the progress-reporter/bar.Christopher Baines2021-12-12
| | | | | | | | This helps smooth the output in cases where the bar is updated very quickly, for example in guix weather where it's computing derivations. * guix/progress.scm (progress-reporter/bar): Wrap the drawing code with the rate-limited procedure.
* progress: Add a download-size argument to progress-report-port.Mathieu Othacehe2021-06-01
| | | | * guix/progress.scm (progress-report-port): Add a download-size argument.
* status: Do not emit ANSI escapes when stderr is not a tty.Ludovic Courtès2020-12-18
| | | | | | | | | Fixes <https://bugs.gnu.org/44985>. Reported by Simon Josefsson <simon@josefsson.org>. * guix/progress.scm (display-download-progress): Add #:tty? and honor it. * guix/status.scm (print-build-event): Pass #:tty? to 'display-download-progress'.
* substitute: Cache and reuse connections while substituting.Ludovic Courtès2020-12-08
| | | | | | | | | | | | | | | | | | | That way, when fetching a series of substitutes from the same server(s), the connection is reused instead of being closed/opened for each substitutes, which saves on network round trips and TLS handshakes. * guix/http-client.scm (http-fetch): Add #:keep-alive? and honor it. * guix/progress.scm (progress-report-port): Add #:close? parameter and honor it. * guix/scripts/substitute.scm (at-most): Return the tail as a second value. (fetch): Add #:port and #:keep-alive? and honor them. (%max-cached-connections): New variable. (open-connection-for-uri/cached, call-with-cached-connection): New procedures. (with-cached-connection): New macro. (process-substitution): Wrap 'fetch' call in 'with-cached-connection'. Pass #:close? to 'progress-report-port'.
* Remove workaround for 'time-monotonic' in Guile 2.2.2.Ludovic Courtès2020-03-22
| | | | | | | | | | | | This is a followup to e688c2df3924423b67892cc9939ca099c729d1cb. * build-aux/hydra/evaluate.scm <top level>: Remove 'time-monotonic' definition. * guix/cache.scm: Likewise. * guix/progress.scm: Likewise. * guix/scripts/substitute.scm: Likewise. * guix/scripts/weather.scm: Likewise. * tests/cache.scm: Likewise.
* progress: Add 'progress-report-port'.Ludovic Courtès2019-12-12
| | | | | * guix/scripts/substitute.scm (progress-report-port): Move to... * guix/progress.scm (progress-report-port): ... here. New procedure.
* progress: Call 'time-difference' on times of the same type.Ludovic Courtès2019-06-24
| | | | | | | | Guile 2.2.5 and 2.9.2 would catch the issue. This is a followup to 88bc3c89bf5145d24c2270d2192b7be547e0024f. * guix/progress.scm (display-download-progress)[elapsed]: Pass 'current-time' the same type as START-TIME.
* progress: Provide the proper type for %PROGRESS-INTERVAL.Ludovic Courtès2019-06-02
| | | | | | The (srfi srfi-19) module of Guile 2.9.2 catches the wrong type. * guix/progress.scm (%progress-interval): Change type to TIME-DURATION.
* progress: Do not display the last 0B transfer when size is unknown.Clément Lassieur2018-11-16
| | | | | * guix/progress.scm (display-download-progress): Don't display anything when both SIZE and TRANSFERRED are null.
* progress: Fix crash because of division by zero.Clément Lassieur2018-11-16
| | | | | * guix/progress.scm (display-download-progress): Handle the case where SIZE is null.
* progress: Fix total size in "@ download-succeeded" traces.Ludovic Courtès2018-10-05
| | | | | | | | | | | | Fixes a regression introduced in 1d0be47ab680db938ac8da1ee65e1de91e198f67 whereby the total size for directories (coming from substitutes) would be 4KiB. This led the progress bar to go back to the start, typically. * guix/progress.scm (progress-reporter/trace): Add 'total'. In 'start', initialize it. Adjust 'report' to update it. Adjust 'stop' to prefer SIZE as the actual size and then TOTAL. Do not use the size of FILE as the total since that could be 4KiB when FILE is a directory.
* progress: Generate valid 'download-progress' traces when the size is unknown.Ludovic Courtès2018-10-04
| | | | | | | | | | Fixes <https://bugs.gnu.org/32895>. Reported by Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>. * guix/progress.scm (progress-reporter/trace): In 'stop', make sure SIZE is an integer. Previously we'd generate a "@ download-progress" trace with #f for the 'transferred' number when downloading files whose size is not known in advance.
* Add (guix status) and use it for pretty colored output.Ludovic Courtès2018-09-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* progress: Add 'display-download-progress'.Ludovic Courtès2018-09-27
| | | | | | * guix/progress.scm (display-download-progress): New procedure. (progress-reporter/file)[render]: Rewrite in terms of 'display-download-progress'.
* progress: 'progress-reporter-report!' takes any number of arguments.Ludovic Courtès2018-09-25
| | | | | * guix/progress.scm (progress-reporter-report!): Accept an arbitrary number of arguments and pass them to REPORT.
* progress: Rename 'erase-in-line' to 'erase-current-line'.Ludovic Courtès2017-12-15
| | | | | | | Suggested by Danny Milosavljevic <dannym@scratchpost.org>. * guix/progress.scm (erase-in-line): Rename to... (erase-current-line): ... this. Adjust callers.
* weather: Use (guix progress) for progress report.Ludovic Courtès2017-12-01
| | | | | | | | | * guix/progress.scm (start-progress-reporter!, stop-progress-reporter!) (progress-reporter-report!): New procedures. * guix/scripts/weather.scm (call-with-progress-reporter): New procedure. (package-outputs)[update-progress!]: Remove. Use 'call-with-progress-reporter' instead. (guix-weather): Parameterize 'current-terminal-columns'.
* progress: Add 'progress-reporter/bar'.Ludovic Courtès2017-12-01
| | | | * guix/progress.scm (progress-reporter/bar): New procedure.
* progress: 'progress-bar' accounts for brackets.Ludovic Courtès2017-12-01
| | | | | * guix/progress.scm (progress-bar): Subtract 2 to BAR-WIDTH to account for brackets.
* progress: Factorize erase-in-line.Ludovic Courtès2017-12-01
| | | | | * guix/progress.scm (erase-in-line): New procedure. (progress-reporter/file): Use it.
* Add (guix progress).Ludovic Courtès2017-10-19
Among other things, this removes (guix utils), (guix ui), (guix config), etc. from the closure of (guix build download), as was the case since 798648515b77507c242752457b4dc17c155bad6e. * guix/utils.scm (<progress-reporter>, call-with-progress-reporter): Move to... * guix/progress.scm: ... here. New file. * Makefile.am (MODULES): Add it. * guix/build/download.scm (current-terminal-columns) (nearest-exact-integer, duration->seconds, seconds->string) (byte-count->string, progress-bar, string-pad-middle) (rate-limited, progress-reporter/file, dump-port*) (time-monotonic): Move to progress.scm. * guix/scripts/download.scm: Adjust accordingly. * guix/scripts/substitute.scm: Likewise.