aboutsummaryrefslogtreecommitdiff
path: root/guix
Commit message (Collapse)AuthorAge
* substitute: Rework connection error handling.prepare-to-move-guix-scripts-substitute-codeChristopher Baines2021-02-22
| | | | | | | | | | | | | | | | | | | | | | | | This is part of trying to reduce the interdependency of code within the substitute module. This commit addresses some of the error handling that was performed through open-connection-for-uri/maybe. The new approach is to use call-with-connection-error-handling, and wrap calls to http-multiple-get and http-fetch with that procedure, which takes care of handling connection errors. I think this is even slightly more rigerous than the previous setup, because this approach handles connection errors that occur when http-multiple-get reconnects to a host. * guix/scripts/substitute.scm (open-connection-for-uri/maybe): Transform in to call-with-connection-error-handling. (fetch-narinfos): Use call-with-connection-error-handling. (process-query): Replace open-connection-for-uri/maybe with open-connection-for-uri/cached. (open-connection-for-uri/cached): Set a default timeout, matching the behaviour in open-connection-for-uri/maybe. (process-substitution): Use call-with-connection-error-handling.
* substitute: Remove fetch-narinfos use open-connection-for-uri/maybe.Christopher Baines2021-02-22
| | | | | | | | | | | | | | | | | | | At least by default. Instead, make the open-connection procedure a parameter, and make the default guix:open-connection-for-uri. Do so similarly for lookup-narinfos and lookup-narinfos/diverse which work towards calling fetch-narinfos. This means this code can be moved to a different module, without having use/move the connection caching code. * guix/scripts/substitute.scm (fetch-narinfos): Add #:open-connection argument, and call http-multiple-get with it. (lookup-narinfos) Add #:open-connection argument, and call fetch-narinfos with it. (lookup-narinfos/diverse): Add #:open-connection argument, and call lookup-narinfos with it. (process-query): Call lookup-narinfos/diverse with #:open-connection open-connection-for-uri/maybe.
* substitute: Inline fetch in to process-substitutes.Christopher Baines2021-02-22
| | | | | | | | As it's only called in one place, and this should make the code easier to read. * guix/scripts/substitute.scm (fetch): Move procedure inside… (process-substitution): …here.
* substitute: Remove redundant fetch arguments.Christopher Baines2021-02-22
| | | | | | | | | It's just called in one place, with hardcoded argument values, so just inline them. * guix/scripts/substitute.scm (fetch): Remove arguments that don't vary, copy the values from the call site in process-substitution. (process-substitution): Remove unnecessary argument values from fetch call.
* substitute: Remove now redundant connection caching helpers.Christopher Baines2021-02-22
| | | | | | | | Failures now should be handled where they occur, and if there's a problem that's symptomatic of an issue with the connection, the port should be closed. * guix/scripts/substitute.scm (call-with-cached-connection): Remove procedure. (with-cached-connection): Remove syntax rule.
* substitute: Change connection cache handling in process-substitution.Christopher Baines2021-02-22
| | | | | | | | | Just pass open-connection-for-uri/maybe to http-fetch, this removes the need for with-cached-connection and passing the port in. * guix/scripts/substitute.scm (fetch): Don't take a port as an argument, and pass open-connection-for-uri/maybe to http-fetch. (process-substitution): Don't call fetch with with-cached-connection.
* http-client: Accept #:open-connection in http-fetch.Christopher Baines2021-02-22
| | | | | | | | So that an alternative procedure can be passed in, perhaps to perform connection caching. * guix/http-client.scm (http-fetch): Add an #:open-connection keyword argument.
* substitute: Stop using call-with-cached-connection in fetch-narinfos.Christopher Baines2021-02-22
| | | | | | | | | Instead, just pass open-connection-for-uri/maybe to http-multiple-get. This code should be functionaly similar to the previous code. The eventual aim of this is to make the connection caching not mandatory in fetch-narinfos. * guix/scripts/substitute.scm (fetch-narinfos): Remove use of call-with-cached-connection.
* substitute: open-connection-for-uri/maybe add #:verify-certificate?.Christopher Baines2021-02-22
| | | | | | | | As this is used by http-fetch and http-multiple-get when they call the specified open connection procedure. * guix/scripts/substitute.scm (open-connection-for-uri/maybe): Support #:verify-certificate?.
* http-client: Add error handling to http-multiple-get.Christopher Baines2021-02-22
| | | | | | | | | | Making sure to close the port if it looks to be unusable. This closing of the port will allow for caching connections, without caching broken connections, as the cache can avoid handing out closed ports. * guix/http-client.scm (http-multiple-get): Try to catch exceptions that happen if the port is unusable, this is a adaptation of code within the (guix scripts substitute) module.
* guix: Move http-multiple-get to (guix http-client).Christopher Baines2021-02-22
| | | | | | | From (guix scripts substitute). This will make it easier to reuse this code. * guix/scripts/substitute.scm (http-multiple-get): Remove, and move to… * guix/http-client.scm (http-multiple-get): …here.
* substitute: Remove redundant let block from fetch.Christopher Baines2021-02-22
| | | | * guix/scripts/substitute.scm (fetch): Remove redundant let block.
* substitute: Remove connection handling from fetch.Christopher Baines2021-02-22
| | | | | | | http-fetch does this, so just use that code instead. * guix/scripts/substitute.scm (fetch): Remove connection handling when the port is closed.
* substitute: Remove buffer handling from fetch.Christopher Baines2021-02-22
| | | | | | | http-fetch does this, so just set the right option. * guix/scripts/substitute.scm (fetch): Remove buffering code, and pass #:buffered? to http-fetch.
* packages: 'package-field-location' handles 'search-path' returning #f.Ludovic Courtès2021-02-22
| | | | | | | | | | Fixes <https://bugs.gnu.org/46390>. Reported by zimoun <zimon.toutoune@gmail.com>. This is similar to the fix in d10474c38d58bdc676e64336769dc2e00cdfa8ed. * guix/packages.scm (package-field-location): Handle FILE not in %LOAD-PATH. * tests/guix-lint.sh: Add test.
* ui: Fix typo in description.Brice Waegeneire2021-02-19
| | | | * guix/ui.scm (switch-to-generation*): Fix typo in description.
* scripts: system: Accept <image> records as input.Mathieu Othacehe2021-02-17
| | | | | | | | | | | | | | * guix/scripts/system.scm (system-derivation-for-action): Replace "os" argument by "image". Remove "image-size", "image-type", "label" and "volatile-root?" arguments. (perform-action): Ditto. (process-action): Construct the <image> record and pass it to "perform-action" procedure. * tests/guix-system.sh: Adapt accordingly. * gnu/system/images/hurd.scm: Return the default image. * gnu/system/images/novena.scm: Ditto. * gnu/system/images/pine64.scm: Ditto. * gnu/system/images/pinebook-pro.scm Ditto.
* scripts: system: Remove 'vm-image' command.Mathieu Othacehe2021-02-17
| | | | | | | | | | | | | | | Remove the 'vm-image' command that has been superseded by the 'image' command. * gnu/system/vm.scm (system-qemu-image): Remove it. * guix/scripts/system.scm (system-derivation-for-action): Mark 'vm-image' command as deprecated and use the image API to produce the VM image. (perform-action, show-help): Adapt accordingly. * tests/guix-system.sh: Ditto. * doc/guix.texi (Invoking guix system, Running Guix in a VM): Ditto. * etc/completion/fish/guix.fish: Ditto. * etc/completion/zsh/_guix: Ditto.
* ftp-client: Before 'PASV', try 'EPSV' first for IPv6.宋文武2021-02-15
| | | | | | | This fixes <https://bugs.gnu.org/46481>. * guix/ftp-client.scm (ftp-epsv, ftp-passive): New procedures. (ftp-list, ftp-retr): Replace call to 'ftp-pasv' with 'ftp-passive'.
* import: crate: Use repository when home-page is unavailableNicolas Goaziou2021-02-12
| | | | | | * guix/import/crate.scm (make-crate-sexp): Always use home-page, which is properly set up by the caller. (crate->guix-package): Make sure to use the repository when home-page is null.
* pull: Create the "${XDG_CONFIG_HOME}/guix" directory when needed.宋文武2021-02-12
| | | | | | | This fixes <https://bugs.gnu.org/46269>. * guix/scripts/pull.scm (ensure-default-profile): Add a 'mkdir-p' call before 'symlink'.
* environment: Allow starting from existing profile.Lars-Dominik Braun2021-02-11
| | | | | | | | * guix/scripts/environment.scm (%options): Add -p/--profile switch. (show-help): Document new switch. (guix-environment): Handle new 'profile switch. Signed-off-by: 宋文武 <iyzsong@member.fsf.org>
* docker: Pass '--hard-dereference' to 'tar' to ensure reproducible builds.Ludovic Courtès2021-02-08
| | | | | | | | | Reported by zimoun at <https://lists.gnu.org/archive/html/guix-devel/2021-02/msg00053.html>. * guix/docker.scm (%tar-determinism-options): Add '--hard-dereference'. Co-authored-by: zimoun <zimon.toutoune@gmail.com>
* build-system: Add renpy-build-system.Leo Prikler2021-02-07
| | | | | | | * guix/build/renpy-build-system.scm: New file. * guix/build-system/renpy.scm: New file. * Makefile.am (MODULES): Add them here. * doc/guix.texi (Build Systems): Document renpy-build-system.
* guix describe: 'display-profile-content' checks the right generation.Ludovic Courtès2021-02-05
| | | | | | | | | | | | | Fixes a regression introduced in 316fc2acbb112bfa572ae30f95a93bcd56621234, whereby 'guix pull -l' would always display channel information corresponding to the latest profile generation. Reported by Vagrant Cascadian. * guix/scripts/describe.scm (profile-generation-channels): New procedure. (display-profile-content): Change default value of 'channels'.
* channels: Consider the current channel commit as authentic.Ludovic Courtès2021-02-04
| | | | | | | | | | | | | | Fixes <https://bugs.gnu.org/45895>. When the ~/.cache/guix/authentication is empty, this change allows authentication to start at the current commit, as shown by 'guix describe', instead of starting from the introductory commit, which would take more and more time (there's currently 18K commits per year). * guix/git-authenticate.scm (authenticate-repository): Add #:authentic-commits. [authenticated-commits]: Append it. * guix/channels.scm (authenticate-channel)[authentic-commits]: New variable. Pass it to 'authenticate-repository'.
* build: Add '--with-channel-commit' and related configure flags.Ludovic Courtès2021-02-04
| | | | | | | | Partially fixes <https://bugs.gnu.org/45896>. * m4/guix.m4 (GUIX_CHANNEL_METADATA): New macro. * configure.ac: Use it. * guix/config.scm.in (%channel-metadata): Adjust accordingly.
* channels: Record 'guix' channel metadata in (guix config).Ludovic Courtès2021-02-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | Partially fixes <https://bugs.gnu.org/45896>. * guix/config.scm.in (%channel-metadata): New variable. * guix/describe.scm (channel-metadata): Use it. (current-channels): New procedure. (current-profile-entries): Clarify docstring. * guix/self.scm (compiled-guix): Add #:channel-metadata and pass it to 'make-config.scm'. (make-config.scm): Add #:channel-metadata and define '%channel-metadata' in the generated file. (guix-derivation): Add #:channel-metadata and pass it to 'compiled-guix'. * guix/channels.scm (build-from-source): Replace 'name', 'source', and 'commit' parameters with 'instance'. Pass #:channel-metadata to BUILD. (build-channel-instance): Adjust accordingly. * build-aux/build-self.scm (build-program): Add #:channel-metadata and pass it to 'guix-derivation'. (build): Add #:channel-metadata and pass it to 'build-program'. * guix/scripts/describe.scm (display-profile-info): Add optional 'channels' parameter. Pass it to 'display-profile-content'. (display-profile-content): Add optional 'channels' parameter and honor it. Iterate on CHANNELS rather than on the manifest entries of PROFILE. (guix-describe): When PROFILE is #f, call 'current-channels' and pass it to 'display-profile-info', unless it returns the empty list.
* store: 'store-path-hash-part' really returns false for invalid file names.Ludovic Courtès2021-02-04
| | | | | | | The "store-path-hash-part #f", due to a SRFI-64 bug, was marked as successful even though 'store-path-hash-part' was throwing an exception. * guix/store.scm (store-path-hash-part): Really return #f.
* ui: Add hint for command typo.zimoun2021-02-03
| | | | | | | * guix/ui.scm (command-hint): New variable (run-guix-command): Use it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* guix: scripts: Add hint for option typo.zimoun2021-02-03
| | | | | | | * guix/scripts.scm (option-hint): New procedure. (parse-command-line): Add 'option-hint'. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
* utils: Add string distance.zimoun2021-02-03
| | | | | | | | * guix/utils.scm (string-distance): New procedure. (string-closest): New procedure. * tests/utils.scm ("string-distance", "string-closest"): New tests. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* guix: narinfo: Export narinfo-contents.Christopher Baines2021-02-02
| | | | | | | As this is useful if you want to work with narinfo signatures outside of Guix, in the Guix Data Service for example. * guix/narinfo.scm: Export narinfo-contents.
* import: gnu: Fix the detection of non-GNU packages.Maxim Cournoyer2021-02-02
| | | | | | * guix/import/gnu.scm (gnu->guix-package): Move the 'find-package' call before the 'latest-release' call, which would fail when the package did not have an entry on the FTP server.
* guix package: Add '--export-channels'.Ludovic Courtès2021-02-01
| | | | | | | | | | | | | * guix/channels.scm (sexp->channel): Export. * guix/describe.scm: Use (guix channels). (manifest-entry-provenance): New procedure. * guix/scripts/package.scm (channel=?, export-channels): New procedures. (show-help, %options): Add '--export-channels'. (process-query): Honor it. * build-aux/build-self.scm (build-program)[select?]: Exclude (guix channels) to account for the (guix describe) change above. * doc/guix.texi (Invoking guix package): Document it.
* channels: Add 'channel->code'.Ludovic Courtès2021-02-01
| | | | | | * guix/channels.scm (channel->code): New procedure, taken from... * guix/scripts/describe.scm (channel->sexp): ... here. Adjust callers accordingly.
* guix describe: Use 'manifest-entry-channel'.Ludovic Courtès2021-02-01
| | | | | * guix/channels.scm (manifest-entry-channel): Export. * guix/scripts/describe.scm (display-profile-content): Use it.
* channels: Add the channel name to channel sexps.Ludovic Courtès2021-02-01
| | | | | | * guix/channels.scm (channel-instance->sexp): Add 'name'. (sexp->channel): Extract the name from SEXP, using the optional argument as a fallback.
* channels: Factorize 'manifest-entry-channel' and channel serialization.Ludovic Courtès2021-02-01
| | | | | | | | | * guix/channels.scm (sexp->channel, manifest-entry-channel): New procedures. (profile-channels): Replace lambda by 'manifest-entry-channel'. (channel-instance->sexp): New procedure. (channel-instances->manifest)[instance->entry]: Use 'channel-instance->sexp' instead of inline code.
* guix package: Add '--export-manifest'.Ludovic Courtès2021-02-01
| | | | | | | | | * guix/scripts/package.scm (export-manifest): New procedure. (show-help, %options): Add '--export-manifest'. (process-query): Honor it. * guix/build/profiles.scm (build-profile): Mention it. * tests/guix-package.sh: Test it. * doc/guix.texi (Invoking guix package): Document it.
* utils: Add 'version-unique-prefix'.Ludovic Courtès2021-02-01
| | | | | * guix/utils.scm (version-unique-prefix): New procedure. * tests/utils.scm ("version-unique-prefix"): New test.
* profiles: Add 'manifest->code'.Ludovic Courtès2021-02-01
| | | | | | | * guix/profiles.scm (manifest->code): New procedure. * tests/profiles.scm ("manifest->code, simple") ("manifest->code, simple, versions") ("manifest->code, transformations"): New tests.
* scripts: import: json: Fix error handling.zimoun2021-01-31
| | | | | | | | Fixes partially <https://bugs.gnu.org/44115>. * guix/scripts/import/json.scm (guix-import-json): Handle error. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* import: gnu: Mention package name upon failure.zimoun2021-01-31
| | | | | | | * guix/import/gnu.scm (gnu->guix-package): Use 'formatted-message' and mention the package name in error messages. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* gnu-maintenance: Fix error handling.zimoun2021-01-31
| | | | | | | | Fixes partially <https://bugs.gnu.org/44115>. * guix/gnu-maintenance.scm (latest-release): Handle 'ftp-error'. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* database: Validate #:nar-size and #:time when registering store items.Ludovic Courtès2021-01-31
| | | | | | | * guix/store/database.scm (assert-integer): New procedure. (update-or-insert): Use it to validate NAR-SIZE and TIME. * tests/store-database.scm ("sqlite-register with incorrect size"): New test.
* database: Remove workarounds unnecessary with guile-sqlite3 0.1.2.Ludovic Courtès2021-01-31
| | | | * guix/store/database.scm (sqlite-exec, sqlite-finalize): Remove.
* ci: Add missing imports.Ludovic Courtès2021-01-31
| | | | | | | This is a followup to 041a9466ea23d6ae811491bcf529bf9487317b48. * guix/ci.scm: Add missing imports. * guix/channels.scm: Remove (guix ci) import.
* guix: channels: Introduce "channel-with-substitutes-available".Mathieu Othacehe2021-01-31
| | | | | | | | * guix/channels.scm (find-latest-commit-with-substitutes, channel-with-substitutes-available): New procedures. * guix/scripts/pull.scm (guix-pull): Move "channel-list" call inside the %current-system parameter scope. * doc/guix.texi (Channels with substitutes): New section.
* guix system: Adjust 'upgrade-shepherd-services' to shepherd service change.Ludovic Courtès2021-01-30
| | | | | | | Fixes a regression introduced in 95f72dcd7aece05e9252c93bef5a831f96cb5393. * guix/scripts/system/reconfigure.scm (upgrade-shepherd-services)[target-services]: Add call to 'shepherd-configuration-services'.