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

22234 commits

Author SHA1 Message Date
John Ericson
401e08f839 Fix mistake in the release note for derivations
Floating CA outputs just have a hash algorith, not a whole hash. It is
fixed ones which are a pair of a method and a hash, just like the `ca`
field of store object info.
2025-12-08 16:18:09 -05:00
John Ericson
14feb36cd6 Hash::parseSRI add explicit XP settings parameter
This will be used for unit testing.
2025-12-08 16:18:08 -05:00
John Ericson
907a5761fa
Merge pull request #14707 from obsidiansystems/store-dir-in-info
Make `storeDir` a part of `UnkeyedValidPathInfo`
2025-12-08 18:00:42 +00:00
Eelco Dolstra
a95580e468
Merge pull request #14723 from NixOS/peer-info
daemon.cc: Clean up PeerInfo by using std::optional
2025-12-08 17:57:31 +00:00
Eelco Dolstra
8c2027e138 authPeer(): Use std::optional instead of empty string 2025-12-08 12:57:19 +01:00
Eelco Dolstra
26bf932e41
Merge pull request #14731 from NixOS/fix-hydra-for-release
Fix failing hydra jobs for release
2025-12-08 11:18:55 +00:00
Eelco Dolstra
386d1d54bd
Merge pull request #14724 from obsidiansystems/derivation-options-test-file-names
Organize some test JSON better to prevent confusion
2025-12-08 11:17:55 +00:00
Eelco Dolstra
32bc0ac43e
Merge pull request #14720 from obsidiansystems/nix-hash-convert-improve-error
Improve wrong format message with `nix hash convert`
2025-12-08 11:17:07 +00:00
John Ericson
ffc5dffa65
Merge pull request #14732 from NixOS/optimize-nar-cat
nix nar {ls,cat}: Optimize, make nix nar cat work on pipes too
2025-12-08 06:08:02 +00:00
Sergei Zimmerman
c5c05e44b3
Make nix nar cat work on pipes too
This was lost after 2.32 while making the accessor lazy. We can restore the support
for it pretty easily. Also this is significant optimization for nix nar cat.
E.g. with a NAR of a linux repo this speeds up by ~3x:

Benchmark 1: nix nar cat /tmp/linux.nar README
  Time (mean ± σ):     737.2 ms ±   5.6 ms    [User: 298.1 ms, System: 435.7 ms]
  Range (min … max):   728.6 ms … 746.9 ms    10 runs

Benchmark 2: build/src/nix/nix nar cat /tmp/linux.nar README
  Time (mean ± σ):     253.5 ms ±   2.9 ms    [User: 56.4 ms, System: 196.3 ms]
  Range (min … max):   248.1 ms … 258.7 ms    12 runs
2025-12-08 03:26:03 +03:00
Sergei Zimmerman
b9b6defca6
nix nar {ls,cat}: Optimize
The whole NarAccessor -> listing -> lazy NarAccessor is very weird. Source
can now be seek-ed over when supported, so we can support it pretty easily.
Alternatively we could also make it single-pass very easily with a custom
FileSystemObjectSink. It will get removed in a follow-up commit anyway.
2025-12-08 03:26:02 +03:00
Sergei Zimmerman
22f993fab6
libutil: Get rid of TODO comments for O_CLOEXEC
By default windows doesn't allow inheriting handles anyway. These comments
are just confusing at this point.
2025-12-08 01:10:14 +03:00
Sergei Zimmerman
0302cd00c9
packaging/hydra: Don't build kaitai nar docs tests in hydra
It's not evaling on hydra currently and is only part of the docs. Support
for this it best effort at best so we should not build this in hydra, considering
the amount of effort required to support this. I would even consider dropping these
checks and component altogether, since there doesn't seem to be much interest in maintaining
these docs from the core team anyway.
2025-12-08 00:37:10 +03:00
Sergei Zimmerman
2f80fc473f
libexpr-tests: Work around LTO issue with SAMPLE_USER_DATA on i686-linux with sanitizers
This somehow fails https://hydra.nixos.org/build/315675349/nixlog/1. I don't know the exact
details, but it seems that something goes very wrong with LTO and sanitizers that lead to the
string literal to be moved? Instead of relying on the string literal deduplication to provide
a consistent address we can use a global. That should have a single address (modulo wonky copy
relocations).
2025-12-08 00:24:46 +03:00
Sergei Zimmerman
d4434809fe
tests/nixos/fethers-substitute: Fix for nix path-info --json-format 2 2025-12-07 22:59:22 +03:00
Sergei Zimmerman
1d56f413c2
Merge pull request #14728 from roberth/doc-evaluation-infinite-recursion
doc: Document "evaluation order", some strictness, equality quirk, `||`, `&&`
2025-12-07 19:06:51 +00:00
John Ericson
d8ad0006c0
Merge pull request #14729 from NixOS/fix-add-dep
Fix Non-virtual interface pattern for `RestrictedStore::addDependency`
2025-12-07 17:23:21 +00:00
John Ericson
4652345ac3 Fix Non-virtual interface pattern for RestrictedStore::addDependency
I didn't do things quite right in 496e43ec72:

- Forgot to remove the now-redundant `isAllowed` check.

- Called the non-virtual, not the superclass's impl, in
  `addDependencyPrep`, causing bad recursion / UB.

Doing this fixes a crash I encountered with manual testing an Nix Ninja
--- hopefully we will get Nix Ninja or similar in a NixOS test longer
term to defend against this thing happening again.
2025-12-07 11:33:41 -05:00
Robert Hensing
6fb5276e7b test: add tests for function equality behavior
Add tests for function equality covering both direct comparisons and
comparisons within composite types (lists and attribute sets).

Tests verify:
- Direct function comparisons always return false
- Value identity optimization in composite types allows identical
  functions to compare as equal when both references point to the
  same function value
2025-12-07 14:43:46 +01:00
Robert Hensing
97a60c1fab doc: Precedence aligns with disjunctive normal form 2025-12-07 14:10:16 +01:00
Robert Hensing
1039b6719b doc: Document "evaluation order", some strictness, equality quirk
Correct and clarify evaluation semantics including to help users
understand Nix language behavior without unnecessarily pinning down
the implementation.
2025-12-07 13:55:25 +01:00
John Ericson
42d7d9676d
Merge pull request #14727 from roberth/issue-14548
Make mdBook dependency optional (#14548), fix manpage links
2025-12-06 22:49:31 +00:00
Robert Hensing
ab0ca5f922 doc: make HTML manual build optional
Add `html-manual` Meson option to allow building manpages without the
HTML manual, removing the mdbook dependency for manpage-only builds.

Changes:
- Add `html-manual` Meson option (default: true)
- Make HTML manual build conditional in meson.build
- Add `buildHtmlManual` parameter to package.nix
- Conditional outputs: ["out" "man"] when enabled, ["out"] when disabled
- Make mdbook/rsync/json-schema-for-humans dependencies conditional
- Add `nix-manual-manpages-only` package variant

This allows systems that only need manpages to avoid the mdbook build
dependency while preserving full functionality for HTML manual builds.
2025-12-06 22:35:45 +01:00
Robert Hensing
cca8b5ca60 doc: make manpage URLs configurable based on release type
Add configurable documentation URLs that change based on whether this is
an official release or development build:

- Nix builds:
  - Development (officialRelease = false): Use /latest/ URLs
  - Official releases (officialRelease = true): Use versioned URLs with
    MAJOR.MINOR only (e.g., /2.33/ instead of /2.33.0/)
- Plain meson builds: Default to versioned URLs (official-release = true)

Changes:
- Add --doc-url parameter to expand-includes.py
- Add meson option 'official-release' (defaults to true for Meson builds)
- Compute doc_url in meson.build based on version and official-release
- Forward Nix officialRelease variable to Meson in package.nix
- Update render-manpage.sh to pass doc-url parameter

This allows distros (Fedora, etc.) to have stable versioned URLs by default,
while Nix development builds point to /latest/ for up-to-date documentation.
2025-12-06 22:13:19 +01:00
Robert Hensing
d007b4e81b doc: make manpage generation independent of mdbook
Add standalone markdown preprocessor to generate manpages without requiring
mdbook's Rust toolchain. This removes a significant build dependency for
manpage generation while keeping the HTML manual (mdbook) working unchanged.

Changes:
- Add expand-includes.py: Python 3 script that recursively expands
  {{#include}} directives, resolves @docroot@ to nix.dev URLs, and handles
  @generated@/ paths for build-generated files
- Update render-manpage.sh: Replace mdbook-based implementation with
  standalone version that uses expand-includes.py + lowdown
- Update meson.build: All 134 manpage targets now use standalone renderer
  with proper dependencies (expand-includes.py, experimental-features-shortlist)
- Fix nix-hash.md: Remove extra parenthesis in markdown link syntax

Benefits:
- No mdbook/Rust toolchain required for manpage builds
- Manpages contain nix.dev/latest URLs instead of broken relative paths
- Fixes bug where mdbook didn't expand experimental-features-shortlist.md
- 98.5% identical output to mdbook (2 files differ, both acceptable)

All 134 manpages (131 section 1, 2 section 5, 1 section 8) build successfully.
2025-12-06 21:34:44 +01:00
John Ericson
843629f7bf Organize some test JSON better to prevent confusion
It was not clear which of thes were JSON for derivation vs JSON for
derivation options.
2025-12-05 19:37:07 -05:00
John Ericson
525755dadc
Merge pull request #14722 from raboof/document-sembr
chore: document we use sembr in the docs
2025-12-06 00:03:17 +00:00
Eelco Dolstra
5d7f6efc82 daemon.cc: Clean up PeerInfo by using std::optional 2025-12-05 23:36:29 +01:00
Arnout Engelen
2bf3235115
chore: document we use sembr in the docs
https://github.com/NixOS/nix/pull/14557#issuecomment-3618664183
2025-12-05 23:17:13 +01:00
John Ericson
0db70b8184
Merge pull request #14711 from roberth/check-redirect-targets
Check and fix nix-manual redirect targets
2025-12-05 22:02:51 +00:00
John Ericson
b61885786d Improve wrong format message with nix hash convert
We have the machinery to make a more informative error, telling the
user what format was actually encountered, and not just that it is not
the format that was requested.
2025-12-05 15:12:08 -05:00
Robert Hensing
c8601a27df Fix redirects.json targets
Most of them were fixable.
The S3 ones were made available in c5ed22dd41.
2025-12-05 16:53:46 +01:00
Robert Hensing
d5099279f8 Remove _redirects from link checking for now
Since it is apparently not deployed correctly on nix.dev, we can't
meaningfully work with it now.
2025-12-05 16:53:46 +01:00
Robert Hensing
ee30827e20 Check nix-manual redirect targets in linkcheck
Augments the manual with a generated file before running the usual check.
2025-12-05 16:53:46 +01:00
Robert Hensing
3632abb7a5 nix-manual: Split out redirects.json 2025-12-05 16:53:46 +01:00
John Ericson
5f42e5ebb7
Merge pull request #14717 from NixOS/attr-path
Introduce AttrPath type
2025-12-05 15:51:09 +00:00
John Ericson
926092f67f
Merge pull request #14714 from NixOS/derived-path-operator
DerivedPath: Remove superfluous operator ==
2025-12-05 15:46:28 +00:00
Eelco Dolstra
20fc54c00d Introduce AttrPath type
This is basically an alias for std::vector<Symbol>.
2025-12-05 13:41:59 +01:00
Eelco Dolstra
294e68a3f6 Rename AttrPath -> AttrSelectionPath 2025-12-05 12:57:19 +01:00
Eelco Dolstra
92d4fafd53
Merge pull request #14713 from lovesegfault/fix-s3-docs
fix(libstore/s3-binary-cache-store): include documentation from markdown file
2025-12-05 11:38:25 +00:00
Eelco Dolstra
953e7b8af4 DerivedPath: Remove superfluous operator ==
This is already implied by the fact that it inherits from
std::variant.
2025-12-05 10:26:36 +01:00
Bernardo Meurer
c5ed22dd41
fix(libstore/s3-binary-cache-store): include documentation from markdown file
The S3BinaryCacheStoreConfig::doc() function was returning a minimal
hardcoded 3-line string instead of including the comprehensive
documentation from s3-binary-cache-store.md.

This was introduced in PR #13752 which moved the prose documentation to
the markdown file but forgot to update the doc() function to use it.
2025-12-04 22:30:32 -05:00
Eelco Dolstra
a595348f7c
Merge pull request #14709 from NixOS/fix-mingw
More mingw fixes
2025-12-04 17:33:40 +00:00
John Ericson
a4fc3863dd
Merge pull request #14708 from obsidiansystems/version-path-info-outer
Make `nix path-info` follow the JSON guidelines
2025-12-04 17:16:17 +00:00
Eelco Dolstra
c555af2c77 More mingw fixes 2025-12-04 17:56:07 +01:00
John Ericson
5f73c6b416 Make nix path-info follow the JSON guildelines 2025-12-03 23:41:48 -05:00
John Ericson
f9089deb20 Make storeDir a part of UnkeyedValidPathInfo
The previous commit hacked it into the output of `nix path-info --json`,
this cleans that up my making it an actual field of that data type, and
part of the canonical JSON serializers for it (and `ValidPathInfo` and
`NarInfo`).

Beyond cleaning up the JSON code, this also opens the doors to things
like:

- Binary caches that contain store objects that don't all belong in the
  same store directory

- Relocatable store objects which carefully don't mention any store
  directory by absolute path, and instead use relative paths for
  anything. (#9549)
2025-12-03 23:20:06 -05:00
John Ericson
9246dca541
Merge pull request #14704 from NixOS/version-output
Introduce `--json-format` for `nix path-info`
2025-12-04 03:48:49 +00:00
John Ericson
676fb0fffc
Merge pull request #14705 from NixOS/pathinfo-cache-string-to-store-path
libstore: Make Store::pathInfoCache use StorePath instead of std::string
2025-12-04 03:33:51 +00:00
John Ericson
9f0d1e9509
Merge pull request #14706 from roberth/document-scopedImport
Document scopedImport builtin
2025-12-04 03:32:40 +00:00