1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-13 14:02:42 +01:00
Commit graph

13103 commits

Author SHA1 Message Date
Artturin
d2c82c681a systemd,launchd match nixos open files limit
it was bumped in https://github.com/NixOS/nixpkgs/pull/176558

(cherry picked from commit 2320a2f93e)
2023-01-17 19:23:04 +00:00
TIAN Yuanhao
d6c9069454 Avoid poly_user_note_set twice
f06f810 incorrectly introduces a boolean flip, resulting in a senseless
poly_user_note_set even though the user comment has been set correctly.

(cherry picked from commit 09830ab829)
2023-01-10 20:32:52 +01:00
Naïm Favier
21b1a097d6 Allow disabling build users by unsetting build-users-group
Unsetting `build-users-group` (without `auto-allocate-uids` enabled)
gives the following error:

```
src/libstore/lock.cc:25: static std::unique_ptr<nix::UserLock> nix::SimpleUserLock::acquire(): Assertion `settings.buildUsersGroup != ""' failed.
```

Fix the logic in `useBuildUsers` and document the default value
for `build-users-group`.

(cherry picked from commit 1f3c0a3c1d)
2023-01-10 20:32:15 +01:00
Eelco Dolstra
4e6c3c356d Fix a crash in DerivedPath::Built::toJSON() with impure derivations
The use of 'nullptr' here didn't result in a null JSON value, but in a
nullptr being cast to a string, which aborts.

(cherry picked from commit 0687e16c4a)
2023-01-10 20:31:40 +01:00
Steven Shaw
e3e1093e8b Fix error message
(cherry picked from commit 84b0893725)
2023-01-10 20:31:01 +01:00
Théophane Hufschmitt
c0d64cafda Fix why-depends for CA derivations (again)
This has the same goal as b13fd4c58e81b2b2b0d72caa5ce80de861622610,but
achieves it in a different way in order to not break
`nix why-depends --derivation`.

(cherry picked from commit 8cac451fce)
2023-01-10 20:30:27 +01:00
Théophane Hufschmitt
a8f78a5e6d Increase the test coverage of why-depends
- Test with `--derivation`
- Actually test with ca-derivations (was suuposedly done, but not
  activated because of a missing line in `local.mk`)

(cherry picked from commit 6a90ef072c)
2023-01-10 20:30:23 +01:00
Théophane Hufschmitt
e381bfafbf Revert "Fix why-depends for CA derivations"
This reverts commit b13fd4c58e.

(cherry picked from commit 105d74eb81)
2023-01-10 20:30:17 +01:00
Alexandre Thomas
934ddd4e46 Fix Nix installation on older versions of fish
The `fish_add_path` function is only available for fish 3.2.0 or newer,
and not on older versions.
This commit adds an alternative way to update the PATH when
`fish_add_path` does not exist.

(cherry picked from commit 49e058f1cf)
2023-01-10 20:30:03 +01:00
Eelco Dolstra
65f15ffe3c Fix deadlock between auto-GC and addTempRoot()
Previously addTempRoot() acquired the LocalStore state lock and waited
for the garbage collector to reply. If the garbage collector is in the
same process (as it the case with auto-GC), this would deadlock as
soon as the garbage collector thread needs the LocalStore state lock.

So now addTempRoot() uses separate Syncs for the state that it
needs. As long at the auto-GC thread doesn't call addTempRoot() (which
it shouldn't), it shouldn't deadlock.

Fixes #3224.

(cherry picked from commit 28d5b5cd45)
2023-01-10 20:15:07 +01:00
Eelco Dolstra
6487d49a16 Move creation of the temp roots file into its own function
This also moves the file handle into its own Sync object so we're not
holding the _state while acquiring the file lock. There was no real
deadlock risk here since locking a newly created file cannot block,
but it's still a bit nicer.

(cherry picked from commit 224b56f10e)
2023-01-10 20:15:02 +01:00
Eelco Dolstra
2d4f6e6a4e On macOS with auto-uid-allocation and sandboxing, use the correct gid
macOS doesn't have user namespacing, so the gid of the builder needs
to be nixbld. The logic got "has sandboxing enabled" confused with
"has user namespaces".

Fixes #7529.

(cherry picked from commit 4e84b532ed)
2023-01-10 20:14:36 +01:00
Eelco Dolstra
dff7d605c6 Bump version 2022-12-06 17:24:56 +01:00
Eelco Dolstra
ef800f1e73 Mark official release 2022-12-06 14:50:25 +01:00
Eelco Dolstra
eece14dce4
Merge pull request #7410 from edolstra/release-notes
Branch 2.12 release notes
2022-12-06 14:30:09 +01:00
Eelco Dolstra
5b4b2eefa1 Release notes 2022-12-06 13:55:09 +01:00
Eelco Dolstra
54906bc93c
Merge pull request #7382 from fricklerhandwerk/doc-automatic-uid
move documentation on `auto-allocate-uids` to options docs
2022-12-06 11:31:34 +01:00
Eelco Dolstra
484578d3f9
Tweak option descriptions 2022-12-06 10:30:36 +01:00
Théophane Hufschmitt
bfcf30f0ab
Merge pull request #7390 from Radvendii/fix-6383
check the store for input before failing (hopefully fix #6700)
2022-12-05 18:04:41 +01:00
Eelco Dolstra
a21d9523b9
Merge pull request #7401 from Mic92/cgroup-typo
getMaxCPU: fix cgroup path
2022-12-05 17:53:05 +01:00
Eelco Dolstra
a4642ca73e
Merge pull request #7392 from edolstra/revert-7251
Revert "docs: drop shell prompt character for consistency"
2022-12-05 17:51:13 +01:00
Taeer Bar-Yam
e4f9f3bf24 check the store for input before failing (hopefully fix #6700) 2022-12-05 11:27:47 -05:00
Eelco Dolstra
14c3d76048
Merge pull request #7329 from fricklerhandwerk/maintainers
add maintainers' handbook
2022-12-05 17:21:36 +01:00
Eelco Dolstra
647e60b356
maintainers/README.md: Use CET 2022-12-05 16:35:25 +01:00
Eelco Dolstra
67d76cb8df
Fix typo 2022-12-05 16:34:39 +01:00
Théophane Hufschmitt
3b05124682
Merge pull request #7277 from fricklerhandwerk/codeowners
add CODEOWNERS
2022-12-05 14:58:50 +01:00
Jörg Thalheim
cccd57c022 getMaxCPU: fix cgroup path
Given this typo I am not sure if it has been tested.
2022-12-04 18:22:12 +01:00
Eelco Dolstra
b4b13382f4
Merge pull request #7387 from fricklerhandwerk/upvote-convention
encourage adding 👍 to express interest
2022-12-02 20:13:24 +01:00
Eelco Dolstra
c582150360
Merge pull request #7394 from edolstra/fix-7268
Lower verbosity of exceptions in getMaxCPU()
2022-12-02 17:02:32 +01:00
Eelco Dolstra
3a8341f57e
Merge pull request #7395 from obsidiansystems/evaluating-to-calling
Change "while evaluating <fun>" to "while *calling*" in trace
2022-12-02 15:53:57 +01:00
John Ericson
19c5394971 Change "while evaluating <fun>" to "while *calling*" in trace
The old way was not correct.

Here is an example:
```
 $ nix-instantiate --eval --expr 'let x = a: throw "asdf"; in x 1' --show-trace
error: asdf

       … while evaluating 'x'

       at «string»:1:9:

            1| let x = a: throw "asdf"; in x 1
             |         ^

       … from call site

       at «string»:1:29:

            1| let x = a: throw "asdf"; in x 1
             |                             ^
```
and yet also:
```
 $ nix-instantiate --eval --expr 'let x = a: throw "asdf"; in x' --show-trace
<LAMBDA>
```

Here is the thing: in both cases we are evaluating `x`!

Nix is a higher-order languages, and functions are a sort of value. When
we write `x = a: ...`, `a: ...` is the expression that `x` is being
defined to be, and that is already a value. Therefore, we should *never*
get an trace that says "while evaluating `x`", because evaluating `a:
...` is *trival* and nothing happens during it!

What is actually happening here is we are applying `x` and evaluating
its *body* with arguments substituted for parameters. I think the
simplest way to say is just "while *calling* `x`", and so that is what I
changed it to.
2022-12-02 09:14:12 -05:00
Eelco Dolstra
fa99ef6a87 getMaxCPU(): Lower verbosity level for ignored exceptions
Fixes #7268.
2022-12-02 15:03:40 +01:00
Valentin Gagarin
0ce5742bec
Merge pull request #7381 from aakropotkin/doc-ltoa-conflicts
doc: listToAttrs: document repeated keys
2022-12-02 14:19:34 +01:00
Eelco Dolstra
1e6a5d1ff6 Clean up cgroup handling in getMaxCPU()
Also, don't assume in LocalDerivationGoal that cgroups are mounted on
/sys/fs/cgroup.
2022-12-02 12:59:13 +01:00
Eelco Dolstra
1211e59a03 Move cgroup.{cc,hh} to libutil 2022-12-02 12:38:03 +01:00
Eelco Dolstra
ac06c8d248 Revert "docs: drop shell prompt character for consistency"
This reverts commit c068cce107 because
it makes the docs *less* consistent.
2022-12-02 11:56:12 +01:00
Valentin Gagarin
ca42068bdc
Merge pull request #7251 from RelationalAI-oss/sp-docs-uninstall-prompt
docs: drop shell prompt character for consistency
2022-12-01 19:24:09 +01:00
Valentin Gagarin
5b95412328 encourage adding 👍 to express interest
decided on the @NixOS/documentation-team, see NixOS/nix.dev#359 for more information
2022-12-01 19:04:04 +01:00
Alex Ameen
ef524013aa doc: listToAttrs: add extra whitespace 2022-12-01 10:32:45 -06:00
Eelco Dolstra
7bba4b343b
Merge pull request #7386 from edolstra/fix-json
Really fix 'nix store make-content-addressed --json'
2022-12-01 17:05:18 +01:00
Eelco Dolstra
f1e1ba9fe0 Really fix 'nix store make-content-addressed --json'
https://hydra.nixos.org/log/mcgypcf9vj4n8vdmw7lj3l05c899v73w-nix-2.12.0pre20221201_16b03f0-x86_64-unknown-linux-musl.drv
2022-12-01 16:29:09 +01:00
Alex Ameen
ec18b7d09b doc: listToAttrs: fix line wrapping 2022-11-30 23:21:09 -06:00
Alex Ameen
ad46726546 doc: listToAttrs: document repeated keys 2022-11-30 22:53:41 -06:00
Valentin Gagarin
0ea62670ed move documentation on auto-allocate-uids to options docs
this is where it belongs and can be found together with the other
options.
2022-12-01 04:40:02 +01:00
Valentin Gagarin
16b03f03af
Merge pull request #7375 from NixOS/formatting-nitpick
add missing newline, for consistent formatting
2022-12-01 01:58:49 +01:00
Valentin Gagarin
3f881e3378
add missing newline, for consistent formatting 2022-11-30 23:40:53 +01:00
Eelco Dolstra
f91dc023f2
Merge pull request #7372 from edolstra/fix-json
nix store make-content-addressed: Fix JSON construction
2022-11-30 14:25:15 +01:00
Eelco Dolstra
0b092bd87f nix store make-content-addressed: Fix JSON construction
Fixes

  error: [json.exception.type_error.301] cannot create object from initializer list

in tests/fetchClosure.sh.
2022-11-30 13:46:33 +01:00
Théophane Hufschmitt
0596bdf3a9
Merge pull request #7342 from fricklerhandwerk/refactor-generate-builtins
refactor rendering documentation of builtins
2022-11-29 15:55:43 +01:00
Eelco Dolstra
fbc53e97ed
Merge pull request #3600 from NixOS/auto-uid-allocation
Automatic UID allocation
2022-11-29 14:01:42 +01:00