1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-26 11:41:15 +02:00
Commit graph

20067 commits

Author SHA1 Message Date
Jörg Thalheim
a8217f2642 use createDirs consistently everywhere 2025-03-27 11:28:11 +01:00
Jörg Thalheim
86de15f4fc git-utils: add trace context to writeFull 2025-03-27 11:26:30 +01:00
Jörg Thalheim
5c3682d7a1 libstore/daemon: make sure monitor is not considered "unused" 2025-03-27 11:24:30 +01:00
Jörg Thalheim
b050db951b test/ca-fd-leak: fix clang-tidy lints 2025-03-27 11:24:28 +01:00
Jörg Thalheim
7e540059a3 git/getStringUntil: fix uninitialized stack variable
at least clang-tidy is not convinced that this initialized.
If this is not the case, the impact should be small and hopefully also
more robust if changed.
2025-03-27 11:24:27 +01:00
Jörg Thalheim
05082ea1c5 libstore/local-store: fix linting warning about unused variable 2025-03-27 11:24:25 +01:00
Uluc Sengil
fcf5966488 skip ifds in nix flake show instead of throwing 2025-03-27 11:16:35 +01:00
Robert Hensing
6fc9651d57 nix-expr: remove EvalSettings::addPrimOp, add const
Not required for a struct and potentially confusing.
2025-03-26 19:22:40 +00:00
Robert Hensing
6309bbb426
Merge pull request #12760 from Prince213/docs-unsafeGetAttrPos
docs: document unsafeGetAttrPos
2025-03-26 13:04:13 +00:00
Robert Hensing
d48101109d nix-flake: Move primops registration to configureEvalSettings 2025-03-26 11:15:02 +00:00
Robert Hensing
6a192ec0cd C API: (breaking) remove nix-flake-c global init 2025-03-26 11:15:02 +00:00
Sizhe Zhao
39ce478283
docs: document unsafeGetAttrPos 2025-03-26 18:48:57 +08:00
Robert Hensing
3c4c0953e0 nix-expr: Add primops to EvalSettings 2025-03-26 09:32:43 +00:00
Robert Hensing
1cffcd91a9 libutil: Fix error message
I encountered this with a misconfigured libutil. I doubt that a
non-lutimes config is viable, because tests were failing.
2025-03-26 09:16:27 +00:00
mergify[bot]
9b0f455609
Merge pull request #12105 from trofi/local-derivation-goal-better-reference-bug
local-derivation-goal: improve "illegal reference" error
2025-03-25 14:54:27 +00:00
Sergei Trofimovich
4d72e0f73b tests/functional/check-refs.nix: format newly added test 2025-03-25 06:12:19 +00:00
Sergei Trofimovich
1e7c7244cf tests/functional/check-refs.sh: guard test12 against too old nix daemon
Otherwise without the change the test fails on nix-2.26 as:

    error: derivation contains an illegal reference specifier 'dev'

Note: the error message does not match intended change.
2025-03-25 06:12:19 +00:00
Robert Hensing
f4def47c89 test illegal reference specifier error message 2025-03-25 06:12:19 +00:00
Robert Hensing
2b4d461c14 checkRefs: use concatMapStringsSep 2025-03-25 06:12:19 +00:00
Robert Hensing
32898dc46a nix-util: Use small_vector in concatMapStringsSep 2025-03-25 06:12:19 +00:00
Robert Hensing
f3dbaa3f54 nix-util: Add concatMapStrings 2025-03-25 06:12:19 +00:00
Sergei Trofimovich
bbdc3197a9 local-derivation-goal: improve "illegal reference" error
Before the change "illegal reference" was hard to interpret as it did
not mention what derivation actually hits it.

Today's `nixpkgs` example:

Before the change:

    $ nix build --no-link -f. postgresql_14
    ...
    error: derivation contains an illegal reference specifier 'man'

After the change:

    $ nix build --no-link -f. postgresql_14
    ...
    error: derivation '/nix/store/bxp6g57limvwiga61vdlyvhy7i8rp6wd-postgresql-14.15.drv' output check for 'lib' contains an illegal reference specifier 'man', expected store path or output name (one of [debug, dev, doc, lib, out])
2025-03-25 06:12:19 +00:00
mergify[bot]
5a4e306cc5
Merge pull request #12747 from obsidiansystems/more-goal-waitForAWhile
Use `Goal::waitForAWhile` in a few more places
2025-03-24 17:28:20 +00:00
mergify[bot]
07321575ca
Merge pull request #12716 from Mic92/fix-script
tests/functional: use script flags compatible with macOS
2025-03-24 16:51:27 +00:00
mergify[bot]
7da2e5ba6a
Merge pull request #12745 from obsidiansystems/append-log-tail-error-msg-type
`appendLogTailErrorMsg`: Take a "smaller" arugment
2025-03-24 16:05:32 +00:00
Las
3cb38e8ab9 Use Goal::waitForAWhile in a few more places 2025-03-24 11:46:55 -04:00
Jörg Thalheim
f02c57dbfa tests/functional: use script flags compatible with macOS
Co-authored-by: John Ericson <git@JohnEricson.me>
2025-03-24 16:38:20 +01:00
John Ericson
c121daf331 appendLogTailErrorMsg: Take a "smaller" arugment
We just need a `const Store &`, not a `Worker &`.
2025-03-24 11:24:16 -04:00
Robert Hensing
1988dc0c73
Merge pull request #12734 from Mic92/doc-fix
packaging/everything.nix: make sure doc and manpage outputs are symlinks
2025-03-24 13:08:46 +00:00
Jörg Thalheim
ebcb13842b
Merge pull request #12736 from Mic92/monitor-fd-hup
`MonitorFdHup::~MonitorFdHup`: use proper close method instead of lib…
2025-03-24 13:15:27 +01:00
Jörg Thalheim
87a34a45ff MonitorFdHup::~MonitorFdHup: use proper close method instead of libc close()
Otherwise closing it again will cause an EBADF in the AutoCloseFd class.
2025-03-24 12:09:54 +01:00
Kirens
15dfeb9182 make sure doc and manpage outputs are symlinks
Part of https://github.com/NixOS/nixpkgs/pull/392549
The doc and manpage fix already happend in 0ddfbc5939
2025-03-24 09:30:28 +01:00
John Ericson
ff17dd2a9a
Merge pull request #12730 from xokdvium/repl-shell-env
libcmd/repl: Fix missing runNix in repl
2025-03-23 23:53:26 -04:00
Jörg Thalheim
648c095da5
Merge pull request #12714 from picnoir/pic/monitorhup-fix-pthread-cancellation
MonitorFdHup: replace pthread_cancel trick with a notification pipe
2025-03-24 00:53:34 +01:00
John Ericson
49f486d8e0 MonitorFdHup: Don't sleep anymore
After the previous commit it should not be necessary. Furthermore, if we
*do* sleep, we'll exacerbate a race condition (in conjunction with
getting rid of the thread cancellation) that will cause test failures.
2025-03-23 19:15:27 -04:00
Jade Lovelace
9b3352c3c8 daemon: remove workaround for macOS kernel bug that seems fixed
This was filed as https://github.com/nixos/nix/issues/7584, but as far
as I can tell, the previous solution of POLLHUP works just fine on macOS
14. I've also tested on an ancient machine with macOS 10.15.7, which
also has POLLHUP work correctly.

It's possible this might regress some older versions of macOS that have
a kernel bug, but I went looking through the history on the sources and
didn't find anything that looked terribly convincingly like a bug fix
between 2020 and today. If such a broken version exists, it seems pretty
reasonable to suggest simply updating the OS.

Change-Id: I178a038baa000f927ea2cbc4587d69d8ab786843

Based off of commit 69e2ee5b25752ba5fd8644cef56fb9d627ca4a64. Ericson2314 added
additional other information.
2025-03-23 19:05:45 -04:00
Félix Baylac Jacqué
1c636284a3 MonitorFdHup: replace pthread_cancel trick with a notification pipe
On https://github.com/NixOS/nix/issues/8946, we faced a surprising
behaviour wrt. exception when using pthread_cancel. In a nutshell when
a thread is inside a catch block and it's getting pthread_cancel by
another one, then the original exception is bubbled up and crashes the
process.

We now poll on the notification pipe from the thread and exit when the
main thread closes its end. This solution does not exhibit surprising
behaviour wrt. exceptions.

Co-authored-by: Mic92 <joerg@thalheim.io>

Fixes https://github.com/NixOS/nix/issues/8946

See also Lix https://gerrit.lix.systems/c/lix/+/1605 which is very
similar by coincidence. Pulled a comment from that.
2025-03-23 18:34:52 -04:00
John Ericson
cb95791198 MonitorFdHup: introduce a num_fds variable
Better than just putting `1` in multiple spots.
2025-03-23 18:23:07 -04:00
John Ericson
d028bb4c4a MonitorFdHup: Cleanup a bit with designated initializers 2025-03-23 18:23:07 -04:00
Jörg Thalheim
8e0bc2c3a8 MonitorFdHup: raise explicit SysError rather unreachable
Syscalls can fail for many reasons and we don't want to loose the errno
and error context.
2025-03-23 18:22:48 -04:00
Sergei Zimmerman
d371aadb2b
tests/functional: Add regression test for broken :sh in repl
Can't really test `:u` because it needs <nixpkgs>.
2025-03-23 22:13:40 +00:00
Sergei Zimmerman
44055dc09d
libcmd/repl: Fix missing runNix in repl
Without this :u, :sh and :i repl commands fail with:

> Cannot run 'nix-shell'/`nix-env` because no method of calling the Nix
> CLI was provided. This is a configuration problem pertaining to how
> this program was built.

Remove the default ctor argument as it evidently makes catching
refactoring bugs much harder. `NixRepl` implementation lives completely
in `repl.cc`, so we can be as explicit as necessary.
2025-03-23 22:13:14 +00:00
Sergei Zimmerman
8066e4b0c3
libcmd/repl: Make AbstractNixRepl::create respect its store argument
The only reference (according to clangd) to this function also uses `openStore`,
so this is a no-op.
2025-03-23 22:10:43 +00:00
John Ericson
041394b741 monitor-fd.hh: Format
It's a pretty small diff, so let's just start formatting before we make
other changes.
2025-03-23 18:00:36 -04:00
Robert Hensing
bfc05d2e3b
Merge pull request #12723 from xokdvium/fix-man-doc-outputs
packaging/everything.nix: Fix doc and man outputs
2025-03-23 11:53:13 +00:00
Sergei Zimmerman
0ddfbc5939
packaging/everything.nix: Fix doc and man outputs
We want the $doc, $man outputs to be symlinks pointing to nix-manual and
nix-manual.man. Creating the directories first makes the `ln` command
produce symlink $doc/${nix-manual} instead.

```
$file /nix/store/q4dwlnd36gpfajgfcp6hca2xwy068wjq-nix-2.27.1-man/rwh8ky3k040wyrywl8k2v5b3csdfbdg7-nix-manual-2.27.1-man

/nix/store/q4dwlnd36gpfajgfcp6hca2xwy068wjq-nix-2.27.1-man/rwh8ky3k040wyrywl8k2v5b3csdfbdg7-nix-manual-2.27.1-man:
  symbolic link to /nix/store/rwh8ky3k040wyrywl8k2v5b3csdfbdg7-nix-manual-2.27.1-man
```

This is the reason `nix-env --help` is once again broken on 2.26/2.27/master
after 4108529.
2025-03-22 12:16:47 +00:00
Eelco Dolstra
d975d32d67
Merge pull request #12719 from NixOS/fix-links
rl-2.27.md: Fix GitHub links
2025-03-21 20:48:06 +01:00
Eelco Dolstra
be5a455a1a rl-2.27.md: Fix GitHub links
https://discourse.nixos.org/t/nix-2-27-0-released/62003/2?u=edolstra
2025-03-21 20:23:46 +01:00
Eelco Dolstra
cb66d3eea9
Merge pull request #12718 from NixOS/bump-2.28.0
Bump version
2025-03-21 20:10:24 +01:00
Eelco Dolstra
a1f05dc669 Bump version 2025-03-21 19:32:21 +01:00