1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-11 04:56:01 +01:00
Commit graph

21542 commits

Author SHA1 Message Date
Eelco Dolstra
09d46ad93a Don't use 'callback' object that we may have moved out of 2025-05-24 00:46:37 +02:00
Eelco Dolstra
c66eb9cef7 Add test 2025-05-24 00:40:06 +02:00
Eelco Dolstra
d877b0c0cc fromStructuredAttrs(): Don't crash if exportReferencesGraph is a string
Fixes

  error: [json.exception.type_error.302] type must be array, but is string

and other crashes.

Fixes #13254.
2025-05-24 00:17:03 +02:00
Eelco Dolstra
fa6e10ea6a Don't use 'callback' object that we may have moved out of 2025-05-24 00:14:03 +02:00
gustavderdrache
61c3efb4f4 Make platform checks throw BuildError like other failures 2025-05-23 17:40:02 -04:00
Jörg Thalheim
81884c36a3
Merge pull request #13248 from xokdvium/logger-exceptions
libmain: Catch logger exceptions in `handleExceptions`
2025-05-23 15:26:13 +02:00
Jörg Thalheim
2d20cd8085
Merge pull request #13253 from xokdvium/pkgconf-c
export/meson: Don't require `-std=c++2a` for -c libraries in `.pc` files
2025-05-23 15:17:32 +02:00
Sergei Zimmerman
d8da8f0cd6
export/meson: Don't require -std=c++2a for -c libraries in .pc files 2025-05-23 12:06:59 +00:00
Jörg Thalheim
4cc312a6e1
Merge pull request #13251 from Mic92/json-log-path
Add `json-log-path` setting (revisted)
2025-05-23 11:25:40 +02:00
Jörg Thalheim
7cef4559fe util/json-log-path: document unix sockets and concurrency issues 2025-05-23 10:45:12 +02:00
Eelco Dolstra
7240fb198f Add json-log-path setting
This setting specifies a path (which can be a regular file or Unix
domain socket) that receives a copy of all Nix log messages (in JSON
format).
2025-05-23 10:45:12 +02:00
Eelco Dolstra
0087188d47 Add convenience function for connecting to a Unix domain socket 2025-05-23 10:45:12 +02:00
Jörg Thalheim
906cc88f4e
Merge pull request #13220 from xokdvium/flamegraph
Stack sampling flamegraph profiler
2025-05-23 10:42:49 +02:00
Jörg Thalheim
5b4806ab3c
Merge pull request #13249 from NixOS/more-robust-json-logger
Make the JSON logger more robust
2025-05-23 10:25:16 +02:00
Jörg Thalheim
76358748da
Merge pull request #13143 from jfly/issue-8034-nix-fmt
Expose flake directory to `nix fmt` as `PRJ_ROOT` env var
2025-05-23 10:24:26 +02:00
Eelco Dolstra
9f680874c5 Make the JSON logger more robust
We now ignore connection / write errors.
2025-05-23 03:27:57 +02:00
Graham Christensen
8cd9eb86ad
Merge pull request #71 from DeterminateSystems/release-v3.6.0/97cc9af4-6a23-49f0-a8e9-190390c2f020
Release v3.6.0
2025-05-22 23:43:13 +00:00
Graham Christensen
486fca34bc
Apply suggestions from code review 2025-05-22 19:36:08 -04:00
github-actions[bot]
e5e7c2797c
Generare release notes for 3.6.0 2025-05-22 23:29:04 +00:00
github-actions[bot]
a43997cce4
Set .version-determinate to 3.6.0 2025-05-22 23:28:59 +00:00
github-actions[bot]
90cb816511
Prepare release v3.6.0 2025-05-22 23:28:56 +00:00
Sergei Zimmerman
90d1ff4805
libmain: Catch logger exceptions in handleExceptions
Avoid std::terminate in case logging code also
throws.
2025-05-22 23:08:59 +00:00
Graham Christensen
f9967792c7
Merge pull request #70 from DeterminateSystems/gustavderdrache/trace-ifd
Emit warnings when using import-from-derivation by setting the `trace-import-from-derivation` option to `true`
2025-05-22 22:54:07 +00:00
gustavderdrache
0b66fd3c34 Update src/libexpr/include/nix/expr/eval-settings.hh
Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
2025-05-22 17:30:14 -04:00
gustavderdrache
4355b7cbd5 Add test for output warning to ensure stability 2025-05-22 17:30:14 -04:00
gustavderdrache
8825cd56b5 Log warnings on IFD with new option 2025-05-22 17:30:14 -04:00
Cole Helbling
ea2f882fb1
Merge pull request #67 from DeterminateSystems/sync-2.29
Sync with upstream 2.29.0
2025-05-22 20:10:11 +00:00
Jeremy Fleischman
17eb2e8400 Expose flake directory to nix fmt as PRJ_ROOT env var
This was discussed in https://github.com/NixOS/nix/issues/8034. I
personally like `PRJ_ROOT`, which hopefully avoids some ambiguity
around with subflakes.

I only implemented this for `nix fmt` because it doesn't let you point
at a flake not on your filesystem.

macOS compilation fixes
2025-05-22 19:18:53 +02:00
Jörg Thalheim
b4bea57667
Merge pull request #13241 from fzakaria/lix-2100
cherry-pick https://gerrit.lix.systems/c/lix/+/2100
2025-05-22 18:56:40 +02:00
Eelco Dolstra
1246506152 Tagging release 2.29.0
-----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCAAxFiEEtUHVUwEnDgvPFcpdgXC0cm1xmN4FAmgvHQQTHGVkb2xzdHJh
 QGdtYWlsLmNvbQAKCRCBcLRybXGY3qVRCACZ22QWsHqvn6EEROSoSLbAH9/LqLOQ
 jvDzVQ3jk+2LznLt+grfaiTP69nL4SmzMjjeRQxGCnKnDNfHyPkxv5ddRJjX0SCA
 A89m6Fctas5frtbhmKDnLBx3lwKEFS0sq2qEp4uYUb9hU1gaByaLUbGcUUXQ2P3c
 fD1lm0uK/Z9IXY4h3/pyfp7tacYynuO+5E8F1C7T81hc/fA8EUBj6Yof1Ykx/Hg5
 Qj+iQ6y1i94XU4Y3SJYy8mjmILdsYNj+ICQ0IYQuWEARTiGZqLfo2uGtSroR5hLy
 PqYpqp9whQOpb7PyoQ28A0Gzc43O/MgpHnZO+KjV07SFXeqDnoWdltse
 =GWRg
 -----END PGP SIGNATURE-----

Merge tag '2.29.0' into sync-2.29

Tagging release 2.29.0
2025-05-22 14:53:09 +02:00
Eelco Dolstra
c4813b8cbc Bump version 2025-05-22 14:48:51 +02:00
Sergei Zimmerman
2190bf2006
doc: Add eval-profiler documentation and release note 2025-05-21 22:16:31 +00:00
John Ericson
76a4d4c291
Merge pull request #13186 from obsidiansystems/dyn-drv-without-new-goal-type
Restore dynamic derivations!
2025-05-21 18:11:32 -04:00
John Ericson
57348b677b Restore dynamic derivations!
This method does *not* create a new type of goal. We instead just make
`DerivationGoal` more sophisticated, which is much easier to do now that
`DerivationBuildingGoal` has been split from it (and so many fields are
gone, or or local variables instead).

This avoids the need for a secondarily trampoline goal that interacted
poorly with `addWantedOutputs`. That, I hope, will mean the bugs from
before do not reappear.

There may in fact be a reason to introduce such a trampoline in the
future, but it would only happen in conjunction with getting rid of
`addWantedOutputs`.

Restores the functionality (and tests) that was reverted in
f4f28cdd0e.
2025-05-21 17:31:41 -04:00
John Ericson
bf5d544d3b
Merge pull request #13181 from obsidiansystems/derivation-building-goal
Split `DerivationGoal` in two
2025-05-21 16:44:16 -04:00
Sergei Zimmerman
33141cd133
tests/functional: Add tests for flamegraph profiler
The tests are mostly based on existing `function-trace.sh`
with some tests for corner cases.
2025-05-21 20:15:22 +00:00
Sergei Zimmerman
5e74c0e4d6
libexpr: Add SampleStack stack-sampling profiler
This patch adds support for a native stack sampling
profiler to the evaluator, which saves a collapsed stack
profile information to a configurable location.

Introduced options (in `EvalSettings`):

- `eval-profile-file` - path to the collected profile file.
- `eval-profiler-frequency` - sampling frequency.
- `eval-profiler` - enumeration option for enabling the profiler.

  Currently only `flamegraph` is supported, but having this an
  enumeration rather than a boolean switch leaves the door open
  for other profiler variants (e.g. tracy).

Profile includes the following information on best-effort basis (e.g. some lambdas might
have an undefined name). Callstack information contains:

- Call site location (where the function gets called).
- Primop/lambda name of the function being called.
- Functors/partial applications don't have a name attached to them unlike special-cased primops and lambads.

For cases where callsite location isn't available we have to resort to providing
the location where the lambda itself is defined. This removes some of the confusing
`«none»:0` locations in the profile from previous attempts.

Example usage with piping directly into zstd for compression:

```
nix eval --no-eval-cache nixpkgs#nixosTests.gnome \
  --eval-profiler flamegraph \
  --eval-profile-file >(zstd -of nix.profile.zstd)
```

Co-authored-by: Jörg Thalheim <joerg@thalheim.io>
2025-05-21 20:15:19 +00:00
Stefan Boca
b9ed3ae36e
nix-profile{,-daemon}.fish: fix do not source twice
Commit b36637c8f7 set
`__ETC_PROFILE_NIX_SOURCED` globally, but this is not enough to prevent
the script from being run again by child shells, because the
variable was not exported and thus not inherited by any child process.
Exporting the variable also agrees with the bash scripts.

Notably, the old behavior broke `nix develop -c fish` in some cases,
because the profile bin directory got prepended to the path, causing
binaries from the profile to override binareis from the devshell.
2025-05-21 11:29:47 -07:00
Farid Zakaria
6c85a90b87 Change to atomic<uint32_t> 2025-05-21 10:07:04 -07:00
Farid Zakaria
8fd15ac228 Add canon for path 2025-05-21 10:05:23 -07:00
Farid Zakaria
9e26549c2b Consolidate tempName and makeTempPath 2025-05-21 09:01:49 -07:00
Farid Zakaria
6aed9d877c cherry-pick https://gerrit.lix.systems/c/lix/+/2100
Cherry-pick https://gerrit.lix.systems/c/lix/+/2100

This change fixes a potential concurrency failure when accessing random
which is not thread safe.

Co-authored-by: Lily Ballard <lily@ballards.net>
2025-05-21 08:49:09 -07:00
Stefan Boca
f627b8c721
nix-profile{,-daemon}.fish: format with fish_indent 2025-05-20 22:11:39 -07:00
Eelco Dolstra
e22142e11a
Merge pull request #13224 from NixOS/nix-profile-add
Rename `nix profile install` to `nix profile add`
2025-05-20 20:15:31 +02:00
Eelco Dolstra
6d59fa03fd Add release note 2025-05-20 18:24:13 +02:00
John Ericson
3b617e471b Split DerivationGoal in two
This separation of concerns is generally good, but in particular sets up
for removing `addWantedOutputs` next.
2025-05-20 11:54:53 -04:00
John Ericson
d1295448e0 Copy files before split
Same technique as 6c2a7fdc49.
2025-05-20 11:54:52 -04:00
John Ericson
a6c5d56af7
Merge pull request #13177 from obsidiansystems/less-useDerivation
Remove `useDerivation`
2025-05-20 11:39:48 -04:00
Luc Perkins
a56ecb5302
Add logos 2025-05-20 10:20:14 -04:00
Eelco Dolstra
803c0086f3
Update src/nix/profile-add.md
Co-authored-by: Jörg Thalheim <Mic92@users.noreply.github.com>
2025-05-20 15:39:40 +02:00