aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-03-11Rename `requireGcStore` to `GcStore::require`John Ericson
I should have done this to begin with. This will be nicer once more Store sub-interfaces exist too, to illustrate the pattern.
2022-03-11Merge remote-tracking branch 'origin/eval-suggestions'Eelco Dolstra
2022-03-11Merge pull request #5865 from pennae/memory-friendlinessEelco Dolstra
be more memory friendly
2022-03-11StyleEelco Dolstra
2022-03-11Merge pull request #5758 from mschwaig/fix-git-workspace-dirty-detectionThéophane Hufschmitt
git fetcher: fix detection of dirty git workspaces
2022-03-09BuildResult: Remove unused drvPath fieldEelco Dolstra
2022-03-09Merge pull request #6221 from NixOS/build-paths-with-resultsEelco Dolstra
Add Store::buildPathsWithResults()
2022-03-09BuildResult: Use DerivedPathEelco Dolstra
2022-03-09add HAVE_BOEHMGC guards to batched allocation functionspennae
2022-03-09make Finally more localpennae
no need for function<> with c++17 deduction. this saves allocations and virtual calls, but has the same semantics otherwise. not going through function has the side effect of giving compilers more insight into the cleanup code, so we need a few local warning disables.
2022-03-08make Pos smallerpennae
reduces peak hep memory use on eval of our test system from 264.4MB to 242.3MB, possibly also a slight performance boost. theoretically memory use could be cut down by another eight bytes per Pos on average by turning it into a tuple containing an index into a global base position table with row and column offsets, but that doesn't seem worth the effort at this point.
2022-03-08force-inline a few much-used functionspennae
these functions are called a whole lot, and they're all comparatively small. always inlining them gives ~0.7% performance boost on eval. before: Benchmark 1: nix flakes search --no-eval-cache --offline ../nixpkgs hello Time (mean ± σ): 6.935 s ± 0.052 s [User: 5.852 s, System: 0.853 s] Range (min … max): 6.808 s … 7.026 s 20 runs Benchmark 2: nix flakes eval -f ../nixpkgs/pkgs/development/haskell-modules/hackage-packages.nix Time (mean ± σ): 329.8 ms ± 2.7 ms [User: 299.0 ms, System: 30.8 ms] Range (min … max): 326.6 ms … 336.5 ms 20 runs Benchmark 3: nix flakes eval --raw --impure --file expr.nix Time (mean ± σ): 2.655 s ± 0.038 s [User: 2.364 s, System: 0.220 s] Range (min … max): 2.574 s … 2.737 s 20 runs after: Benchmark 1: nix flakes search --no-eval-cache --offline ../nixpkgs hello Time (mean ± σ): 6.912 s ± 0.036 s [User: 5.823 s, System: 0.856 s] Range (min … max): 6.849 s … 6.980 s 20 runs Benchmark 2: nix flakes eval -f ../nixpkgs/pkgs/development/haskell-modules/hackage-packages.nix Time (mean ± σ): 325.1 ms ± 2.5 ms [User: 293.2 ms, System: 31.8 ms] Range (min … max): 322.2 ms … 332.8 ms 20 runs Benchmark 3: nix flakes eval --raw --impure --file expr.nix Time (mean ± σ): 2.636 s ± 0.024 s [User: 2.352 s, System: 0.226 s] Range (min … max): 2.574 s … 2.681 s 20 runs
2022-03-08cache singleton Envs just like Valuespennae
vast majority of envs is this size. before: Benchmark 1: nix flakes search --no-eval-cache --offline ../nixpkgs hello Time (mean ± σ): 6.946 s ± 0.041 s [User: 5.875 s, System: 0.835 s] Range (min … max): 6.834 s … 7.005 s 20 runs Benchmark 2: nix flakes eval -f ../nixpkgs/pkgs/development/haskell-modules/hackage-packages.nix Time (mean ± σ): 330.3 ms ± 2.5 ms [User: 299.2 ms, System: 30.9 ms] Range (min … max): 327.5 ms … 337.7 ms 20 runs Benchmark 3: nix eval --raw --impure --expr 'with import <nixpkgs/nixos> {}; system' Time (mean ± σ): 2.671 s ± 0.035 s [User: 2.370 s, System: 0.232 s] Range (min … max): 2.597 s … 2.749 s 20 runs after: Benchmark 1: nix flakes search --no-eval-cache --offline ../nixpkgs hello Time (mean ± σ): 6.935 s ± 0.052 s [User: 5.852 s, System: 0.853 s] Range (min … max): 6.808 s … 7.026 s 20 runs Benchmark 2: nix flakes eval -f ../nixpkgs/pkgs/development/haskell-modules/hackage-packages.nix Time (mean ± σ): 329.8 ms ± 2.7 ms [User: 299.0 ms, System: 30.8 ms] Range (min … max): 326.6 ms … 336.5 ms 20 runs Benchmark 3: nix flakes eval --raw --impure --file expr.nix Time (mean ± σ): 2.655 s ± 0.038 s [User: 2.364 s, System: 0.220 s] Range (min … max): 2.574 s … 2.737 s 20 runs
2022-03-08remove GC_PTR_STORE_AND_DIRTYpennae
turns out it's only necessary for MANUAL_VDB, which nix doesn't use. omitting them gives a slight performance improvement on eval. before: Benchmark 1: nix flakes search --no-eval-cache --offline ../nixpkgs hello Time (mean ± σ): 6.988 s ± 0.061 s [User: 5.935 s, System: 0.845 s] Range (min … max): 6.865 s … 7.075 s 20 runs Benchmark 2: nix flakes eval -f ../nixpkgs/pkgs/development/haskell-modules/hackage-packages.nix Time (mean ± σ): 332.6 ms ± 3.9 ms [User: 299.6 ms, System: 32.9 ms] Range (min … max): 328.1 ms … 339.1 ms 20 runs Benchmark 3: nix eval --raw --impure --expr 'with import <nixpkgs/nixos> {}; system' Time (mean ± σ): 2.681 s ± 0.049 s [User: 2.382 s, System: 0.228 s] Range (min … max): 2.607 s … 2.776 s 20 runs after: Benchmark 1: nix flakes search --no-eval-cache --offline ../nixpkgs hello Time (mean ± σ): 6.946 s ± 0.041 s [User: 5.875 s, System: 0.835 s] Range (min … max): 6.834 s … 7.005 s 20 runs Benchmark 2: nix flakes eval -f ../nixpkgs/pkgs/development/haskell-modules/hackage-packages.nix Time (mean ± σ): 330.3 ms ± 2.5 ms [User: 299.2 ms, System: 30.9 ms] Range (min … max): 327.5 ms … 337.7 ms 20 runs Benchmark 3: nix eval --raw --impure --expr 'with import <nixpkgs/nixos> {}; system' Time (mean ± σ): 2.671 s ± 0.035 s [User: 2.370 s, System: 0.232 s] Range (min … max): 2.597 s … 2.749 s 20 runs
2022-03-08Add Store::buildPathsWithResults()Eelco Dolstra
This function is like buildPaths(), except that it returns a vector of BuildResults containing the exact statuses and output paths of each derivation / substitution. This is convenient for functions like Installable::build(), because they then don't need to do another series of calls to get the outputs of CA derivations. It's also a precondition to impure derivations, where we *can't* query the output of those derivations since they're not stored in the Nix database. Note that PathSubstitutionGoal can now also return a BuildStatus.
2022-03-08Also display some suggestions for invalid formal argumentsregnat
```console $ nix eval --expr '({ foo ? 1 }: foo) { fob = 2; }' error: anonymous function at (string):1:2 called with unexpected argument 'fob' at «string»:1:1: 1| ({ foo ? 1 }: foo) { fob = 2; } | ^ Did you mean foo? ``` Not that because Nix will first check for _missing_ arguments before checking for extra arguments, `({ foo }: foo) { fob = 1; }` will complain about the missing `foo` argument (rather than extra `fob`) and so won’t display a suggestion.
2022-03-08Try and make the darwin build happyregnat
2022-03-08Add some suggestions to the evaluatorregnat
Make the evaluator show some suggestions when trying to access an invalid field from an attrset. ```console $ nix eval --expr '{ foo = 1; }.foa' error: attribute 'foa' missing at «string»:1:1: 1| { foo = 1; }.foa | ^ Did you mean foo? ```
2022-03-07Bump versionEelco Dolstra
2022-03-07Move rl-next.md to rl-2.7.mdEelco Dolstra
2022-03-07StyleEelco Dolstra
2022-03-07Merge branch 'GuillaumeDesforges/issue6192' of ↵Eelco Dolstra
https://github.com/GuillaumeDesforges/nix
2022-03-07Tweak release notesEelco Dolstra
2022-03-07Merge branch 'cli-suggestions' of https://github.com/thufschmitt/nixEelco Dolstra
2022-03-07Explicit error in flake init/new when not in storeGuillaume Desforges
2022-03-07Merge `or-suggestions.hh` into `suggestions.hh`regnat
No real need for keeping a separate header for such a simple class. This requires changing a bit `OrSuggestions<T>::operator*` to not throw an `Error` to prevent a cyclic dependency. But since this error is only thrown on programmer error, we can replace the whole method by a direct call to `std::get` which will raise its own assertion if needs be.
2022-03-07Merge pull request #6173 from hercules-ci/fix-mkString-for-empty-string-viewEelco Dolstra
Fix `mkString` for empty `string_view`
2022-03-07dupStringWithLen -> makeImmutableStringRobert Hensing
Refactor the `size == 0` logic into a new helper function that replaces dupStringWithLen. The name had to change, because unlike a `dup`-function, it does not always allocate a new string.
2022-03-07Value::mkPath: Avoid potential crash from null string_viewRobert Hensing
2022-03-07Value::mkString: Avoid crash from null string_viewRobert Hensing
2022-03-07Tweak release notesEelco Dolstra
2022-03-07Implement `operator<<` for Suggestionsregnat
That way there’s no need to explicitely convert it to a string when printing it
2022-03-07Move OrSuggestions to its own headerregnat
Prevents a recursive inclusion
2022-03-07Add a release-notes entry for the cli suggestionsregnat
2022-03-07Add some end-to-end tests for the suggestionsregnat
2022-03-07Also display suggestions for the commands using the eval cacheregnat
Make `nix build .#nix-armv8l-linux` work for example
2022-03-07Add some tests for the suggestionsregnat
2022-03-07Implement a suggestions mechanismregnat
Each `Error` class now includes a set of suggestions, and these are printed by the top-level handler.
2022-03-07Merge pull request #6029 from Ma27/nix-log-ssh-ngThéophane Hufschmitt
ssh-ng: also store build logs to make them accessible by `nix log`
2022-03-07Explain why the log tests are disabled for CA derivationsThéophane Hufschmitt
2022-03-07Merge pull request #6208 from sielicki/fix-url-github-oauthThéophane Hufschmitt
Point to new github oauth docs url
2022-03-06Point to new github oauth docs urlNicholas Sielicki
Previous URL was 404'ing.
2022-03-04tests: grep for string in nix log for remote-buildsMaximilian Bosch
2022-03-03Merge pull request #6188 from obsidiansystems/store-gc-subclassEelco Dolstra
Factor out a `GcStore` interface
2022-03-03Factor out a `GcStore` interfaceJohn Ericson
Starts progress on #5729. The idea is that we should not have these default methods throwing "unimplemented". This is a small step in that direction. I kept `addTempRoot` because it is a no-op, rather than failure. Also, as a practical matter, it is called all over the place, while doing other tasks, so the downcasting would be annoying. Maybe in the future I could move the "real" `addTempRoot` to `GcStore`, and the existing usecases use a `tryAddTempRoot` wrapper to downcast or do nothing, but I wasn't sure whether that was a good idea so with a bias to less churn I didn't do it yet.
2022-03-03Merge pull request #6201 from edolstra/print-valueEelco Dolstra
printValue(): Don't show repeated values
2022-03-03Be more aggressive in hiding repeated valuesEelco Dolstra
We now memoize on Bindings / list element vectors rather than Values, so that e.g. two Values that point to the same Bindings will be printed only once.
2022-03-03printValue(): Don't show repeated valuesEelco Dolstra
Fixes #6157.
2022-03-03Fix segfault in headerCallback()Eelco Dolstra
https://hydra.nixos.org/build/168594664
2022-03-03Merge pull request #6198 from edolstra/coerce-store-pathEelco Dolstra
Add EvalState::coerceToStorePath() helper