about summary refs log tree commit diff
path: root/src/libstore/download.cc
AgeCommit message (Collapse)AuthorFilesLines
2018-01-31 Fix building without aws-sdk-cppEelco Dolstra1-4/+5
2018-01-31 Merge branch 'http-binary-cache-put-upsert' of https://github.com/adelbertc/nixEelco Dolstra1-1/+27
2018-01-31 Indent properlyEelco Dolstra1-3/+3
2018-01-26 HttpBinaryCacheStore: Support upsertFile with PUT.Shea Levy1-1/+27
Some servers, such as Artifactory, allow uploading with PUT and BASIC auth. This allows nix copy to work to upload binaries to those servers. Worked on together with @adelbertc
2018-01-19 Don't retry CURLE_URL_MALFORMATEelco Dolstra1-0/+1
2017-12-09 Fix for builds with system libcurl < 7.30Benjamin Hipple1-1/+3
CentOS 7.4 and RHEL 7.4 ship with libcurl-devel-7.29.0-42.el7.x86_64; this flag was added in 7.30.0 https://curl.haxx.se/libcurl/c/CURLMOPT_MAX_TOTAL_CONNECTIONS.html
2017-11-15 Add a "profile" option to S3BinaryCacheStoreEelco Dolstra1-1/+1
This allows specifying the AWS configuration profile to use. E.g. nix copy --from s3://my-cache?profile=aws-dev-account /nix/store/cf3isrlqavvd5w7rpky1fa8j9lcnlggm-...
2017-11-01 Add fetchMercurial primopEelco Dolstra1-1/+1
E.g. $ nix eval '(fetchMercurial https://www.mercurial-scm.org/repo/hello)' { branch = "default"; outPath = "/nix/store/alvb9y1kfz42bjishqmyy3pphnrh1pfa-source"; rev = "82e55d328c8ca4ee16520036c0aaace03a5beb65"; revCount = 1; shortRev = "82e55d328c8c"; } $ nix eval '(fetchMercurial { url = https://www.mercurial-scm.org/repo/hello; rev = "0a04b987be5ae354b710cefeba0e2d9de7ad41a9"; })' { branch = "default"; outPath = "/nix/store/alvb9y1kfz42bjishqmyy3pphnrh1pfa-source"; rev = "0a04b987be5ae354b710cefeba0e2d9de7ad41a9"; revCount = 0; shortRev = "0a04b987be5a"; } $ nix eval '(fetchMercurial /tmp/unclean-hg-tree)' { branch = "default"; outPath = "/nix/store/cm750cdw1x8wfpm3jq7mz09r30l9r024-source"; rev = "0000000000000000000000000000000000000000"; revCount = 0; shortRev = "000000000000"; }
2017-10-30 fetchurl/fetchTarball: Respect name changesEelco Dolstra1-1/+3
The computation of urlHash didn't take the name into account, so subsequent fetchurl calls with the same URL but a different name would resolve to the same cached store path.
2017-10-02 Reverse retry logic to retry in all but a few casesDan Peebles1-20/+37
It was getting too much like whac-a-mole listing all the retriable error conditions, so we now retry by default and list the cases where retrying is almost certainly hopeless.
2017-09-18 Don't remove Content-Encoding in fetchurl / nix-prefetch-urlEelco Dolstra1-1/+2
Fixes #1568.
2017-09-01 Abort curl downloads if there is no progress for 5 minutesEelco Dolstra1-1/+6
Maybe this will fix the curl hangs on macOS. (We could also use CURLOPT_TIMEOUT but that seems more of a sledgehammer.)
2017-08-31 Add an activity for binary cache queriesEelco Dolstra1-1/+1
2017-08-28 Give activities a verbosity level againEelco Dolstra1-1/+1
And print them (separately from the progress bar) given sufficient -v flags.
2017-08-25 Allow activities to be nestedEelco Dolstra1-1/+1
In particular, this allows more relevant activities ("substituting X") to supersede inferior ones ("downloading X").
2017-08-16 Progress indicator: CleanupEelco Dolstra1-1/+1
2017-08-16 Improve substitution progress indicatorEelco Dolstra1-6/+5
E.g. $ nix build --store local?root=/tmp/nix nixpkgs.firefox-unwrapped [0/1 built, 1/97/98 fetched, 65.8/92.8 MiB DL, 203.2/309.2 MiB copied] downloading 'https://cache.nixos.org/nar/1czm9fk0svacy4h6a3fzkpafi4f7a9gml36kk8cq1igaghbspg3k.nar.xz'
2017-07-30 Replace Unicode quotes in user-facing strings by ASCIIJörg Thalheim1-15/+15
Relevant RFC: NixOS/rfcs#4 $ ag -l | xargs sed -i -e "/\"/s/’/'/g;/\"/s/‘/'/g"
2017-07-11 fetchTarball: Prevent concurrent downloads of the same fileEelco Dolstra1-0/+4
Fixes #849.
2017-07-04 Support base-64 hashesEelco Dolstra1-1/+1
Also simplify the Hash API. Fixes #1437.
2017-07-03 Replace a few bool flags with enumsEelco Dolstra1-2/+2
Functions like copyClosure() had 3 bool arguments, which creates a severe risk of mixing up arguments. Also, implement copyClosure() using copyPaths().
2017-06-12 Provide a builtin default for $NIX_SSL_CERT_FILEEelco Dolstra1-3/+4
This is mostly to ensure that when Nix is started on macOS via a launchd service or sshd (for a remote build), it gets a certificate bundle.
2017-05-16 Improve progress indicatorEelco Dolstra1-32/+6
2017-05-11 Add an option for extending the user agent headerEelco Dolstra1-1/+3
This is useful e.g. for distinguishing traffic to a binary cache (e.g. certain machines can use a different tag in the user agent).
2017-05-11 Tweak error messageEelco Dolstra1-1/+1
2017-05-11 LocalStore::addToStore(): Check info.narSizeEelco Dolstra1-0/+1
It allowed the client to specify bogus narSize values. In particular, Downloader::downloadCached wasn't setting narSize at all.
2017-04-19 Reimplement connect-timeoutEelco Dolstra1-0/+2
Fixes #1339.
2017-04-14 Shut up some warningsEelco Dolstra1-1/+1
2017-04-13 Convert Settings to the new config systemEelco Dolstra1-1/+1
This makes all config options self-documenting. Unknown or unparseable config settings and --option flags now cause a warning.
2017-04-13 Merge branch 'rework-options' of https://github.com/copumpkin/nixEelco Dolstra1-3/+3
2017-04-10 Add CURLE_WRITE_ERROR as a transient error conditionDan Peebles1-0/+5
We've observed it failing downloads in the wild and retrying the same URL a few moments later seemed to fix it.
2017-04-06 Retry downloads on transient SSL errors tooDan Peebles1-0/+2
2017-03-31 Retry curl error 16Eelco Dolstra1-0/+1
2017-03-15 runProgram(): Distinguish between empty input and no inputEelco Dolstra1-1/+1
For example, if we call brotli with an empty input, it shouldn't read from the caller's stdin.
2017-03-15 S3BinaryCacheStore: Support compression of narinfo and log filesEelco Dolstra1-5/+11
You can now set the store parameter "text-compression=br" to compress textual files in the binary cache (i.e. narinfo and logs) using Brotli. This sets the Content-Encoding header; the extension of compressed files is unchanged. You can separately specify the compression of log files using "log-compression=br". This is useful when you don't want to compress narinfo files for backward compatibility.
2017-03-15 Add support for brotli compressionEelco Dolstra1-2/+19
Build logs on cache.nixos.org are compressed using Brotli (since this allows them to be decompressed automatically by Chrome and Firefox), so it's handy if "nix log" can decompress them.
2017-03-12 Merge branch 'configurable-aws-region'Shea Levy1-1/+4
2017-03-06 Properly set the caFile for aws-sdk-cpp s3Shea Levy1-2/+1
2017-03-03 Add aws-region param to S3 store URLsShea Levy1-1/+4
2017-02-28 Fix building against older curl versionsEelco Dolstra1-1/+4
http://hydra.nixos.org/build/49490928
2017-02-27 Retry downloads on HTTP/2 stream errorsEelco Dolstra1-1/+3
Issue #1254.
2017-02-22 Explicitly model all settings and fail on unrecognized onesDan Peebles1-3/+3
Previously, the Settings class allowed other code to query for string properties, which led to a proliferation of code all over the place making up new options without any sort of central registry of valid options. This commit pulls all those options back into the central Settings class and removes the public get() methods, to discourage future abuses like that. Furthermore, because we know the full set of options ahead of time, we now fail loudly if someone enters an unrecognized option, thus preventing subtle typos. With some template fun, we could probably also dump the full set of options (with documentation, defaults, etc.) to the command line, but I'm not doing that yet here.
2017-02-22 RemoteStore::addToStore(): Pass content-addressability assertionEelco Dolstra1-0/+1
... and use this in Downloader::downloadCached(). This fixes $ nix-build https://nixos.org/channels/nixos-16.09-small/nixexprs.tar.xz -A hello error: cannot import path ‘/nix/store/csfbp1s60dkgmk9f8g0zk0mwb7hzgabd-nixexprs.tar.xz’ because it lacks a valid signature
2017-02-21 Handle CURLE_RECV_ERROR as a transient errorEelco Dolstra1-1/+1
This fixes unable to download ‘https://cache.nixos.org/nar/077h8ji74y9b0qx7rjk71xd80vjqp6q5gy137r553jlvdlxdcdlk.nar.xz’: HTTP error 200 (curl error: Failure when receiving data from the peer)
2017-02-21 Fix building without S3 supportEelco Dolstra1-1/+1
http://hydra.nixos.org/build/49031196/nixlog/2/raw
2017-02-16 Move netrcFile to SettingsEelco Dolstra1-5/+2
Also get rid of Settings::processEnvironment(), it appears to be useless.
2017-02-16 Include "curl" in the User-Agent headerEelco Dolstra1-1/+1
Some sites (e.g. BitBucket) give a helpful 401 error when trying to download a private archive if the User-Agent contains "curl", but give a redirect to a login page otherwise (so for instance "nix-prefetch-url" will succeed but produce useless output).
2017-02-16 Merge pull request #1215 from k0001/netrc-1Eelco Dolstra1-0/+8
Add netrc-file support
2017-02-14 Add support for s3:// URIsEelco Dolstra1-1/+27
This adds support for s3:// URIs in all places where Nix allows URIs, e.g. in builtins.fetchurl, builtins.fetchTarball, <nix/fetchurl.nix> and NIX_PATH. It allows fetching resources from private S3 buckets, using credentials obtained from the standard places (i.e. AWS_* environment variables, ~/.aws/credentials and the EC2 metadata server). This may not be super-useful in general, but since we already depend on aws-sdk-cpp, it's a cheap feature to add.
2017-02-09 Documentation.Renzo Carbonara1-0/+3