aboutsummaryrefslogtreecommitdiff
path: root/src/libfetchers
AgeCommit message (Collapse)Author
2024-03-07Merge pull request #9324 from 9999years/fix-8854-take-2eldritch horrors
Don't attempt to `git add` ignored files (cherry picked from commit 359990dfdc713c80aabd7ea6f7e4528628fbe108) === also added a regression test that isn't upstream to be sure we're actually fixing the bug. Change-Id: I8267a3d0ece9909d8008b7435b90e7b3eee366f6
2024-03-05Merge pull request #9634 from 9999years/combine-abstract-pos-and-poseldritch horrors
Combine `AbstractPos`, `PosAdapter`, and `Pos` (cherry picked from commit 113499d16fc87d53b73fb62fe6242154909756ed) === this is a bit cursed because originally it was based on InputAccessor code that we don't have and moved/patched features we likewise don't have (fetchToStore caching, all the individual accessors, ContentAddressMethod). the commit is adjusted accordingly to match (remove caching, ignore accessors, use FileIngestionMethod). note that `state.rootPath . CanonPath == abs` and computeStorePathForPath works relative to cwd, so the slight rewrite in the moved fetchToStore is legal. Change-Id: I05fd340c273f0bcc8ffabfebdc4a88b98083bce5
2024-03-04Merge pull request #9445 from NixOS/allow-input-in-git-commiteldritch horrors
Allow user input in `git commit` (cherry picked from commit 43fb39ca29a0b054a4c18623520c496d27c57192) Change-Id: I13bd4c007234ee2133289c68ef8ab2eae4def78a
2023-08-22Tarball trees: Propagate lastModifiedEelco Dolstra
This makes them behave consistently with GitHub/GitLab flakes.
2023-08-01Don't require .tar/.zip extension for tarball flakerefsEelco Dolstra
Special-casing the file name is rather ugly, so we shouldn't do that. So now any {file,http,https} URL is handled by TarballInputScheme, except for non-flake inputs (i.e. inputs that have the attribute `flake = false`).
2023-07-07Simplify `ContentAddress`John Ericson
Whereas `ContentAddressWithReferences` is a sum type complex because different varieties support different notions of reference, and `ContentAddressMethod` is a nested enum to support that, `ContentAddress` can be a simple pair of a method and hash. `ContentAddress` does not need to be a sum type on the outside because the choice of method doesn't effect what type of hashes we can use. Co-Authored-By: Cale Gibbard <cgibbard@gmail.com>
2023-06-24Merge pull request #5385 from Enzime/add/dirty-revThéophane Hufschmitt
Add `dirtyRev` and `dirtyShortRev` to `fetchGit`
2023-06-24Add `dirtyRev` and `dirtyShortRev` to `fetchGit`Michael Hoang
Fixes #4682
2023-06-13Allow tarball URLs to redirect to a lockable immutable URLEelco Dolstra
Previously, for tarball flakes, we recorded the original URL of the tarball flake, rather than the URL to which it ultimately redirects. Thus, a flake URL like http://example.org/patchelf-latest.tar that redirects to http://example.org/patchelf-<revision>.tar was not really usable. We couldn't record the redirected URL, because sites like GitHub redirect to CDN URLs that we can't rely on to be stable. So now we use the redirected URL only if the server returns the `x-nix-is-immutable` or `x-amz-meta-nix-is-immutable` headers in its response.
2023-06-13Add a generic check for rev attribute mismatchesEelco Dolstra
2023-06-06Fix SourcePath::resolveSymlinks()Eelco Dolstra
This fixes handling of symlinks that start with '..', and symlink targets that contain symlinks themselves.
2023-05-18Remove unusedKonstantin Vukolov
2023-05-18Add option isInteractiveKonstantin Vukolov
2023-05-17Ask for git credentials in fetcherKonstantin Vukolov
2023-05-03Fix hostRegex to accept hosts with a `-`figsoda
2023-04-24Add some more SourcePath docsEelco Dolstra
2023-04-24Document tMiscEelco Dolstra
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2023-04-24Merge remote-tracking branch 'origin/master' into source-pathEelco Dolstra
2023-04-17Merge remote-tracking branch 'upstream/master' into source-pathRobert Hensing
2023-04-07Merge remote-tracking branch 'upstream/master' into path-infoJohn Ericson
2023-04-07Finish converting existing comments for internal API docs (#8146)John Ericson
* Finish converting existing comments for internal API docs 99% of this was just reformatting existing comments. Only two exceptions: - Expanded upon `BuildResult::status` compat note - Split up file-level `symbol-table.hh` doc comments to get per-definition docs Also fixed a few whitespace goofs, turning leading tabs to spaces and removing trailing spaces. Picking up from #8133 * Fix two things from comments * Use triple-backtick not indent for `dumpPath` * Convert GNU-style `\`..'` quotes to markdown style in API docs This will render correctly.
2023-04-06Backport SourcePath from the lazy-trees branchEelco Dolstra
This introduces the SourcePath type from lazy-trees as an abstraction for accessing files from inputs that may not be materialized in the real filesystem (e.g. Git repositories). Currently, however, it's just a wrapper around CanonPath, so it shouldn't change any behaviour. (On lazy-trees, SourcePath is a <InputAccessor, CanonPath> tuple.)
2023-03-31Ensure all headers have `#pragma once` and are in API docsJohn Ericson
`///@file` makes them show up in the internal API dos. A tiny few were missing `#pragma once`.
2023-03-30Merge remote-tracking branch 'upstream/master' into path-infoJohn Ericson
Also improve content-address.hh API docs.
2023-03-20Mark experimental features on settingsJohn Ericson
We hide them in various ways if the experimental feature isn't enabled. To do this, we had to move the experimental features list out of libnixstore, because the setting machinary itself depends on it. To do that, we made a new `ExperimentalFeatureSettings`.
2023-03-15respect allRefs=1 when using `nix flake prefetch`figsoda
2023-03-01Merge pull request #7854 from aameen-tulip/patch-1Valentin Gagarin
2023-02-28No inheritance for `TextInfo` and `FixedOutputInfo`John Ericson
2023-02-28Revert "Remove some designated initializers"John Ericson
This reverts commit ee9eb83a842eb97d0180fd9d349d30ff27fdb485.
2023-02-28Merge remote-tracking branch 'upstream/master' into path-infoJohn Ericson
2023-02-24Example uses gitlab.com thus clarify the commentAnatol Pomozov
2023-02-16Document `hasAllInfo`aameen-tulip
If this documentation is inaccurate in any way please do not hesitate to suggest corrections. My understanding of this function is strictly from reading the source code and some limited experience implementing fetchers.
2023-02-09Improve commentEelco Dolstra
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2023-02-09Fix activity messageEelco Dolstra
Co-authored-by: Josef Kemetmüller <josef.kemetmueller@gmail.com>
2023-02-07Fix activity messageEelco Dolstra
2023-02-07Speed up fetching submodulesEelco Dolstra
Previously we would completely refetch the submodules from the network, even though the repo might already have them. Now we copy the .git/modules directory from the repo as an optimisation. This speeds up evaluating builtins.fetchTree { type = "git"; url = "/path/to/blender"; submodules = true; } (where /path/to/blender already has the needed submodules) from 121s to 57s. This is still pretty inefficient and a hack, but a better solution is best done on the lazy-trees branch. This change also help in the case where the repo already has the submodules but the origin is unfetchable for whatever reason (e.g. there have been cases where Nix in a GitHub action doesn't have the right authentication set up).
2023-02-07Fix the origin URL used for fetching submodulesEelco Dolstra
We cannot use 'actualUrl', because for file:// repos that's not the original URL that the repo was fetched from. This is a problem since submodules may be relative to the original URL. Fixes e.g. nix eval --impure --json --expr 'builtins.fetchTree { type = "git"; url = "/path/to/blender"; submodules = true; }' where /path/to/blender is a clone of https://github.com/blender/blender.git (which has several relative submodules like '../blender-addons.git').
2023-02-07Add some progress indication when fetching submodulesEelco Dolstra
2023-02-01Remove some designated initializersJohn Ericson
With the switch to C++20, the rules became more strict, and we can no longer initialize base classes. Make them comments instead. (BTW https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2287r1.html this offers some new syntax for this use-case. Hopefully this will be adopted and we can eventually use it.)
2023-01-23Don't add `StorePathDescriptor` for nowJohn Ericson
We don't need it yet, we can add it back later.
2023-01-06Use named field initialization for referencesJohn Ericson
2023-01-06Merge remote-tracking branch 'upstream/master' into path-infoJohn Ericson
2022-12-12Allow to disable global flake-registry with ""Benoit de Chezelles
2022-12-07Trivial changes from the lazy-trees branchEelco Dolstra
2022-10-31Merge pull request #7039 from Mic92/libfetchers-variantThéophane Hufschmitt
libfetchers: avoid api.github.com ratelimit if no github token is set
2022-10-14Fix #7146Andrew Brooks
When fetching a non-local git repo by ref (and no rev), don't consider unrelated cached revs for the same repository.
2022-10-01libfetchers: avoid api.github.com ratelimit if no github token is setJörg Thalheim
If we don't have any github token, we won't be able to fetch private repos, but we are also more likely to run into API limits since we don't have a token. To mitigate this only ever use the github api if we actually have a token.
2022-08-17Don't pass --force to 'git add'Eelco Dolstra
Fixes #5810.
2022-06-26fetchGit: document `shallow` argumentGuillaume Girol
2022-06-23Fetch flake-registry.json from channels.nixos.orgEelco Dolstra
Using fastly is slightly faster, provides some resilience due to a high stale TTL, and allows some usage metrics.