aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-01-15docker: var/tmp make add -p option to mkdir to also create parent dirsJohn Axel Eriksson
2022-01-15docker: also create var/tmp as some tools rely on itJohn Axel Eriksson
2022-01-14Merge pull request #5916 from NixOS/5896-git-in-docker-imageRok Garbas
Add git to the docker image
2022-01-14Add git to the docker imageregnat
Fix #5896 See https://github.com/NixOS/docker/issues/33
2022-01-13TweakEelco Dolstra
2022-01-13Merge branch 'patch-1' of https://github.com/TheodorRene/nixEelco Dolstra
2022-01-13Merge pull request #5903 from Profpatsch/release-notes-2.4-add-indirect-noopEelco Dolstra
Release Notes 2.4: add `--indirect` no-op change
2022-01-12Release Notes 2.4: add `--indirect` no-op changeProfpatsch
Since https://github.com/NixOS/nix/commit/00d25e84577659ccf0bc360c61c47b6cd25d1c26 which was first included in nix 2.4. It is a backwards-compatible change since the flag will just be ignored.
2022-01-12Merge pull request #5887 from pennae/avoid-streamsThéophane Hufschmitt
avoid std::?stream overhead when it's not helpful
2022-01-12use boost::lexical_cast for string2*pennae
this avoids one copy from `s` into `str`, and possibly another copy needed to construct `s` at the call site. lexical_cast is also more efficient in general.
2022-01-12optimize ExprConcatStrings::evalpennae
constructing an ostringstream for non-string concats (like integer addition) is a small constant cost that we can avoid. for string concats we can keep all the string temporaries we get from coerceToString and concatenate them in one go, which saves a lot of intermediate temporaries and copies in ostringstream. we can also avoid copying the concatenated string again by directly allocating it in GC memory and moving ownership of the concatenated string into the target value. saves about 2% on system eval. before: Benchmark 1: nix eval --raw --impure --expr 'with import <nixpkgs/nixos> {}; system' Time (mean ± σ): 2.837 s ± 0.031 s [User: 2.562 s, System: 0.191 s] Range (min … max): 2.796 s … 2.892 s 20 runs after: Benchmark 1: nix eval --raw --impure --expr 'with import <nixpkgs/nixos> {}; system' Time (mean ± σ): 2.790 s ± 0.035 s [User: 2.532 s, System: 0.187 s] Range (min … max): 2.722 s … 2.836 s 20 runs
2022-01-11Add link to explanation when introducing a new operatorTheodor René Carlsen
The logical implication operator is included in this section but never explained. It might stump new readers with a pretty uncommon operator, and it's never referenced explicitly.
2022-01-11Merge pull request #5883 from fzakaria/faridzakaria/check-metaThéophane Hufschmitt
Check for `--meta` before emitting it for `--json`
2022-01-11Merge pull request #5898 from layus/repair-path-linksEelco Dolstra
Make --repair-path also repair corrupt optimised links
2022-01-11Prefer RepairFlag over bool when applicableGuillaume Maudoux
2022-01-11Make --repair-path also repair corrupt optimised linksGuillaume Maudoux
There already existed a smoke test for the link content length, but it appears that there exists some corruptions pernicious enough to replace the file content with zeros, and keeping the same length. --repair-path now goes as far as checking the content of the link, making it true to its name and actually repairing the path for such coruption cases.
2022-01-10Merge branch 'readfile' of https://github.com/abbradar/nixEelco Dolstra
2022-01-10'target' points to 'source'Eelco Dolstra
2022-01-10Merge branch 'recursive-nix-fix' of https://github.com/L-as/nixEelco Dolstra
2022-01-09Add test for readFile keeping contextNikolay Amiantov
2022-01-09builtins.readFile: Propagate path contextNikolay Amiantov
Co-authored-by: Shea Levy <shea@shealevy.com>
2022-01-07dump(): Use emplace()Eelco Dolstra
2022-01-07isInDir() / isDirOrInDir(): Use std::string_viewEelco Dolstra
2022-01-07DerivationGoal::loadDerivation(): Don't use derivationFromPath()Eelco Dolstra
This causes a recursive call to ensurePath(), which is not a good idea.
2022-01-07avoid ostream sentries per json string characterpennae
we don't have to create an ostream sentry object for every character of a JSON string we write. format a bunch of characters and flush them to the stream all at once instead. this doesn't affect small numbers of string characters, but larger numbers of total JSON string characters written gain a lot. at 1MB of total string written we gain almost 30%, at 16MB it's almost a factor of 3x. large numbers of JSON string characters do occur naturally in a nixos system evaluation to generate documentation (though this is now somewhat mitigated by caching the largest part of nixos option docs). benchmarked with hyperfine 'nix eval --raw --expr "let s = __concatStringsSep \"\" (__genList (_: \"c\") 256); in __toJSON (__genList (_: s) {e})"' --warmup 1 -L e 1,4,256,4096,65536 before: Benchmark 1: nix eval --raw --expr "let s = __concatStringsSep \"\" (__genList (_: \"c\") 256); in __toJSON (__genList (_: s) 1)" Time (mean ± σ): 12.5 ms ± 0.2 ms [User: 9.2 ms, System: 4.0 ms] Range (min … max): 11.9 ms … 13.1 ms 223 runs Benchmark 2: nix eval --raw --expr "let s = __concatStringsSep \"\" (__genList (_: \"c\") 256); in __toJSON (__genList (_: s) 4)" Time (mean ± σ): 12.5 ms ± 0.2 ms [User: 9.3 ms, System: 3.8 ms] Range (min … max): 11.9 ms … 13.2 ms 220 runs Benchmark 3: nix eval --raw --expr "let s = __concatStringsSep \"\" (__genList (_: \"c\") 256); in __toJSON (__genList (_: s) 256)" Time (mean ± σ): 13.2 ms ± 0.3 ms [User: 9.8 ms, System: 4.0 ms] Range (min … max): 12.6 ms … 14.3 ms 205 runs Benchmark 4: nix eval --raw --expr "let s = __concatStringsSep \"\" (__genList (_: \"c\") 256); in __toJSON (__genList (_: s) 4096)" Time (mean ± σ): 24.0 ms ± 0.4 ms [User: 19.4 ms, System: 5.2 ms] Range (min … max): 22.7 ms … 25.8 ms 119 runs Benchmark 5: nix eval --raw --expr "let s = __concatStringsSep \"\" (__genList (_: \"c\") 256); in __toJSON (__genList (_: s) 65536)" Time (mean ± σ): 196.0 ms ± 3.7 ms [User: 171.2 ms, System: 25.8 ms] Range (min … max): 190.6 ms … 201.5 ms 14 runs after: Benchmark 1: nix eval --raw --expr "let s = __concatStringsSep \"\" (__genList (_: \"c\") 256); in __toJSON (__genList (_: s) 1)" Time (mean ± σ): 12.4 ms ± 0.3 ms [User: 9.1 ms, System: 4.0 ms] Range (min … max): 11.7 ms … 13.3 ms 204 runs Benchmark 2: nix eval --raw --expr "let s = __concatStringsSep \"\" (__genList (_: \"c\") 256); in __toJSON (__genList (_: s) 4)" Time (mean ± σ): 12.4 ms ± 0.2 ms [User: 9.2 ms, System: 3.9 ms] Range (min … max): 11.8 ms … 13.0 ms 214 runs Benchmark 3: nix eval --raw --expr "let s = __concatStringsSep \"\" (__genList (_: \"c\") 256); in __toJSON (__genList (_: s) 256)" Time (mean ± σ): 12.6 ms ± 0.2 ms [User: 9.5 ms, System: 3.8 ms] Range (min … max): 12.1 ms … 13.3 ms 209 runs Benchmark 4: nix eval --raw --expr "let s = __concatStringsSep \"\" (__genList (_: \"c\") 256); in __toJSON (__genList (_: s) 4096)" Time (mean ± σ): 15.9 ms ± 0.2 ms [User: 11.4 ms, System: 5.1 ms] Range (min … max): 15.2 ms … 16.4 ms 171 runs Benchmark 5: nix eval --raw --expr "let s = __concatStringsSep \"\" (__genList (_: \"c\") 256); in __toJSON (__genList (_: s) 65536)" Time (mean ± σ): 69.0 ms ± 0.9 ms [User: 44.3 ms, System: 25.3 ms] Range (min … max): 67.2 ms … 70.9 ms 42 runs
2022-01-06Check for `--meta` before emitting it for `--json`Farid Zakaria
Check that the meta flag is present when emitting JSON query information for `nix-env`. fixes #5882
2022-01-06Merge branch 'install-nlohmann-json-headers' of ↵Eelco Dolstra
https://github.com/hercules-ci/nix
2022-01-06Merge pull request #5878 from fzakaria/faridzakaria/json-outputsEelco Dolstra
Add outputs to JSON query
2022-01-06Merge pull request #5546 from NixOS/allow-paths-in-flake-local-optionsEelco Dolstra
allow paths in flake local options
2022-01-06Add outputs to JSON queryFarid Zakaria
Emit output information when printing JSON information and `--out-paths` is requested. fixes #5877
2022-01-06Merge pull request #5749 from GavinRay97/patch-1Domen Kožar
Better diagnostics if no valid signature found
2022-01-05Merge pull request #5864 from edolstra/attr-sets-cleanupEelco Dolstra
Attrset improvements
2022-01-04Remove EvalState::mkAttrs()Eelco Dolstra
2022-01-04Move empty attrset optimisationEelco Dolstra
2022-01-04Turn mkString(Symbol) into a methodEelco Dolstra
2022-01-04Remove non-method mkPath()Eelco Dolstra
2022-01-04Remove non-method mk<X> functionsEelco Dolstra
2022-01-04Remove non-method mkString()Eelco Dolstra
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.
2022-01-04Merge pull request #5862 from SuperSandro2000/patch-1Eelco Dolstra
Add iana-etc for /etc/protocols to default packages
2022-01-04Add iana-etc for /etc/protocols to default packagesSandro
2022-01-04Merge pull request #5830 from pennae/zipAttrsWithEelco Dolstra
add zipAttrsWith primop
2022-01-03add zipAttrsWith primoppennae
nixpkgs can save a good bit of eval memory with this primop. zipAttrsWith is used quite a bit around nixpkgs (eg in the form of recursiveUpdate), but the most costly application for this primop is in the module system. it improves the implementation of zipAttrsWith from nixpkgs by not checking an attribute multiple times if it occurs more than once in the input list, allocates less values and set elements, and just avoids many a temporary object in general. nixpkgs has a more generic version of this operation, zipAttrsWithNames, but this version is only used once so isn't suitable for being the base of a new primop. if it were to be used more we should add a second primop instead.
2022-01-03Merge pull request #5839 from tweag/balsoft/yet-another-follows-bugfixEelco Dolstra
flake.cc: computeLocks: Only verify overrides when they could change
2022-01-03Merge pull request #5840 from tweag/balsoft/nix-repl-show-traceEelco Dolstra
nix repl: fix --show-trace and add the ability to set trace display
2022-01-03Merge pull request #5844 from Kha/fix-ifd-chroot-once-moreEelco Dolstra
Fix IFD with chroot store
2022-01-03Merge pull request #5852 from autc04/docker-tmp-permissionsEelco Dolstra
docker.nix: set correct permissions on /tmp (fix #5851)
2022-01-01docker.nix: set correct permissions on /tmpWolfgang Thaller
2021-12-29Fix IFD with chroot storeSebastian Ullrich
2021-12-29Add ability to toggle show-trace from within the replAlexander Bantyev