1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-01 16:41:47 +02:00
Commit graph

12182 commits

Author SHA1 Message Date
John Ericson
20226c85bc
Merge pull request #13273 from NixOS/deprecate-structured-attrs-hack
Deprecate hacky way of making structured attrs
2025-05-28 13:40:23 -04:00
John Ericson
5e9744c331
Merge pull request #13287 from NixOS/fix-freebsd-build
Fix FreeBSD builds
2025-05-28 13:37:29 -04:00
John Ericson
7577d2d3ae Deprecate hacky way of making structured attrs
The method tested for in the previous commit is now deprecated.

Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
2025-05-28 12:59:04 -04:00
John Ericson
24f5d7a9c3 Fix warning when HAVE_EMBEDDED_SANDBOX_SHELL is not set
Clang doesn't like the double indent that is needed for the `if...else`
that is CPP'd away. Adding braces is fine in the `if...else...` case,
and fine as a naked block in the CPP'd away case, and properly-indented
both ways.
2025-05-28 12:49:13 -04:00
John Ericson
8d725fdcb0 Fix FreeBSD builds 2025-05-28 12:47:33 -04:00
Seth Flynn
d0a2323829
lockFlake(): Allow registry lookups for overridden inputs
Fixes #13144
2025-05-28 00:24:41 -04:00
Eelco Dolstra
6686b54077 Fix mingw build
https://hydra.nixos.org/build/298331457
2025-05-28 00:48:10 +02:00
John Ericson
625dce659a Prepare for FreeBSD sandboxing support
This is the utility changes from #9968, which were easier to rebase
first.

I (@Ericson2314) didn't write this code; I just rebased it.

Co-Authored-By: Artemis Tosini <me@artem.ist>
Co-Authored-By: Audrey Dutcher <audrey@rhelmot.io>
2025-05-27 14:54:50 -04:00
John Ericson
653a93ac0f
Merge pull request #13276 from NixOS/split-derivation-builder
Move platform-specific code out of `DerivationBuilder`
2025-05-27 13:39:02 -04:00
Eelco Dolstra
cf9d962086 Remove unused variable 2025-05-27 17:54:02 +02:00
Jörg Thalheim
f7c94cd908
Merge pull request #13278 from DeterminateSystems/gustavderdrache/system-builderror
Make platform checks throw BuildError like other failures
2025-05-27 16:39:55 +02:00
Jörg Thalheim
9ddac1b516
Merge pull request #13277 from zimbatm/flake-archive-no-check-sigs
nix flake archive: add --no-check-sigs option
2025-05-27 16:38:42 +02:00
Eelco Dolstra
f9fdf94e12 Fix macOS build 2025-05-27 15:25:51 +02:00
gustavderdrache
ce89c8c114 Log warnings on IFD with new option
Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
2025-05-27 09:18:51 -04:00
gustavderdrache
b04962b33b Make platform checks throw BuildError like other failures
Co-authored-by: Cole Helbling <cole.e.helbling@outlook.com>
2025-05-27 08:57:13 -04:00
Eelco Dolstra
352ca238a9 Move cgroup support 2025-05-27 14:06:32 +02:00
Eelco Dolstra
b27e684ca5 Inline initTmpDir() 2025-05-27 14:00:28 +02:00
Eelco Dolstra
774678b87f Get rid of tmpDirInSandbox variable 2025-05-27 14:00:21 +02:00
Eelco Dolstra
c9b55fa3f0 Move autoDelChroot 2025-05-27 14:00:16 +02:00
Eelco Dolstra
9e2151d839 Move seccomp code 2025-05-27 14:00:12 +02:00
Eelco Dolstra
b623fe8d14 Move doBind() 2025-05-27 14:00:07 +02:00
Eelco Dolstra
9f8f3968e3 Eliminate useChroot 2025-05-27 13:59:40 +02:00
Eelco Dolstra
67408807d8 Move pathsInChroot 2025-05-27 13:57:41 +02:00
Eelco Dolstra
5653bf5e0a DerivationBuilder: Move Linux/Darwin-specific code into subclasses 2025-05-27 13:42:22 +02:00
zimbatm
80a4293486 nix flake archive: add --no-check-sigs option
Allows to copy the archive to a remote host and not get

    error: cannot add path '/nix/store/01x2k4nlxcpyd85nnr0b9gm89rm8ff4x-source' because it lacks a signature by a trusted key
2025-05-27 10:05:21 +00:00
Eelco Dolstra
aaca9711fc DerivationBuilderImpl: Drop std::optional from derivationType
No point in computing this lazily, since it's pretty much the first
thing the DerivationBuilder does.
2025-05-27 09:04:29 +02:00
Eelco Dolstra
93ae95be83 Remove duplicate comments on DerivationBuilderImpl overriden methods
Having the exact same doc comments isn't very useful/maintainable.
2025-05-26 16:05:54 +02:00
Eelco Dolstra
69914e4b3c Remove buildUser from DerivationBuilder
The use of a `buildUser` is an implementation detail of some types of
sandboxes that shouldn't exposed.
2025-05-26 16:05:35 +02:00
Eelco Dolstra
170f6021cf
Merge pull request #13265 from Mic92/fix-shallow-clone-subset
Improve errors when we are trying to access a git repository with partial history (+ fix fetchGit on these repos)
2025-05-26 14:53:08 +02:00
Jörg Thalheim
b1ccfaa080 git/revCount: improve error message when we have incomplete git history 2025-05-26 12:44:31 +02:00
Jörg Thalheim
0479db934c fetchGit: don't compute revCount on shallow repository
This can never work and leads to a crash bug.
2025-05-26 09:56:44 +02:00
Sergei Zimmerman
114de63d88
Fix various typos in source code
This only touches code comments, class names, documentation,
enumeration names and tests.
2025-05-25 20:14:11 +00:00
Sergei Zimmerman
9e97ecabb6
libexpr: Include derivation names in the call stack profile
This makes the profiler much more useful by actually distiguishing
different derivations being evaluated. This does make the implementation
a bit more convoluted, but I think it's worth it.
2025-05-25 15:53:01 +00:00
Sergei Zimmerman
a76c76a9d5
libexpr: Make getAttr a member function of EvalState 2025-05-25 15:52:58 +00:00
Sergei Zimmerman
128750225d
libexpr: Pass mutable EvalState to EvalProfiler
Sometimes the profiler might want to do evaluation (e.g. for getting
derivation names). This is not ideal, but is really necessary
to make the profiler stack traces useful for end users.
2025-05-25 15:52:56 +00: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
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
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
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
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
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