aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr
AgeCommit message (Collapse)Author
2019-09-22Don't catch exceptions by valueEelco Dolstra
2019-09-20Flake alias -> idEelco Dolstra
2019-09-20Add flags to disallow dirty Git trees and to turn off warningsEelco Dolstra
2019-09-18Some effort to minimize flake dependenciesEelco Dolstra
For example, if the top-level flake depends on "nixpkgs/release-19.03", and one of its dependencies depends on "nixpkgs", then the latter will be mapped to "nixpkgs/release-19.03", rather than whatever the default branch of "nixpkgs" is. Thus you get only one "nixpkgs" dependency rather than two. This currently only works in a breadth-first way, so the other way around (i.e. if the top-level flake depends on "nixpkgs", and a dependency depends on "nixpkgs/release-19.03") still results in two "nixpkgs" dependencies.
2019-09-18Record original flakerefs in the lock file againEelco Dolstra
If 'input.<name>.uri' changes, then the entry in the lockfile for input <name> should be considered stale. Also print some messages when lock file entries are added/updated.
2019-09-09Require flake.nix to be an attrset (not a non-trivial thunk)Eelco Dolstra
2019-09-09Don't allow arbitrary computations in flake attributesEelco Dolstra
E.g. you can write 'edition = 201909' but not 'edition = 201909 + 0'. Fixes #3075.
2019-09-05Use git+ prefix in flake URI schemesEelco Dolstra
Fixes #3045.
2019-09-02Improve error message when a directory is not a flakeEelco Dolstra
So you now get $ nix build error: path '.' is not a flake (because it does not reference a Git repository) rather than $ nix build error: unsupported argument '.'
2019-08-30Fix sourceInfoEelco Dolstra
2019-08-30Remove 'name' attribute from flakesEelco Dolstra
This is no longer needed since flakes are given an identity in the 'inputs' attribute.
2019-08-30Turn flake inputs into an attrsetEelco Dolstra
Instead of a list, inputs are now an attrset like inputs = { nixpkgs.uri = github:NixOS/nixpkgs; }; If 'uri' is omitted, than the flake is a lookup in the flake registry, e.g. inputs = { nixpkgs = {}; }; but in that case, you can also just omit the input altogether and specify it as an argument to the 'outputs' function, as in outputs = { self, nixpkgs }: ... This also gets rid of 'nonFlakeInputs', which are now just a special kind of input that have a 'flake = false' attribute, e.g. inputs = { someRepo = { uri = github:example/repo; flake = false; }; };
2019-08-30Clean up the 'outputs' interfaceEelco Dolstra
2019-08-30Extract flake dependencies from the 'outputs' argumentsEelco Dolstra
That is, instead of inputs = [ "nixpkgs" ]; outputs = inputs: ... inputs.nixpkgs ...; you can write outputs = { nixpkgs }: ... inputs.nixpkgs ...;
2019-08-29Merge remote-tracking branch 'origin/master' into flakesEelco Dolstra
2019-08-14Track function start and ends for flame graphsGraham Christensen
With this patch, and this file I called `log.py`: #!/usr/bin/env nix-shell #!nix-shell -i python3 -p python3 --pure import sys from pprint import pprint stack = [] timestack = [] for line in open(sys.argv[1]): components = line.strip().split(" ", 2) if components[0] != "function-trace": continue direction = components[1] components = components[2].rsplit(" ", 2) loc = components[0] _at = components[1] time = int(components[2]) if direction == "entered": stack.append(loc) timestack.append(time) elif direction == "exited": dur = time - timestack.pop() vst = ";".join(stack) print(f"{vst} {dur}") stack.pop() and: nix-instantiate --trace-function-calls -vvvv ../nixpkgs/pkgs/top-level/release.nix -A unstable > log.matthewbauer 2>&1 ./log.py ./log.matthewbauer > log.matthewbauer.folded flamegraph.pl --title matthewbauer-post-pr log.matthewbauer.folded > log.matthewbauer.folded.svg I can make flame graphs like: http://gsc.io/log.matthewbauer.folded.svg --- Includes test cases around function call failures and tryEval. Uses RAII so the finish is always called at the end of the function.
2019-08-08Merge remote-tracking branch 'origin/master' into flakesEelco Dolstra
2019-07-30Allow builtins.pathExists to check the existence of /nix/store pathsBas van Dijk
This makes it consitent with builtins.readDir.
2019-07-12Don't write lock files if they have dirty inputsEelco Dolstra
2019-07-12fetchGit: Warn about dirty treesEelco Dolstra
2019-07-11Use "git add --force --intent-to-add" for flake.lockEelco Dolstra
Fixes The following paths are ignored by one of your .gitignore files: flake.lock
2019-07-11Rename 'epoch' -> 'edition'Eelco Dolstra
2019-07-10Check for epochs < 201906Eelco Dolstra
2019-07-06Merge remote-tracking branch 'origin/master' into flakesEelco Dolstra
2019-07-02Merge pull request #2582 from LnL7/fetchgit-refsEelco Dolstra
fetchGit: allow fetching explicit refs
2019-06-25Merge remote-tracking branch 'origin/master' into flakesEelco Dolstra
2019-06-24Fix 32-bit overflow with --no-netEelco Dolstra
--no-net causes tarballTtl to be set to the largest 32-bit integer, which causes comparison like 'time + tarballTtl < other_time' to fail on 32-bit systems. So cast them to 64-bit first. https://hydra.nixos.org/build/95076624 (cherry picked from commit 29ccb2e9697ee2184012dd13854e487928ae4441)
2019-06-24Refactor downloadCached() interfaceEelco Dolstra
(cherry picked from commit df3f5a78d5ab0a1f2dc9d288b271b38a9b8b33b5)
2019-06-24CachedDownloadResult: Include store pathEelco Dolstra
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-24downloadCached: Return ETagEelco Dolstra
(cherry picked from commit 529add316c5356a8060c35f987643b7bf5c796dc)
2019-06-24Fix abort in fromTOMLEelco Dolstra
Fixes #2969.
2019-06-21Simplify getFlake() / fetchFlake() logicEelco Dolstra
2019-06-21Don't update the global registry when building a locked flakeEelco Dolstra
It's unnecessary and slows things down (e.g. when you're on a Thalys with super-crappy Internet).
2019-06-21Handle store symlinks in flake directoriesEelco Dolstra
E.g. 'nix path-info ./result' inside a flake directory now works again.
2019-06-21Fix 32-bit overflow with --no-netEelco Dolstra
--no-net causes tarballTtl to be set to the largest 32-bit integer, which causes comparison like 'time + tarballTtl < other_time' to fail on 32-bit systems. So cast them to 64-bit first. https://hydra.nixos.org/build/95076624
2019-06-18Merge pull request #2937 from CSVdB/fuzzymatching-v2Eelco Dolstra
FuzzyMatching works
2019-06-18FuzzyMatching worksNick Van den Broeck
Fixes #2843
2019-06-17nix flake check: Check appsEelco Dolstra
2019-06-12Fix fetchTarball with chroot storesEelco Dolstra
Fixes #2405.
2019-06-11writeRegistry(): Write correct versionEelco Dolstra
2019-06-07Disable EvalCache in impure modeEelco Dolstra
2019-06-07Add flake evaluation cacheEelco Dolstra
This exploits the hermetic nature of flake evaluation to speed up repeated evaluations of a flake output attribute. For example (doing 'nix build' on an already present package): $ time nix build nixpkgs:firefox real 0m1.497s user 0m1.160s sys 0m0.139s $ time nix build nixpkgs:firefox real 0m0.052s user 0m0.038s sys 0m0.007s The cache is ~/.cache/nix/eval-cache-v1.sqlite, which has entries like INSERT INTO Attributes VALUES( X'92a907d4efe933af2a46959b082cdff176aa5bfeb47a98fabd234809a67ab195', 'packages.firefox', 1, '/nix/store/pbalzf8x19hckr8cwdv62rd6g0lqgc38-firefox-67.0.drv /nix/store/g6q0gx0v6xvdnizp8lrcw7c4gdkzana0-firefox-67.0 out'); where the hash 92a9... is a fingerprint over the flake store path and the contents of the lockfile. Because flakes are evaluated in pure mode, this uniquely identifies the evaluation result.
2019-06-05Move flake-related stuff to src/libexpr/flakeEelco Dolstra
2019-06-04Shorter syntax for referencing flake outputsEelco Dolstra
Fixes #2819.
2019-06-04Eliminate duplicate fetching of the top-level flakeEelco Dolstra
2019-06-04Add commentsEelco Dolstra
2019-06-04Make non-flake inputs lazyEelco Dolstra
Also add a proper test for non-flake inputs.
2019-06-04Check hashEelco Dolstra
2019-06-04Rename dep -> inputEelco Dolstra
Also use nlohmann::json range-based for.
2019-06-04Move LockFile and related types to a separate fileEelco Dolstra