summaryrefslogtreecommitdiff
path: root/guix/build/download.scm
Commit message (Collapse)AuthorAge
* download, git: Refer to the right module in 'module-use!' call.Ludovic Courtès2020-01-07
| | | | | | | | | This fixes a regression introduced in 6a7c4636d4dec47eefa03c95da5a1315bd0e0413. * guix/build/download.scm (load-gnutls): Call 'resolve-module' instead of 'current-module'. * guix/git.scm (load-git-submodules): Likewise.
* Adjust module autoloads.Ludovic Courtès2020-01-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Guile < 2.9.7, autoloading a module would give you access to all its bindings. In future versions, autoloading a module gives access only to the listed bindings, as per #:select (see <https://bugs.gnu.org/38895>). This commit adjusts autoloads to the new semantics, allowing Guix to be built with Guile 2.9.7/2.9.8. * guix/build/download.scm <top level>: Remove call to 'module-autoload!'. (load-gnutls): New procedure. (tls-wrap): Call it. * guix/git.scm <top level>: Remove call to 'module-autoload!'. (load-git-submodules): New procedure. (update-submodules): Call it instead of 'resolve-interface'. * gnu/bootloader/grub.scm: Replace #:autoload with #:use-module. * gnu/packages.scm: Likewise. * gnu/packages/ssh.scm: Likewise. * gnu/packages/tex.scm: Likewise. * gnu/services/cuirass.scm: Likewise. * gnu/services/mcron.scm: Likewise. * guix/lint.scm: Augment list of bindings in #:autoload. * guix/scripts/build.scm: Likewise. * guix/scripts/gc.scm: Likewise. * guix/scripts/pack.scm: Likewise. * guix/scripts/publish.scm: Likewise. * guix/scripts/pull.scm: Likewise. * guix/utils.scm: Remove unnecessary #:autoload clauses; replace one of them with #:use-module.
* download: Do not leak file descriptors on TLS ports.Ludovic Courtès2020-01-03
| | | | | | | | | | | | | | | Fixes <https://bugs.gnu.org/20145>. * guix/build/download.scm (%tls-ports, register-tls-record-port): Remove. (tls-wrap): Remove call to 'register-tls-record-port'. Return a custom binary input/output port instead. This is a backport of what Guile 2.2's (web client) module has been doing. (close-connection): Define as an alias for 'close-port'. * guix/http-client.scm (http-fetch): Remove #:keep-alive? parameter, which was ignored and unused. Pass #:keep-alive? #f to 'http-get'. * guix/lint.scm (probe-uri): Use 'close-port' instead of 'close-connection'. * guix/scripts/substitute.scm (http-multiple-get): Likewise.
* download: Enable TLS 1.3.Marius Bakke2019-12-26
| | | | | | This reverts commit e4ee84202633636b4c8cef4a332f0c74912a3b23. * guix/build/download.scm (tls-wrap): Dot not disable TLS 1.3.
* download: Load *.crt certificate bundles when *.pem files are missing.Ludovic Courtès2019-11-18
| | | | | | | Fixes <https://bugs.gnu.org/38254>. * guix/build/download.scm (make-credendials-with-ca-trust-files): Look for *.crt files under DIRECTORY when *.pem files cannot be found.
* download: Honor /etc/ssl/certs when 'SSL_CERT_DIR' is not set.Ludovic Courtès2019-10-21
| | | | | | | * guix/build/download.scm (%x509-certificate-directory): Use "/etc/ssl/certs" as a last resort. This ensures, for instance, that 'guix download' honors system-wide certificates when SSL_CERT_DIR is unset.
* download: Support 'https_proxy'.宋文武2019-05-13
| | | | | * guix/build/download.scm (setup-http-tunnel): New procedure. (open-connection-for-uri): Honor the 'https_proxy' environment variable.
* download: Ask not to use TLS 1.3.Ludovic Courtès2019-01-26
| | | | | | | | Works around <https://bugs.gnu.org/34102>. Reported by Marius Bakke <mbakke@fastmail.com>. * guix/build/download.scm (tls-wrap): Add "-VERS-TLS1.3" to the priority string when (gnutls-version) is not prefixed by "3.5".
* 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.
* download: Remove Guile 2.0 workaround.Ludovic Courtès2019-01-09
| | | | * guix/build/download.scm: Remove Guile 2.0 workaround.
* 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'.
* perform-download: Optionally report a "download-progress" trace.Ludovic Courtès2018-09-27
| | | | | | | | | | | | * guix/scripts/perform-download.scm (perform-download): Add #:print-build-trace? and pass it to 'url-fetch'. (guix-perform-download): Define 'print-build-trace?' and pass it to 'perform-download'. * guix/build/download.scm (ftp-fetch): Add #:print-build-trace? and honor it. (url-fetch): Likewise. * nix/libstore/builtins.cc (builtinDownload): Set _NIX_OPTIONS environment variable.
* build: Require Guile >= 2.0.13.Ludovic Courtès2018-02-26
| | | | | | | | | | | | | | | | | | * README, configure.ac, doc/guix.texi (Requirements): Increase minimum Guile version from 2.0.9 to 2.0.13. * config-daemon.ac: Remove use of 'GUIX_CHECK_UNBUFFERED_CBIP'. * m4/guix.m4 (GUIX_CHECK_UNBUFFERED_CBIP): Remove. * guix/build/download.scm (current-http-proxy): Remove. * guix/build/syscalls.scm (%libc-errno-pointer, errno): Remove. (syscall->procedure): Use #:return-errno unconditionally. * guix/hash.scm (open-sha256-input-port)[unbuffered]: Remove outdated comment. * guix/http-client.scm (when-guile<=2.0.5-or-otherwise-broken): Remove. <top level>: Remove 'when-guile<=2.0.5-or-otherwise-broken' block. * guix/scripts/substitute.scm (fetch): Remove 'guile-version>?' conditional. * tests/hash.scm (supports-unbuffered-cbip?): Remove. <top level>: Remove 'test-skip' call.
* download: Fix return value of the url-fetch procedure.Maxim Cournoyer2018-01-28
| | | | | | | | | Fixes <https://bugs.gnu.org/30270>. Regression was introduced by commit 347fa4aebf. * guix/build/download.scm (url-fetch): Return `file' instead of #t upon success. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* utils: Fix cond-expand for Guile 2.0.Eric Bavier2017-12-10
| | | | * guix/build/download.scm (tls-wrap): Use 'guile-2.2' feature instead.
* download: Improve efficiency of 'write-request' over TLS.Ludovic Courtès2017-11-16
| | | | | | | | This is another instance of <https://bugs.gnu.org/22966>. The Microsoft-IIS/7.5 server at static.nvd.nist.gov would sometimes hang when receiving our requests byte by byte. * guix/build/download.scm (tls-wrap) [!guile-2.0]: Add 'setvbuf' call.
* download: Pass the timeout to 'ftp-retr'.Ludovic Courtès2017-11-14
| | | | | | | | | | This ensures the timeout applies when connecting to the port returned by PASV. * guix/ftp-client.scm (ftp-list): Add #:timeout parameter. Use 'connect*' instead of 'connect' and pass TIMEOUT. (ftp-retr): Likewise. * guix/build/download.scm (ftp-fetch): Pass TIMEOUT to 'ftp-retr'.
* download: Work around more bogus HTTP handling in Guile 2.2 <= 2.2.2.Ludovic Courtès2017-11-11
| | | | | | | | Reported by Mark H Weaver <mhw@netris.org> at <https://lists.gnu.org/archive/html/guix-devel/2017-11/msg00190.html>. * guix/build/download.scm (guile-2.2) [write-request-line]: Backport Guile commit 6ad28ae3bc6a6d9e95ab7d70510d12c97673a143.
* download: Work around bogus HTTP handling in Guile 2.2 <= 2.2.2.Ludovic Courtès2017-11-10
| | | | | | | | Reported by Konrad Hinsen <konrad.hinsen@fastmail.net> at <https://lists.gnu.org/archive/html/guix-devel/2017-11/msg00070.html>. * guix/build/download.scm (write-request-line) [guile-2.2]: New procedure.
* 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.
* download: Make 'http-fetch' public.Ludovic Courtès2017-10-19
| | | | | | * guix/build/download.scm (http-fetch): Remove 'file' parameter. Change to return an input port and the content-length. Make public. (url-fetch): Adjust accordingly.
* download: Remove old-Guile leftovers.Ludovic Courtès2017-10-19
| | | | | | | This is a followup to 36626c556ed75219bce196ac93d148f6b9af984c. * guix/build/download.scm (http-fetch): Rename 'port-or-bv' to 'port'. Assume (port? port) is always true, and remove other branch.
* download: Don't report the progress too fast.宋文武2017-09-20
| | | | | | | | | | | | * guix/utils.scm (<progress-reporter>): New record type. (call-with-progress-reporter): New procedure. * guix/build/download.scm (dump-port*, rate-limited, progress-reporter/file): New procedures. (ftp-fetch, http-fetch): Use 'dump-port*'. (progress-proc): Remove procedure. * guix/scripts/substitute.scm (progress-report-port): Rewrite in terms of <progress-reporter>. (process-substitution): Adjust accordingly.
* Handle the same HTTP redirects everywhere.Tobias Geerinckx-Rice2017-09-05
| | | | | | | * guix/build/download.scm (http-fetch): Complete the hard-coded list of HTTP redirection status codes. * guix/http-client.scm (http-fetch): Likewise. * guix/scripts/lint.scm (probe-uri): Likewise.
* download: Work around GnuTLS bug with UTF-8 certificate file names.Ludovic Courtès2017-05-30
| | | | | | | | | | Reported by Mark H Weaver <mhw@netris.org> at <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=26948#17>. * guix/build/download.scm (set-certificate-credentials-x509-trust-file!*): New procedure. (make-credendials-with-ca-trust-files): Use it instead of 'set-certificate-credentials-x509-trust-file!'.
* download: Continue handshake upon TLS warning alerts.Ludovic Courtès2017-05-02
| | | | | | | | | | This allows us to download from site such as <https://fusionforge.int-evry.fr> where the server does not recognize the server name passed via the 'server_name' extension. * guix/build/download.scm (tls-wrap): Catch 'gnutls-error' around 'handshake'. Upon ERROR/WARNING-ALERT-RECEIVED, print a message and call 'handshake'.
* cache: Work around 'time-monotonic' bug in Guile 2.2.2.Ludovic Courtès2017-04-22
| | | | | | | * guix/cache.scm (time-monotonic) [guile-2.2]: New variable. * tests/cache.scm (time-monotonic) [guile-2.2]: Likewise. * guix/build/download.scm (time-monotonic) [guile-2.2]: Adjust comment: it's a 2.2.2 bug.
* download: Work around Guile 2.2 bug with 'time-monotonic' objects.Ludovic Courtès2017-04-22
| | | | * guix/build/download.scm (time-monotonic) [guile-2.2]: New variable.
* download: Properly parse ftp:// URLs that lack user info.Ludovic Courtès2017-03-28
| | | | | | | | | | | Fixes a regression introduced in a4f542341511f33ece18d16b68118214da8143ec. Reported by Hartmut Goebel. * guix/build/download.scm (ftp-fetch): Account for the case where 'uri-userinfo' returns #f. Remove the case where it returns "" since that cannot happen.
* download: Handle username and password properties for FTP URIs.Roel Janssen2017-03-21
| | | | * guix/build/download.scm (ftp-fetch): Process username and password from a URI.
* http-client: Avoid name clash with 'open-connection-for-uri' in 2.2.0.Ludovic Courtès2017-03-18
| | | | | | | | | * guix/build/download.scm (open-connection-for-uri): Add note about same-named binding in Guile 2.2.0. * guix/http-client.scm: Use 'guix:open-connection-for-uri' for the procedure coming from (guix build download). * guix/scripts/lint.scm: Likewise. * guix/scripts/substitute.scm: Likewise.
* build: Require Guile >= 2.0.9.Ludovic Courtès2017-03-18
| | | | | | | | | | | | | | | | * configure.ac: Bump requirement to 2.0.9. * doc/guix.texi (Requirements): Adjust accordingly. * README (Requirements): Likewise. * build-aux/download.scm: Remove workaround for <http://bugs.gnu.org/13095>. * guix/build/download.scm: Likewise. (http-fetch)[post-2.0.7?]: Remove. Remove conditional code for not POST-2.0.7?. * guix/http-client.scm: Remove workaround for <http://bugs.gnu.org/13095>. (http-fetch)[post-2.0.7?]: Remove. Remove conditional code for not POST-2.0.7?. * guix/serialization.scm (read-latin1-string): Remove mention of 2.0.9. * tests/nar.scm: Use (ice-9 control). (let/ec): Remove.
* download: Export '%x509-certificate-directory'.Ludovic Courtès2017-03-13
| | | | | | * guix/build/download.scm (%x509-certificate-directory): Export, as expected by (guix scripts pull) since commit 7e81d699de7a2c924a048175516fe1ac3820d8e6.
* download: Protect against dangling symlinks in $SSL_CERT_DIR.Ludovic Courtès2016-12-16
| | | | | | | | | Reported by Christopher Baines <mail@cbaines.net> in <https://bugs.gnu.org/25213>. * guix/build/download.scm (make-credendials-with-ca-trust-files): Check whether FILE exists before calling 'set-certificate-credentials-x509-trust-file!'.
* download: Verify TLS certificates unless asked not to.Ludovic Courtès2016-11-07
| | | | | | | | | | | | | | | | | | | Fixes <http://bugs.gnu.org/24466>. Reported by Leo Famulari <leo@famulari.name>. * guix/build/download.scm (%x509-certificate-directory): New variable. (make-credendials-with-ca-trust-files, peer-certificate) (assert-valid-server-certificate, print-tls-certificate-error): New procedures. Add 'print-tls-certificate-error' as an exception printer for 'tls-certificate-error'. (tls-wrap): Add #:verify-certificate? parameter and honor it. (open-connection-for-uri): Likewise. (http-fetch): Likewise. (url-fetch): Likewise. * guix/download.scm (url-fetch)[builder]: Pass #:verify-certificate? #f. * guix/scripts/lint.scm (probe-uri): Add case for 'tls-certificate-error'. (validate-uri): Likewise. * doc/guix.texi (Invoking guix download): Mention 'SSL_CERT_DIR'.
* download: Pass the raw file name to content-addressed mirrors.Ludovic Courtès2016-07-31
| | | | | * guix/build/download.scm (url-fetch)[content-addressed-uris]: Call 'strip-store-file-name' on FILE before passing it to 'make-url'.
* download: Prepare to support the 'guix publish' /file URLs.Ludovic Courtès2016-07-20
| | | | | | | * guix/download.scm (%content-addressed-mirrors): Add 'file' parameter to the lambda. * guix/build/download.scm (url-fetch)[content-addressed-uris]: Adjust accordingly.
* download: Use basic authentication when userinfo is present in URI.David Thompson2016-06-29
| | | | | | | * guix/download.scm (url-fetch): Include (guix base64) module on the build-side. * guix/build/download.scm (http-fetch): Add "Authorization" header when userinfo is present in the URI.
* download: Default to a 10s connection establishment timeout.Ludovic Courtès2016-05-27
| | | | | | | | * guix/build/download.scm (ftp-fetch): Add #:timeout and pass it to 'ftp-open'. (http-fetch): Add #:timeout and pass it to 'open-connection-for-uri' and in recursive calls. (url-fetch): Add #:timeout and pass it to 'http-fetch' and 'ftp-fetch'.
* download: Use URI objects for content-addressed mirrors.Ludovic Courtès2016-05-27
| | | | | | | | This fixes a bug whereby 'http-fetch' would be passed a string instead of a URI object. * guix/build/download.scm (url-fetch): Rename 'content-addressed-urls' to 'content-addressed-uris', and call 'string->uri'.
* build: Accept dates with space-padded hour field.Ricardo Wurmus2016-05-16
| | | | | * guix/build/download.scm: Replace "parse-rfc-822-date" from the (web http) module.
* download: Support content-addressed mirrors.Ludovic Courtès2016-05-14
| | | | | | | | | | | | | * guix/download.scm (%content-addressed-mirrors) (%content-addressed-mirror-file): New variables. * guix/download.scm (url-fetch)[builder]: Define 'value-from-environment. Pass #:hashes and #:content-addressed-mirrors to 'url-fetch'. Define "guix download hashes" environment variable. * guix/build/download.scm (url-fetch): Add #:content-addressed-mirrors and #:hashes. [content-addressed-urls]: New variable. Use it.
* substitute: Better abbreviate substitute URL in progress report.Ludovic Courtès2016-04-20
| | | | | | | | Suggested by Danny Milosavljevic <dannym@scratchpost.org>. * guix/build/download.scm (nar-uri-abbreviation): New procedure. * guix/scripts/substitute.scm (process-substitution): Use it instead of 'store-path-abbreviation'.
* download: 'uri-abbreviation' can abbreviate the URI's basename.Ludovic Courtès2016-04-20
| | | | | * guix/build/download.scm (uri-abbreviation): Use 'ellipsis' instead of "...". Abbreviate the basename of PATH if needed.
* download: Add "%COMPAT" to the priority string.Ludovic Courtès2016-04-20
| | | | | | Fixes <http://bugs.gnu.org/23311>. * guix/build/download.scm (tls-wrap): Add 'set-session-priorities!' call.
* download: Add 'current-terminal-columns' parameter.Ludovic Courtès2016-04-15
| | | | | * guix/build/download.scm (current-terminal-columns): New variable. (progress-proc): Use it instead of the hard-coded "80".
* download: Send an ANSI erase-in-line sequence in addition to CR.Ludovic Courtès2016-04-15
| | | | | | | | Partly fixes <http://bugs.gnu.org/22536>. Reported by Danny Milosavljevic <dannym@scratchpost.org>. * guix/build/download.scm (progress-proc): Send an ANSI erase-in-line sequence.
* download: Follow HTTP 307 "Temporary Redirection".Alex Kost2016-04-14
| | | | | | | | Fixes <http://bugs.gnu.org/23275>. Reported by Albin Söderqvist <albin@fripost.org>. * guix/build/download.scm (http-fetch): Follow redirections upon 307. This is what 'binaries.openttd.org' does.
* download: Add 'close-connection'.Ludovic Courtès2016-03-17
| | | | | | | | | | Partially fixes <http://bugs.gnu.org/20145>. * guix/build/download.scm (add-weak-reference): Remove. (%tls-ports): New variable. (register-tls-record-port): New procedure. (tls-wrap): Use it instead of 'add-weak-reference'. (close-connection): New procedure.
* download: Always use AI_ADDRCONFIG when resolving host names.Ludovic Courtès2015-11-12
| | | | | | | * guix/build/download.scm (open-socket-for-uri): Always pass AI_ADDRCONFIG to 'getaddrinfo' as recommended in the fine Guile manual. * guix/ftp-client.scm (ftp-open): Ditto.