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

21862 commits

Author SHA1 Message Date
John Ericson
c893454926 Fixup issues with bytes 2025-11-06 13:56:15 -05:00
John Ericson
b41ce0d263 Revert "Use the hash modulo in the derivation outputs"
Fix #11897

As described in the issue, this makes for a simpler and much more
intuitive notion of a realisation key. This is better for pedagogy, and
interoperability between more tools.

The way the issue was written was that we would switch to only having
shallow realisations first, and then do this. But going to only shallow
realisations is more complex change, and it turns out we weren't even
testing for the benefits that derivation hashes (modulo FODs) provided
in the deep realisation case, so I now just want to do this first.

Doing this gets the binary cache data structures in order, which will
unblock the Hydra fixed-output-derivation tracking work. I don't want to
delay that work while I figure out the changes needed for
shallow-realisations only.

This reverts commit bab1cda0e6.
2025-11-06 13:56:15 -05:00
John Ericson
f392663533 Remove dependent realisations
This progress on #11896. It introduces some issues temporarily which
will be fixed when #11928 is fixed.
2025-11-06 13:56:15 -05:00
John Ericson
f7dcfd1072 JSON impl for DummyStore 2025-11-06 13:56:15 -05:00
John Ericson
12760756bb nlohmann::json instance and JSON Schema for MemorySourceAccessor
As documented, this for file system objects themselves, since
`MemorySourceAccessor` is an implementation detail.
2025-11-06 13:55:46 -05:00
John Ericson
8026dd1ba4 JSON alongside proto serialization test data
This makes the proto serializer characterisation test data be
accompanied by JSON data. This is useful because the JSON data is
human-readable while the binary data is not.
2025-11-06 13:55:19 -05:00
John Ericson
8dfab7c2dd Rework ValidPathInfo, NarInfo JSON instances
Progress on #13570.

If we depend on the store dir, our JSON serializers/deserializers take
extra arguements, and that interfaces with the likes of various
frameworks for associating these with types (e.g. nlohmann in C++, Serde
in Rust, and Aeson in Haskell).
2025-11-06 13:55:19 -05:00
John Ericson
147e183c68
Merge pull request #14426 from obsidiansystems/json-schema-build-result
JSON Impl and schema for BuildResult
2025-11-06 18:40:35 +00:00
Eelco Dolstra
52b2909fd2
Merge pull request #14491 from NixOS/fix-14311
Don't crash on flakerefs containing newlines
2025-11-06 18:29:44 +00:00
Jörg Thalheim
34c77ffe38
Merge pull request #14471 from obsidiansystems/derivation-options-json-test
FIx `DerivationOptions` JSON and clean up unit tests
2025-11-06 18:21:15 +00:00
John Ericson
af8e44821e
Merge pull request #14490 from obsidiansystems/derivation-builder-no-inputs
`DerivationBuilderParams` have reference to `BasicDerivation`
2025-11-06 18:15:56 +00:00
Jörg Thalheim
70fbd1cdf4
Merge pull request #14465 from obsidiansystems/split-realisation-protocol-tests
Split realisation protocol unit tests
2025-11-06 18:14:25 +00:00
Jörg Thalheim
daace78239
Merge pull request #14425 from obsidiansystems/json-schema-build-trace
JSON Schema for build trace entry
2025-11-06 18:06:57 +00:00
Sergei Zimmerman
d596b9754e
Merge pull request #14472 from Radvendii/exprs-alloc
libexpr: allocate the Exprs themselves in Exprs::alloc
2025-11-06 17:29:09 +00:00
Eelco Dolstra
c1317017e9 Don't crash on flakerefs containing newlines
Fixes #14311.
2025-11-06 13:06:38 +01:00
Jörg Thalheim
3f18cad5f1
Merge pull request #14459 from jfroche/fix/macos-ipcs
Fix macOS IPC cleanup in builder
2025-11-06 09:31:53 +00:00
Jörg Thalheim
41b62aa979
Merge pull request #14445 from CyberShadow/nix-flake-check-log-success
nix flake check: log success in verbose mode
2025-11-06 09:30:55 +00:00
Jörg Thalheim
af41eccb31
Merge pull request #14469 from roberth/doc-check-link-fragments
Manual: fix and check link fragments
2025-11-06 09:27:19 +00:00
John Ericson
e7b274f85a DerivationBuilderParams have reference to BasicDerivation
Have one to that instead of one to `Derivation`. `DerivationBuilder`
doesn't need `inputDrvs`, so `BasicDerivation` suffices.

(In fact, it doesn't need `inputSrcs` either, but we don't yet hve a
type to exclude that.)
2025-11-05 23:41:47 -05:00
John Ericson
6bd92d47e5
Merge pull request #14488 from Mic92/kaitai-struct
nix-kaitai-struct: make it not longer part of the devshell
2025-11-05 21:57:29 +00:00
Sergei Zimmerman
b5302fc111
Merge pull request #14487 from NixOS/git-show-progress
Git fetcher: Restore progress indication
2025-11-05 21:32:58 +00:00
Jörg Thalheim
724086005a nix-kaitai-struct: make it not longer part of the devshell
just now pulls in jdk in
2025-11-05 22:22:45 +01:00
Eelco Dolstra
038d74edf7 Git fetcher: Restore progress indication
We were calling git with `--quiet` in order not to mess up Nix's
progress bar. However, `runProgram()` already suspends the progress
bar (since git may be interactive) so that's no longer an issue. So we
can just run with `--progress` instead.
2025-11-05 21:59:07 +01:00
Eelco Dolstra
b177354c35
Merge pull request #14482 from NixOS/fix-nix-flake-check-crash-upstream
nix flake check: Remove incorrect assertion
2025-11-05 19:15:29 +00:00
John Ericson
2039235f6e
Merge pull request #14484 from NixOS/fix-typo
manual: Fix MathJax typo
2025-11-05 18:24:51 +00:00
John Ericson
0fd3b6fee6
Merge pull request #14483 from NixOS/purge-toRealPath
Relegate `toRealPath` to `LocalFSStore`
2025-11-05 17:20:36 +00:00
Taeer Bar-Yam
b2f0472fe2 parser.y: allocate Exprs in the allocator 2025-11-05 17:10:35 +01:00
John Ericson
91af29f37a manual: Fix MathJax typo
Thanks to @cafkafk for catching my mistake.
2025-11-05 11:08:36 -05:00
John Ericson
099af7578f Relegate toRealPath to LocalFSStore
Fix #14480

This method is not well-defined for arbitrary stores, which do not have
a notion of a "real path" -- it is only well-defined for local file
systems stores, which do have exactly that notion, and so it is moved to
that sub-interface instead.

Some call-sites had to be fixed up for this, but in all cases the
changes are positive. Using `getFSSourceAccessor` allows for more other
stores to work properly. `nix-channel` was straight-up wrong in the case
of redirected local stores. And the building logic with remote building
and a non-local store is also fixed, properly gating some deletions on
store type.

Co-authored-by: Robert Hensing <robert@roberthensing.nl>
2025-11-05 10:44:25 -05:00
John Ericson
948c89b367
Merge pull request #14481 from Radvendii/exprs-alloc-pre
parser.y: abstract `new` into a function on Exprs
2025-11-05 14:49:00 +00:00
Robert Hensing
7e84ce3904 ci/gha: Disable linkcheck on darwin
Does not reproduce all settings on darwin. (Pre-existing issue)

Build with `nix build .#nix-manual.tests.linkcheck`
2025-11-05 15:38:23 +01:00
Eelco Dolstra
a828cf777a nix flake check: Remove incorrect assertion
The assumption that no unknown paths can be returned is incorrect. It
can happen if a derivation has outputs that are substitutable, but
that have references that cannot be substituted (i.e. an incomplete
closure in the binary cache). This can easily happen with
magic-nix-cache.
2025-11-05 15:24:36 +01:00
Taeer Bar-Yam
687dd38998 parser.y: abstract new into a function on Exprs
so it can easily be swapped out for other implementations
2025-11-04 23:59:45 +01:00
Taeer Bar-Yam
62729ff472 parser.y: pass all of Exprs in, not just alloc 2025-11-04 23:59:45 +01:00
Jean-François Roche
0507674a13 Document the new cleanup function using a Doxygen-style comment 2025-11-04 20:57:40 +00:00
Jean-François Roche
4f85cfe824 fix(darwin): extend IPC cleanup to message queues and semaphores
Previously, only shared memory segments were cleaned up.
This could lead to leaked message queues and semaphore sets when builds use System V IPC, exhausting kernel IPC limits over time.

This commit extends the cleanup to all three System V IPC types:
1. Shared memory segments
2. Message queues
3. Semaphores

Additionally, we stop removing IPC objects during iteration, as it could corrupt the kernel's iterator state and cause some objects to be skipped. The new implementation uses a two-pass approach where we list first and then remove them in a separate pass.

The IPC IDs are now extracted during iteration using actual system calls (shmget, msgget, semget) rather than being looked up later, ensuring the objects exist when we capture their IDs.
2025-11-04 20:57:40 +00:00
Jean-François Roche
7d5567a8d7 Fix macOS IPC cleanup using sysctl: shared memory segments
In Linux, IPC objects are automatically cleaned up when the IPC namespace is destroyed.
On Darwin, since there are no IPC namespaces, the IPC objects may sometimes persist after the build user's processes are killed.

This patch modifies the cleanup logic to use sysctl calls to identify and remove left over shm segments associated with the build user.

Fixes: #12548
2025-11-04 20:57:40 +00:00
Sergei Zimmerman
3ed42cd354
Merge pull request #14474 from xokdvium/shut-up-ai-slop
.coderabbit.yaml: Kill chats
2025-11-04 19:57:07 +00:00
Sergei Zimmerman
4a888b4138
.coderabbit.yaml: Kill chats
Stops stupid spam on issues.
2025-11-04 22:55:18 +03:00
John Ericson
f2436a47bb
Merge pull request #14388 from NixOS/dependabot/github_actions/actions/upload-artifact-5
build(deps): bump actions/upload-artifact from 4 to 5
2025-11-04 18:14:06 +00:00
John Ericson
83ddfaebf4
Merge pull request #14389 from NixOS/dependabot/github_actions/actions/download-artifact-6
build(deps): bump actions/download-artifact from 5 to 6
2025-11-04 18:13:45 +00:00
John Ericson
2b382b171c
Merge pull request #14453 from Radvendii/exprwith-alloc
libexpr: shrink ExprWith by 8 bytes
2025-11-04 18:04:25 +00:00
John Ericson
b7553378a4
Merge pull request #14467 from NixOS/dependabot/github_actions/cachix/install-nix-action-31.8.2
build(deps): bump cachix/install-nix-action from 31.5.1 to 31.8.2
2025-11-04 18:03:44 +00:00
John Ericson
d40f66109b
Merge pull request #14462 from NixOS/parallel-revcount
GitRepo::getRevCount(): Compute revcount in parallel
2025-11-04 17:31:18 +00:00
Eelco Dolstra
9657feaf8c GitRepo::getRevCount(): Compute revcount in parallel
For repos with a lot of non-linearity in the commit graph (like
Nixpkgs), this speeds up getting the revcount a lot, e.g. `nix flake
metadata /path/to/nixpkgs?rev=9dc7035bbee85ffc740d893e02cb64460f11989f` went
from 9.1s to 3.7s.
2025-11-04 14:50:57 +01:00
John Ericson
d05e85e5be Fix DerivationOptions JSON implementation and test 2025-11-04 03:04:59 -05:00
John Ericson
9daef9cca2 Clean up DerivationOptions unit tests
We now test equality on whole strucks much more often, which avoids
forgetting to test for specific fields.
2025-11-04 02:48:16 -05:00
John Ericson
341c42f321
Merge pull request #14454 from Radvendii/exprconcatstrings-alloc
libexpr: move ExprConcatStrings data to Exprs::alloc
2025-11-04 04:21:16 +00:00
Taeer Bar-Yam
631fb6c9ad libexpr: move ExprConcatStrings data to Exprs::alloc
ExprConcatStrings no longer consumes the vector argument

Co-authored-by: John Ericson <git@JohnEricson.me>
2025-11-04 04:17:35 +01:00
Taeer Bar-Yam
11e19ee690 libexpr: shrink ExprWith by 8 bytes
Correct bound on prevWith

Co-authored-by: John Ericson <git@JohnEricson.me>
2025-11-04 04:16:20 +01:00