aboutsummaryrefslogtreecommitdiff
path: root/src/nix
AgeCommit message (Collapse)Author
2022-01-27optionally return string_view from coerceToStringpennae
we'll retain the old coerceToString interface that returns a string, but callers that don't need the returned value to outlive the Value it came from can save copies by using the new interface instead. for values that weren't stringy we'll pass a new buffer argument that'll be used for storage and shouldn't be inspected.
2022-01-27return string_views from forceString*pennae
once a string has been forced we already have dynamic storage allocated for it, so we can easily reuse that storage instead of copying.
2022-01-27convert a for more utilities to string_viewpennae
2022-01-25fix typolincoln auster
Co-authored-by: Cole Helbling <cole.e.helbling@outlook.com>
2022-01-25nix store ping: Report Nix daemon versionEelco Dolstra
Fixes #5952.
2022-01-25flakes: document nixConfig optionlincoln auster [they/them]
Fixes #5988.
2022-01-25bundler: notes and doc update to include bundlers repoTom Bereknyei
2022-01-25bundler: add tests and change defaults to use a derivationTom Bereknyei
2022-01-24Refactor bundler APITom Bereknyei
Bundlers now expect to be located at bundlers.<system>.<name> and are a function from derivations to derivations.
2022-01-24bundler: pass drv attrset instead of pathTom Bereknyei
2022-01-24hiliteMatches(): Style fixes, pass more stuff by referenceEelco Dolstra
2022-01-24Merge pull request #5945 from afishhh/masterThéophane Hufschmitt
Make `nix search` highlight all regexes and matches
2022-01-21forceList: make pos mandatoryKevin Amado
2022-01-21forceAttrs: make pos mandatoryKevin Amado
2022-01-21forceValue: make pos mandatoryKevin Amado
- Make passing the position to `forceValue` mandatory, this way we remember people that the position is important for better error messages - Add pos to all `forceValue` calls
2022-01-21Move hilite_all into libutil and rename it to hiliteMatchesFishhh
The signature was also changed so the function now accepts a vector instead of an iterator
2022-01-21Merge pull request #5942 from NixOS/5912-quieter-nix-why-dependsEelco Dolstra
Make `nix why-depends` quieter by default
2022-01-21Improve the description of the `--precise` optionThéophane Hufschmitt
Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
2022-01-20Make `hilite_all` take an iterator of matches instead of a vector.Hubert Głuchowski
2022-01-19Remove dead field in NixArgsJohn Ericson
This has been unused since 170e86dff5724264e0d3d25b9af1bd42df6aec74 CC @thufschmitt
2022-01-19Make `nix search` highlight all matches of a regexHubert Głuchowski
2022-01-19Make `nix search` highlight all regexesHubert Głuchowski
2022-01-19defer formals duplicate check for incresed efficiency all roundpennae
if we defer the duplicate argument check for lambda formals we can use more efficient data structures for the formals set, and we can get rid of the duplication of formals names to boot. instead of a list of formals we've seen and a set of names we'll keep a vector instead and run a sort+dupcheck step before moving the parsed formals into a newly created lambda. this improves performance on search and rebuild by ~1%, pure parsing gains more (about 4%). this does reorder lambda arguments in the xml output, but the output is still stable. this shouldn't be a problem since argument order is not semantically important anyway. before nix search --no-eval-cache --offline ../nixpkgs hello Time (mean ± σ): 8.550 s ± 0.060 s [User: 6.470 s, System: 1.664 s] Range (min … max): 8.435 s … 8.666 s 20 runs nix eval -f ../nixpkgs/pkgs/development/haskell-modules/hackage-packages.nix Time (mean ± σ): 346.7 ms ± 2.1 ms [User: 312.4 ms, System: 34.2 ms] Range (min … max): 343.8 ms … 353.4 ms 20 runs nix eval --raw --impure --expr 'with import <nixpkgs/nixos> {}; system' Time (mean ± σ): 2.720 s ± 0.031 s [User: 2.415 s, System: 0.231 s] Range (min … max): 2.662 s … 2.780 s 20 runs after nix search --no-eval-cache --offline ../nixpkgs hello Time (mean ± σ): 8.462 s ± 0.063 s [User: 6.398 s, System: 1.661 s] Range (min … max): 8.339 s … 8.542 s 20 runs nix eval -f ../nixpkgs/pkgs/development/haskell-modules/hackage-packages.nix Time (mean ± σ): 329.1 ms ± 1.4 ms [User: 296.8 ms, System: 32.3 ms] Range (min … max): 326.1 ms … 330.8 ms 20 runs nix eval --raw --impure --expr 'with import <nixpkgs/nixos> {}; system' Time (mean ± σ): 2.687 s ± 0.035 s [User: 2.392 s, System: 0.228 s] Range (min … max): 2.626 s … 2.754 s 20 runs
2022-01-19Make `nix why-depends` quieter by defaultregnat
Unless `--precise` is passed, make `nix why-depends` only show the dependencies between the store paths, without introspecting them to find the actual references. This also makes it ~3x faster
2022-01-18Merge pull request #5918 from tweag/tty-logsEelco Dolstra
Print build logs when not connected to a TTY
2022-01-18Add examplesEelco Dolstra
2022-01-18Add Installable::toDrvPaths()Eelco Dolstra
This is needed to get the path of a derivation that might not exist (e.g. for 'nix store copy-log'). InstallableStorePath::toDerivedPaths() cannot be used for this because it calls readDerivation(), so it fails if the store doesn't have the derivation.
2022-01-18Add command 'nix store copy-log'Eelco Dolstra
Fixes #5222.
2022-01-18Factor out --from / --to logicEelco Dolstra
2022-01-18Merge pull request #5932 from edolstra/remove-shared-stringsEelco Dolstra
Remove shared strings
2022-01-18Get rid of std::shared_ptr<std::string> and ref<std::string>Eelco Dolstra
These were needed back in the pre-C++11 era because we didn't have move semantics. But now we do.
2022-01-18Merge pull request #5720 from tomberek/flake_searchThéophane Hufschmitt
flakes: search up to git or filesystem boundary
2022-01-18Fix the rendering of the example directory treeregnat
2022-01-17Merge pull request #5812 from pennae/small-perf-improvementsEelco Dolstra
improve parser performance a bit
2022-01-17Update documentation for paths on command lineAlexander Bantyev
Co-authored-by: Théophane Hufschmitt <7226587+thufschmitt@users.noreply.github.com>
2022-01-17Show build and substitution information when not connected to a TTYAlexander Bantyev
When stderr is not connected to a tty, show "building" and "substituting" messages, a-la nix-build et al. Closes https://github.com/NixOS/nix/issues/4402 Co-authored-by: Théophane Hufschmitt <7226587+thufschmitt@users.noreply.github.com>
2022-01-14Document searching upwards and fix documentation for installablesAlexander Bantyev
2022-01-14Start the pager early-enough in `nix why-depends`regnat
`nix why-depends` is piping its output into a pager by default. However the pager was only started after the first path is printed, causing it to be excluded from the pager output. (Actually the pager was started *inside* the recursive function that was printing the dependency chain, so a new instance was started at each level. It’s a little miracle that it worked at all). Fix #5911
2022-01-13avoid copies of parser input datapennae
when given a string yacc will copy the entire input to a newly allocated location so that it can add a second terminating NUL byte. since the parser is a very internal thing to EvalState we can ensure that having two terminating NUL bytes is always possible without copying, and have the parser itself merely check that the expected NULs are present. # before Benchmark 1: nix search --offline nixpkgs hello Time (mean ± σ): 572.4 ms ± 2.3 ms [User: 563.4 ms, System: 8.6 ms] Range (min … max): 566.9 ms … 579.1 ms 50 runs Benchmark 2: nix eval -f ../nixpkgs/pkgs/development/haskell-modules/hackage-packages.nix Time (mean ± σ): 381.7 ms ± 1.0 ms [User: 348.3 ms, System: 33.1 ms] Range (min … max): 380.2 ms … 387.7 ms 50 runs Benchmark 3: nix eval --raw --impure --expr 'with import <nixpkgs/nixos> {}; system' Time (mean ± σ): 2.936 s ± 0.005 s [User: 2.715 s, System: 0.221 s] Range (min … max): 2.923 s … 2.946 s 50 runs # after Benchmark 1: nix search --offline nixpkgs hello Time (mean ± σ): 571.7 ms ± 2.4 ms [User: 563.3 ms, System: 8.0 ms] Range (min … max): 566.7 ms … 579.7 ms 50 runs Benchmark 2: nix eval -f ../nixpkgs/pkgs/development/haskell-modules/hackage-packages.nix Time (mean ± σ): 376.6 ms ± 1.0 ms [User: 345.8 ms, System: 30.5 ms] Range (min … max): 374.5 ms … 379.1 ms 50 runs Benchmark 3: nix eval --raw --impure --expr 'with import <nixpkgs/nixos> {}; system' Time (mean ± σ): 2.922 s ± 0.006 s [User: 2.707 s, System: 0.215 s] Range (min … max): 2.906 s … 2.934 s 50 runs
2022-01-04Ensure that attrsets are sortedEelco Dolstra
Previously you had to remember to call value->attrs->sort() after populating value->attrs. Now there is a BindingsBuilder helper that wraps Bindings and ensures that sort() is called before you can use it.
2021-12-29Add ability to toggle show-trace from within the replAlexander Bantyev
2021-12-27Fix accidental O(n^2 * log n) performance in NixRepl::addAttrsToScopeYorick van Pelt
Only sort once, after adding all of the attrs first. This reduces my `nix repl '<nixpkgs>'` loading time from 1.07s to 103ms. Fixes #5823
2021-12-22Merge pull request #5821 from edolstra/remove-affinityEelco Dolstra
Remove CPU locking
2021-12-22Merge pull request #5820 from ncfavier/completion-nospaceEelco Dolstra
Don't insert spaces when completing attribute paths
2021-12-22Don't insert spaces when completing attribute pathsNaïm Favier
2021-12-22Remove CPU lockingEelco Dolstra
This was already accidentally disabled in ba87b08. It also no longer appears to be beneficial, and in fact slow things down, e.g. when evaluating a NixOS system configuration: elapsed time: median = 3.8170 mean = 3.8202 stddev = 0.0195 min = 3.7894 max = 3.8600 [rejected, p=0.00000, Δ=0.36929±0.02513]
2021-12-20Add shell completion for why-dependsNaïm Favier
Fixes #5806
2021-12-15Fix typo in `src/nix/shell.md`Noah Snelson
Changed `If not command` to `If no command`, also specified that the default shell launched in `nix shell` can be specified with `$SHELL`.
2021-12-13nix run: Tweak docsEelco Dolstra
2021-12-13Merge branch 'pname-main-program' of https://github.com/figsoda/nixEelco Dolstra