Commit graph

10927 commits

Author SHA1 Message Date
Eelco Dolstra
cbfbf71e08 Use callFunction() with an array for some calls with arity > 1 2021-11-04 15:03:57 +01:00
Eelco Dolstra
bcf4780006 Add level / displacement types 2021-11-04 15:03:45 +01:00
Eelco Dolstra
81e7c40264 Optimize primop calls
We now parse function applications as a vector of arguments rather
than as a chain of binary applications, e.g. 'substring 1 2 "foo"' is
parsed as

  ExprCall { .fun = <substring>, .args = [ <1>, <2>, <"foo"> ] }

rather than

  ExprApp (ExprApp (ExprApp <substring> <1>) <2>) <"foo">

This allows primops to be called immediately (if enough arguments are
supplied) without having to allocate intermediate tPrimOpApp values.

On

  $ nix-instantiate --dry-run '<nixpkgs/nixos/release-combined.nix>' -A nixos.tests.simple.x86_64-linux

this gives a substantial performance improvement:

  user CPU time:      median =      0.9209  mean =      0.9218  stddev =      0.0073  min =      0.9086  max =      0.9340  [rejected, p=0.00000, Δ=-0.21433±0.00677]
  elapsed time:       median =      1.0585  mean =      1.0584  stddev =      0.0024  min =      1.0523  max =      1.0623  [rejected, p=0.00000, Δ=-0.20594±0.00236]

because it reduces the number of tPrimOpApp allocations from 551990 to
42534 (i.e. only small minority of primop calls are partially
applied) which in turn reduces time spent in the garbage collector.
2021-11-04 15:03:40 +01:00
Eelco Dolstra
ab35cbd675 StaticEnv: Use std::vector instead of std::map 2021-11-04 15:03:34 +01:00
Eelco Dolstra
c4bd6a15c2 Add helper function to check whether a function arg is 'X' or '_X'
Also allow '_'.
2021-11-04 14:52:35 +01:00
Eelco Dolstra
c5fd0b46ae
Merge pull request #5486 from mohe2015/bugfixes2
Fix leaking pthread_attr_t
2021-11-04 10:44:33 +01:00
Eelco Dolstra
3f447bcd5f
Merge pull request #5488 from JanCVanB/patch-1
Reword "we"s to "I"s for consistency
2021-11-04 10:41:35 +01:00
Jan Van Bruggen
7d56174c1e
Reword "we"s to "I"s for consistency
This script uses multiple forms of the first-person POV:
1. "We" to refer to the Nix team (1e7c796e66/scripts/install-multi-user.sh (L72))
2. "We" to refer to the combination of the installation script & the user/executor (1e7c796e66/scripts/install-multi-user.sh (L710))
3. "We" to refer to the installation script alone (1e7c796e66/scripts/install-multi-user.sh (L602))
4. "I" to refer to the installation script alone (1e7c796e66/scripts/install-multi-user.sh (L200))

Since I prefer POV 4 to POV 3, this changes all instances of POV 3 to POV 4.
2021-11-03 18:42:32 -06:00
Moritz Hedtke
6f291ed718
Fix leaking pthread_attr_t
pthread_attr_destroy was not called.
2021-11-03 22:54:16 +01:00
Eelco Dolstra
1e7c796e66
Merge pull request #5475 from doronbehar/SQLiteWAL-vfs
libstore: Use unix-dotfile vfs if useSQLiteWAL is false
2021-11-03 21:20:27 +01:00
Eelco Dolstra
ae14113969
Merge pull request #5477 from league/check-overlay-args
In checkOverlay, accept underscored names for final/prev args.
2021-11-03 21:18:58 +01:00
Domen Kožar
f1c9ee0364
Merge pull request #5480 from rex4539/typos
Fix typos
2021-11-03 11:07:19 -06:00
Dimitris Apostolou
c34cc5e488
Fix typos 2021-11-03 18:11:20 +02:00
Christopher League
3f070cc417 In checkOverlay, accept underscored names for final/prev args.
Resolves #4416.
2021-11-03 09:25:27 -04:00
Doron Behar
14fcf17277 libstore: Use unix-dotfile vfs if useSQLiteWAL is false 2021-11-03 14:19:11 +02:00
Eelco Dolstra
133905b309
Merge pull request #5471 from simon04/patch-1
command-ref/nix-shell: fix --pure, --keep
2021-11-03 11:15:13 +01:00
Simon Legner
1968760f4a
command-ref/nix-shell: fix --pure, --keep 2021-11-02 22:00:08 +01:00
Eelco Dolstra
886ad0055f
Merge pull request #5459 from andersk/echo-e
installer: Do not use echo -e in #!/bin/sh script
2021-11-02 20:00:43 +01:00
Anders Kaseorg
447350fe0e installer: Do not use echo -e in #!/bin/sh script
ShellCheck correctly warns:

In scripts/install-nix-from-closure.sh line 218:
                echo -e "\nif [ -e $p ]; then . $p; fi # added by Nix installer" >> "$fn"
                     ^-- SC3037: In POSIX sh, echo flags are undefined.

In scripts/install-nix-from-closure.sh line 229:
                echo -e "\nif [ -e $p ]; then . $p; fi # added by Nix installer" >> "$fn"
                     ^-- SC3037: In POSIX sh, echo flags are undefined.

Indeed, this actually breaks on Ubuntu where /bin/sh is dash.

Fixes #5458.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2021-11-02 10:27:27 -07:00
Eelco Dolstra
647baaa151
Merge pull request #5462 from edolstra/remove-source-tarball
Remove references to building from the source tarball
2021-11-02 16:22:45 +01:00
Eelco Dolstra
b61b307bad Remove references to building from the source tarball 2021-11-02 15:29:47 +01:00
Domen Kožar
b8532c9ff1 install-nix-actionv@v14.1 2021-11-02 08:24:17 -06:00
Eelco Dolstra
37b5460ebd
Update release script 2021-11-02 11:53:25 +01:00
Eelco Dolstra
6a93e186f4 Fix 2.4 migration examples 2021-11-01 22:44:07 +01:00
Eelco Dolstra
888771b4b2
Merge pull request #5448 from edolstra/timeout
Apply a 60-minute timeout to the 'tests' workflow
2021-10-29 15:38:30 +02:00
Eelco Dolstra
19148f1940 Apply a 60-minute timeout to the 'tests' workflow 2021-10-29 14:48:36 +02:00
Eelco Dolstra
e6795c4350 Style 2021-10-29 14:45:13 +02:00
Eelco Dolstra
6e30d9b69f Merge branch 'master' of https://github.com/alekswn/nix 2021-10-29 14:42:26 +02:00
Eelco Dolstra
0d00dd6262
Merge pull request #5149 from edolstra/non-blocking-gc
Non-blocking garbage collector
2021-10-28 23:55:16 +02:00
Eelco Dolstra
33d04e8a8d Use nix::connect() to connect to the garbage collector 2021-10-28 22:51:11 +02:00
Eelco Dolstra
22c35ea5b8 Remove unused variable 2021-10-28 22:51:11 +02:00
Eelco Dolstra
a7d4f3411e Merge remote-tracking branch 'origin/master' into non-blocking-gc 2021-10-28 14:56:55 +02:00
Eelco Dolstra
bc4b7521f4 Rename rl-2.5.md to rl-next.md
Having a generically named file for release notes for the next release
makes things easier for PRs.
2021-10-28 14:36:47 +02:00
Eelco Dolstra
5a160171d0 Remove redundant 'warning:' 2021-10-27 18:14:12 +02:00
Eelco Dolstra
9c6ac9eb0e 2.4 release notes: Add some migration notes 2021-10-27 17:33:32 +02:00
Eelco Dolstra
9559f74a99
Merge pull request #5440 from edolstra/build-remote
Fix preferLocalBuild when max-jobs == 0
2021-10-27 15:27:17 +02:00
Eelco Dolstra
1254e8753c build-remote: Implicitly add the 'builtin' system type to all machines
This makes 'nix-env -i --max-jobs 0' work with remote builders.
2021-10-27 14:25:13 +02:00
Eelco Dolstra
f2280749b1 If max-jobs == 0, do preferLocalBuild on remote builders 2021-10-27 14:21:31 +02:00
Eelco Dolstra
6e684d1b87 daemon: Accept 'repeat' setting from untrusted users
Fixes #5352.
2021-10-27 13:09:13 +02:00
Eelco Dolstra
13a7a24ba5 Style 2021-10-27 13:02:37 +02:00
Eelco Dolstra
5667822edc
Merge pull request #5421 from bew/fix-devshell-build-on-non-nixos
Fix devShell build on non-NixOS with a different boost version
2021-10-26 14:45:30 +02:00
Eelco Dolstra
0d9e050ba7 parseExperimentalFeature(): Initialize atomically 2021-10-26 14:29:48 +02:00
Eelco Dolstra
9ce84c64c5 Tweak fetchTree docs 2021-10-26 14:21:24 +02:00
Eelco Dolstra
3155862bae Merge remote-tracking branch 'origin/overhaul-xp-features' 2021-10-26 14:08:27 +02:00
regnat
af99941279 Make experimental-features a proper type
Rather than having them plain strings scattered through the whole
codebase, create an enum containing all the known experimental features.

This means that
- Nix can now `warn` when an unkwown experimental feature is passed
  (making it much nicer to spot typos and spot deprecated features)
- It’s now easy to remove a feature altogether (once the feature isn’t
  experimental anymore or is dropped) by just removing the field for the
  enum and letting the compiler point us to all the now invalid usages
  of it.
2021-10-26 07:02:31 +02:00
Benoit de Chezelles
ec9c1286ad Fix devShell build on non-NixOS with a different boost version 2021-10-23 15:32:48 +02:00
Domen Kožar
4a2b7cc68c
Merge pull request #5405 from NixOS/dependabot/github_actions/actions/checkout-2.3.5
Bump actions/checkout from 2.3.4 to 2.3.5
2021-10-19 12:13:10 -05:00
dependabot[bot]
2400819809
Bump actions/checkout from 2.3.4 to 2.3.5
Bumps [actions/checkout](https://github.com/actions/checkout) from 2.3.4 to 2.3.5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2.3.4...v2.3.5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-18 22:01:24 +00:00
Domen Kožar
623514bf9e
Merge pull request #5398 from kamadorueda/master
fetch: nicer infinite recursion errors
2021-10-17 20:55:36 -05:00
Domen Kožar
51c812d6bb
Merge pull request #5365 from arafangion/master
Clarify that not all nix packages will use the default build phases
2021-10-17 20:54:00 -05:00