about summary refs log tree commit diff
path: root/src/libexpr/primops
AgeCommit message (Collapse)AuthorFilesLines
2019-06-24 CachedDownloadResult: Include store pathEelco Dolstra2-2/+2
Also, make fetchGit and fetchMercurial update allowedPaths properly. (Maybe the evaluator, rather than the caller of the evaluator, should apply toRealPath(), but that's a bigger change.) (cherry picked from commit 5c34d665386f4053d666b0899ecca0639e500fbd)
2019-06-24 Fix abort in fromTOMLEelco Dolstra1-0/+13
Fixes #2969.
2019-03-14 experimental/optional -> optionalEelco Dolstra1-2/+2
2019-01-31 Add builtins.appendContext.Shea Levy1-2/+57
A partner of builtins.getContext, useful for the same reasons.
2019-01-14 Add builtins.getContext.Shea Levy1-0/+132
This can be very helpful when debugging, as well as enabling complex black magic like surgically removing a single dependency from a string's context.
2018-12-06 Solve hg "abandoned transaction" issueCHEIKH Chawki1-1/+16
2018-11-20 fetchGit: Drop unnecessary localRefEelco Dolstra1-4/+4
2018-11-20 Merge branch 'better-git-cache' of https://github.com/graham-at-target/nixEelco Dolstra1-1/+3
2018-09-01 fetchGit/fetchMercurial: Don't absolutize pathsEelco Dolstra2-4/+0
This is already done by coerceToString(), provided that the argument is a path (e.g. 'fetchGit ./bla'). It fixes the handling of URLs like git@github.com:owner/repo.git. It breaks 'fetchGit "./bla"', but that was never intended to work anyway and is inconsistent with other builtin functions (e.g. 'readFile "./bla"' fails).
2018-08-17 fetchGit: use a better caching schemeGraham Christensen1-1/+3
The current usage technically works by putting multiple different repos in to the same git directory. However, it is very slow as Git tries very hard to find common commits between the two repositories. If the two repositories are large (like Nixpkgs and another long-running project,) it is maddeningly slow. This change busts the cache for existing deployments, but users will be promptly repaid in per-repository performance.
2018-07-11 Fix build on 32-bit systems and macOSEelco Dolstra1-1/+1
Apparently, on macOS, 'long' != 'int64_t'. https://hydra.nixos.org/build/77100756
2018-07-11 Shup up a warningEelco Dolstra1-1/+1
2018-07-03 Include cpptoml for build simplicityEelco Dolstra1-1/+1
2018-07-03 Add a fromTOML primopEelco Dolstra1-0/+77
This is primarily useful for processing Cargo.lock files.
2018-05-30 Move evaluator-specific settings out of libstoreEelco Dolstra2-2/+2
2018-03-19 Shut up signedness warningEelco Dolstra2-2/+2
2018-03-13 fetchGit: Fix debug messageGuillaume Maudoux1-1/+1
2018-02-28 fetchGit: use "HEAD" as default refWill Dietz1-1/+1
2018-01-16 Add pure evaluation modeEelco Dolstra2-5/+16
In this mode, the following restrictions apply: * The builtins currentTime, currentSystem and storePath throw an error. * $NIX_PATH and -I are ignored. * fetchGit and fetchMercurial require a revision hash. * fetchurl and fetchTarball require a sha256 attribute. * No file system access is allowed outside of the paths returned by fetch{Git,Mercurial,url,Tarball}. Thus 'nix build -f ./foo.nix' is not allowed. Thus, the evaluation result is completely reproducible from the command line arguments. E.g. nix build --pure-eval '( let nix = fetchGit { url = https://github.com/NixOS/nixpkgs.git; rev = "9c927de4b179a6dd210dd88d34bda8af4b575680"; }; nixpkgs = fetchGit { url = https://github.com/NixOS/nixpkgs.git; ref = "release-17.09"; rev = "66b4de79e3841530e6d9c6baf98702aa1f7124e4"; }; in (import (nix + "/release.nix") { inherit nix nixpkgs; }).build.x86_64-linux )' The goal is to enable completely reproducible and traceable evaluation. For example, a NixOS configuration could be fully described by a single Git commit hash. 'nixos-rebuild' would do something like nix build --pure-eval '( (import (fetchGit { url = file:///my-nixos-config; rev = "..."; })).system ') where the Git repository /my-nixos-config would use further fetchGit calls or Git externals to fetch Nixpkgs and whatever other dependencies it has. Either way, the commit hash would uniquely identify the NixOS configuration and allow it to reproduced.
2018-01-09 fetchGit: fix creation of uninitialized cache dir, let git create itWill Dietz1-1/+0
fetchGit test (as modified in previous commit) now passes.
2017-12-22 fetchGit: Fix handling of local repo when not using 'master' branchWill Dietz1-1/+5
Add tests checking this behavior.
2017-11-24 fetchGit: Ignore tarballTtl if rev is set and not in the repo.Shea Levy1-24/+35
Fixes #1697.
2017-11-21 fetchGit/fetchMercurial: Fix directory inclusion checkEelco Dolstra2-4/+6
E.g. the existence of .gitignore would cause .git to be included.
2017-11-03 fetchgit.cc -> fetchGit.ccEelco Dolstra1-0/+0
2017-11-03 Remove git:// support in NIX_PATHEelco Dolstra2-25/+8
This didn't support specifying a revision/branch, and was restricted to git:// URIs (since https:// or ssh:// would be ambiguous).
2017-11-03 fetchGit/fetchMercurial: Filter out directories with untracked filesEelco Dolstra2-8/+16
2017-11-03 fetchGit: Add a testEelco Dolstra1-1/+1
2017-11-03 fetchGit: Don't do a remote fetch if we already have the revEelco Dolstra1-15/+23
2017-11-02 fetchMercurial: fix error messagetv1-1/+1
2017-11-01 Fix buildEelco Dolstra1-1/+1
https://hydra.nixos.org/build/63172338
2017-11-01 fetchMercurial: Don't fetch hashes we already haveEelco Dolstra1-9/+19
2017-11-01 Add fetchMercurial primopEelco Dolstra2-2/+189
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 builtins.fetchgit: Support importing a working treeEelco Dolstra2-6/+46
For example, you can write src = fetchgit ./.; and if ./. refers to an unclean working tree, that tree will be copied to the Nix store. This removes the need for "cleanSource".
2017-10-30 Make "fetchGit /path" workEelco Dolstra1-5/+5
2017-10-30 fetchGit: Fix broken assertionEelco Dolstra1-1/+1
Different URIs can map to the same cache entry if they have the same revision.
2017-10-30 Add option allowed-urisEelco Dolstra1-3/+4
This allows network access in restricted eval mode.
2017-10-30 builtins.fetchGit: Return an attrset with revision infoEelco Dolstra2-17/+53
This adds rev, shortRev and revCount attributes, equal to what Hydra provides. E.g. $ nix eval '(fetchGit https://github.com/NixOS/patchelf.git)' { outPath = "/nix/store/ghigrkw02l440g8vfxa9wj4c3zpfmw99-source"; rev = "29c085fd9d3fc972f75b3961905d6b4ecce7eb2b"; revCount = 303; shortRev = "29c085f"; }
2017-10-30 fetchgit -> fetchGitEelco Dolstra1-4/+4
Almost all other primops are camelCase so no reason not to use that here.
2017-10-30 builtins.fetchgit: Don't mess up the progress indicatorEelco Dolstra1-3/+5
2017-10-30 builtins.fetchgit: Support a "name" attributeEelco Dolstra2-11/+18
The "name" attribute defaults to "source", which we should use for all similar functions (e.g. fetchTarball and in Hydra) to ensure that we get a consistent store path regardless of how the tree is fetched. "source" is not necessarily a correct label, but using an empty name is problematic: you get an ugly store path ending in a dash, and it's impossible to have a fixed-output derivation that produces that path because ".drv" is not a valid store name. Fixes #904.
2017-10-17 fetchgit: Remove incomplete/unneeded ref check.Shea Levy1-5/+0
This check fails for tags and branches, and is made redundant by the checks git itself will do when fetching the repo.
2017-10-16 fetchgit: Remove incomplete/unneeded isURI check.Shea Levy1-4/+1
This check spuriously fails for e.g. git@github.com:NixOS/nixpkgs.git, and even for ssh://git@github.com/NixOS/nixpkgs.git, and is made redundant by the checks git itself will do when fetching the repo. We instead pass a -- before passing the URI to git to avoid injection.
2017-07-30 Replace Unicode quotes in user-facing strings by ASCIIJörg Thalheim1-9/+9
Relevant RFC: NixOS/rfcs#4 $ ag -l | xargs sed -i -e "/\"/s/’/'/g;/\"/s/‘/'/g"
2017-07-27 builtins.fetchgit: Support specifying commit hashesEelco Dolstra2-9/+29
This adds an argument "rev" specififying the Git commit hash. The existing argument "rev" is renamed to "ref". The default value for "ref" is "master". When specifying a hash, it's necessary to specify a ref since we're not cloning the entire repository but only fetching a specific ref. Example usage: builtins.fetchgit { url = https://github.com/NixOS/nixpkgs.git; ref = "release-16.03"; rev = "c1c0484041ab6f9c6858c8ade80a8477c9ae4442"; };
2017-07-27 builtins.fetchgit: Respect tarball-ttlEelco Dolstra1-1/+19
I.e. if the local ref is more recent than tarball-ttl seconds, then don't check the remote.
2017-07-27 builtins.fetchgit: Use proper refs locallyEelco Dolstra1-4/+3
2017-07-27 builtins.fetchgit: Cache hash -> store path mappingsEelco Dolstra1-2/+18
This prevents an expensive call to addToStore() in the cached case.
2017-05-16 Improve progress indicatorEelco Dolstra1-1/+1
2017-03-02 builtins.fetchgit: Support pathsEelco Dolstra1-3/+5
2017-03-02 builtins.fetchgit: Fix bad format stringEelco Dolstra1-1/+1