aboutsummaryrefslogtreecommitdiff
path: root/src/libfetchers
AgeCommit message (Collapse)Author
2021-09-24Explicitly set initial branch name for gitoxalica
2021-09-22Revert "Merge pull request #4922 from nrdxp/default-submodules"Eelco Dolstra
This reverts commit 6678e98411cd3bfe8143a4ba1b35d1451babce32, reversing changes made to 90b2dd570cbd8313a8cf45b3cf66ddef2bb06e07.
2021-09-21Allow relative paths anywhere into the parent's store pathEelco Dolstra
2021-09-21path fetcher: Fix relative path checkEelco Dolstra
2021-09-14Rename unnecessary git@Eelco Dolstra
2021-09-14github fetcher: Don't use HEAD branch when cloningEelco Dolstra
Fixes #4394.
2021-09-14github fetcher: Use git+https for cloningEelco Dolstra
git+ssh only works if you have SSH access.
2021-09-14Fix macOS buildEelco Dolstra
2021-09-13RunOptions: Use designated initializersEelco Dolstra
Also get rid of _killStderr because it wasn't actually checked anywhere.
2021-09-13Remove tabsEelco Dolstra
2021-09-07Merge pull request #4922 from nrdxp/default-submodulesShea Levy
libfetchers/git: fetch submodules by default
2021-08-30Merge pull request #5175 from Pamplemousse/makeEelco Dolstra
Don't overwrite user provided `lib*_LDFLAGS`
2021-08-25Don't overwrite user provided `lib*_LDFLAGS`Pamplemousse
Signed-off-by: Pamplemousse <xav.maso@gmail.com>
2021-08-23Coding styleEelco Dolstra
2021-08-17Fix follows paths in subordinate lockfilesAlex Zero
2021-08-02fix git init race conditionMichael Fellinger
2021-07-24Enable pthreads for new librariesAlyssa Ross
Otherwise the lack of pthread causes linking to fail for NetBSD.
2021-07-08Merge pull request #4988 from NixOS/fetchgit-name-attributeEelco Dolstra
Add a name attribute to the fetchers
2021-07-07Style tweaksEelco Dolstra
2021-07-06allow fetchFromGitHub to take a `name` argumentregnat
2021-07-06allow fetchMercurial to take a `name` argumentregnat
2021-07-06allow fetchTarball to take a `name` argumentregnat
2021-07-06Allow `fetchGit` to take a `name` argumentregnat
Fix #3388
2021-06-30nix registry pin: add a way to pin to a custom lockedAlexander Bantyev
2021-06-17libfetchers/git: fetch submodules by defaultTimothy DeHerrera
2021-06-02fix error: 'optional' in namespace 'std' does not name a template typekeke
2021-05-29Add .tar.zst support for TarballInputSchemeTimothy Klim
2021-04-19Include sys/wait.h everywhere WIFEXITED etc is usedAlyssa Ross
This is required on NetBSD, and I think FreeBSD too.
2021-04-09Revert "libfetchers/tarball: Lock on effectiveUrl"Eelco Dolstra
This reverts commit fc6bfb261d50102016ed812ecf9949d41fe539f7. Fixes #4672.
2021-03-30fetchGit: don't prefix "refs/heads/" on ref = "HEAD"Bjørn Forsman
This fixes builtins.fetchGit { url = ...; ref = "HEAD"; }, that works in stable nix (v2.3.10), but is broken in nix master: $ ./result/bin/nix repl Welcome to Nix version 2.4pre19700101_dd77f71. Type :? for help. nix-repl> builtins.fetchGit { url = "https://github.com/NixOS/nix"; ref = "HEAD"; } fetching Git repository 'https://github.com/NixOS/nix'fatal: couldn't find remote ref refs/heads/HEAD error: program 'git' failed with exit code 128 The documentation for builtins.fetchGit says ref = "HEAD" is the default, so it should also be supported to explicitly pass it. I came across this issue because poetry2nix can use ref = "HEAD" in some situations. Fixes #4674.
2021-03-19Use the appropriate config dir for the registrySamuel Dionne-Riel
2021-03-11Merge pull request #4566 from orbekk/masterEelco Dolstra
Add support for bare git repositories when using git+file
2021-03-02libfetchers/tarball: Lock on effectiveUrldramforever
Basically, if a tarball URL is used as a flake input, and the URL leads to a redirect, the final redirect destination would be recorded as the locked URL. This allows tarballs under https://nixos.org/channels to be used as flake inputs. If we, as before, lock on to the original URL it would break every time the channel updates.
2021-03-01Add support for bare git repositories with git+fileKjetil Orbekk
Local git repositories are normally used directly instead of cloning. This commit checks if a repo is bare and forces a clone. Co-authored-by: Théophane Hufschmitt <regnat@users.noreply.github.com>
2021-01-27Add traces to errors while updating flake lock fileEelco Dolstra
Example: $ nix build --show-trace error: unable to download 'https://api.github.com/repos/NixOS/nixpkgs/commits/no-such-branch': HTTP error 422 ('') response body: { "message": "No commit found for SHA: no-such-branch", "documentation_url": "https://docs.github.com/rest/reference/repos#get-a-commit" } … while fetching the input 'github:NixOS/nixpkgs/no-such-branch' … while updating the flake input 'nixpkgs' … while updating the lock file of flake 'git+file:///home/eelco/Dev/nix'
2021-01-22Remove expectedETag assert in tarball.ccMatthew Bauer
2021-01-18Merge branch 'slashes-in-github-branches' of https://github.com/Ma27/nixEelco Dolstra
2021-01-08string2Int(): Return std::optionalEelco Dolstra
2021-01-05Fix conversion from JSON to fetch attributesDanila Fedorin
It appears as through the fetch attribute, which is simply a variant with 3 elements, implicitly converts boolean arguments to integers. One must use Explicit<bool> to correctly populate it with a boolean. This was missing from the implementation, and resulted in clearly boolean JSON fields being treated as numbers.
2020-12-24Merge branch 'master' into support-libcxx10Matthew Bauer
2020-12-23Cast variants fully for libc++10Matthew Bauer
libc++10 seems to be stricter on what it allows in variant conversion. I'm not sure what the rules are here, but this is the minimal change needed to get through the compilation errors.
2020-12-22Add explicit `allRefs = true;` argument to `fetchGit`Maximilian Bosch
Sometimes it's necessary to fetch a git repository at a revision and it's unknown which ref contains the revision in question. An example would be a Cargo.lock which only provides the URL and the revision when using a git repository as build input. However it's considered a bad practice to perform a full checkout of a repository since this may take a lot of time and can eat up a lot of disk space. This patch makes a full checkout explicit by adding an `allRefs` argument to `builtins.fetchGit` which fetches all refs if explicitly set to true. Closes #2409
2020-12-22Provide a more meaningful error-message for `builtins.fetchGit` if a ↵Maximilian Bosch
revision can't be checked out A common pitfall when using e.g. `builtins.fetchGit` is the `fatal: not a tree object`-error when trying to fetch a revision of a git-repository that isn't on the `master` branch and no `ref` is specified. In order to make clear what's the problem, I added a simple check whether the revision in question exists and if it doesn't a more meaningful error-message is displayed: ``` nix-repl> builtins.fetchGit { url = "https://github.com/owner/myrepo"; rev = "<commit not on master>"; } moderror: --- Error -------------------------------------------------------------------- nix Cannot find Git revision 'bf1cc5c648e6aed7360448a3745bb2fe4fbbf0e9' in ref 'master' of repository 'https://gitlab.com/Ma27/nvim.nix'! Please make sure that the rev exists on the ref you've specified or add allRefs = true; to fetchGit. ``` Closes #2431
2020-11-23fetchMercurial: set HGPLAIN when invoking hgLuke Granger-Brown
Without setting HGPLAIN, the user's environment leaks into hg invocations, which means that the output may not be in the expected format. HGPLAIN is the Mercurial-recommended solution for this in that it's intended for uses by scripts and programs which are looking to parse Mercurial's output in a consistent manner.
2020-11-10Fix use of dirty Git/Mercurial inputs with chroot storesEelco Dolstra
Fixes: $ nix build --store /tmp/nix /home/eelco/Dev/patchelf#hydraJobs.build.x86_64-linux warning: Git tree '/home/eelco/Dev/patchelf' is dirty error: --- RestrictedPathError ------------------------------------------------------------------------------------------- nix access to path '/tmp/nix/nix/store/xmkvfmffk7xfnazykb5kx999aika8an4-source/flake.nix' is forbidden in restricted mode (use '--show-trace' to show detailed location information)
2020-10-28Capitalize JSON for consistencyMatthew Kenigsberg
2020-10-26Move ExplicitEelco Dolstra
2020-10-19Merge pull request #4080 from kquick/kwq/flake-int-docEelco Dolstra
Add some internal documentation for flake support objects.
2020-10-09Split out `local-fs-store.hh`John Ericson
This matches the already-existing `local-fs-store.cc`.
2020-10-06libfetchers/github: allow slashes in refsMaximilian Bosch
Refs #4061