Sergei Zimmerman
5390bba920
Merge pull request #14314 from Radvendii/parser-cpp-variant
...
libexpr: parser.y: use api.value.type variant
2025-10-22 18:49:14 +00:00
Sergei Zimmerman
96c8cc550f
libexpr/meson: Rice the compiler inlining heuristics to improve perf of the bison generated parser
...
Turns out both GCC and Clang need a bit of hand-holding to optimize the bison generated
code well, otherwise parser performance tanks.
(Comparisons against baseline in 7e8db2eb59 ):
For GCC:
Benchmark 1 (15 runs): result/bin/nix-instantiate --parse ../nixpkgs/pkgs/development/haskell-modules/hackage-packages.nix
measurement mean ± σ min … max outliers delta
wall_time 335ms ± 2.89ms 332ms … 342ms 0 ( 0%) 0%
Benchmark 2 (16 runs): result-old/bin/nix-instantiate --parse ../nixpkgs/pkgs/development/haskell-modules/hackage-packages.nix
measurement mean ± σ min … max outliers delta
wall_time 330ms ± 2.87ms 326ms … 337ms 0 ( 0%) - 1.4% ± 0.6%
For Clang:
Benchmark 1 (15 runs): result-clang/bin/nix-instantiate --parse ../nixpkgs/pkgs/development/haskell-modules/hackage-packages.nix
measurement mean ± σ min … max outliers delta
wall_time 340ms ± 1.43ms 338ms … 343ms 0 ( 0%) 0%
Benchmark 2 (15 runs): result-old-clang/bin/nix-instantiate --parse ../nixpkgs/pkgs/development/haskell-modules/hackage-packages.nix
measurement mean ± σ min … max outliers delta
wall_time 334ms ± 1.61ms 332ms … 338ms 0 ( 0%) ⚡ - 1.7% ± 0.3%
2025-10-22 02:25:11 +02:00
Taeer Bar-Yam
32b286e5d6
libexpr: parser.y: api.value.type variant
2025-10-22 02:25:11 +02:00
Sergei Zimmerman
7e8db2eb59
Merge pull request #14318 from cole-h/remove-useless-fmt
...
libstore: remove useless fmt
2025-10-21 17:50:56 +00:00
John Ericson
6ca2efc7d4
Merge pull request #14254 from roberth/upstream-RossComputerGuy/feat/expose-computefsclosure
...
libstore-c: add nix_store_get_fs_closure #14025 with tests and realise error fix
2025-10-21 17:41:29 +00:00
Cole Helbling
62247af363
libstore: remove useless fmt
2025-10-21 10:06:35 -07:00
John Ericson
a4a49a9dae
Merge pull request #14316 from NixOS/fix-computeStorePath-arg
...
Fix computeStorePath() default argument
2025-10-21 14:48:56 +00:00
Eelco Dolstra
606c258c6f
Fix computeStorePath() default argument
2025-10-21 15:58:44 +02:00
John Ericson
ef8218f2e3
Merge pull request #14307 from NixOS/json-schema-hash
...
`nlohmann::json` instance and JSON Schema for `Hash`
2025-10-21 06:03:20 +00:00
John Ericson
ada008a795
Merge pull request #14310 from obsidiansystems/inline-drv-output-subst-goal
...
Inline `realisationFetched`
2025-10-21 06:03:06 +00:00
John Ericson
2a2bb8330d
Merge pull request #14312 from corngood/develop-structuredAttrs-fix
...
tests/functional/flakes/develop.sh: Add test for outputChecks stripping
2025-10-20 22:48:39 +00:00
David McFarland
645794b458
tests/functional/flakes/develop.sh: Add test for outputChecks stripping
2025-10-20 19:16:20 -03:00
John Ericson
1121f0d8ec
Inline realisationFetched
...
Now that we are using coroutines, we don't need this to be a separate
method of `DrvOutputSubstitutionGoal`.
2025-10-20 16:45:41 -04:00
Sergei Zimmerman
6420879728
Merge pull request #14296 from lovesegfault/nix-s3-more-tests
...
fix(nix-prefetch-url): correctly extract filename from URLs with query parameters
2025-10-20 19:42:22 +00:00
Sergei Zimmerman
67f5cb97a3
Merge pull request #14306 from corngood/develop-structuredAttrs-fix
...
nix/develop: Strip outputChecks when structuredAttrs is enabled
2025-10-20 19:38:19 +00:00
John Ericson
5e7ee808de
nlohmann::json instance and JSON Schema for Hash
...
Improving and codifying our experimental JSON interfacing.
Co-Authored-By: Robert Hensing <robert@roberthensing.nl>
2025-10-20 15:21:07 -04:00
John Ericson
270f20a505
Merge pull request #14305 from NixOS/alignment-utils
...
libutil: Add alignUp helper function, use in archive.cc
2025-10-20 19:08:20 +00:00
Bernardo Meurer Costa
1b1d7e3047
test(nixos): add nix-prefetch-url test for S3 URLs with query parameters
...
Adds a comprehensive test to verify that `nix-prefetch-url` correctly
handles S3 URLs with query parameters (e.g., custom endpoints and regions).
Previously, nix-prefetch-url would fail with "invalid store
path" errors when given S3 URLs with query parameters like
`?endpoint=http://server:9000®ion=eu-west-1 `, because it incorrectly
extracted the filename from the query parameters instead of the path.
2025-10-20 21:45:37 +03:00
David McFarland
0f28c76a44
nix/develop: Strip outputChecks when structuredAttrs is enabled
2025-10-20 15:40:05 -03:00
Bernardo Meurer Costa
e3b3f05e5d
fix(nix-prefetch-url): correctly extract filename from URLs with query parameters
...
Previously, `prefetchFile()` used `baseNameOf()` directly on the URL string
to extract the filename. This caused issues with URLs containing query
parameters that include slashes, such as S3 URLs with custom endpoints:
```
s3://bucket/file.txt?endpoint=http://server:9000
```
The `baseNameOf()` function naively searches for the rightmost `/` in the
entire string, which would find the `/` in `http://server:9000 ` and extract
`server:9000®ion=...` as the filename. This resulted in invalid store
path names containing illegal characters like `:`.
This commit fixes the issue by:
1. Adding a `VerbatimURL::lastPathSegment()` method that extracts the last
non-empty path segment from a URL, using `pathSegments(true)` to filter
empty segments
2. Changing `prefetchFile()` to accept `const VerbatimURL &` and use the new
`lastPathSegment()` method instead of manual path parsing
3. Adding early validation with `checkName()` to fail quickly on invalid
filenames
4. Maintains backward compatibility by falling back to `baseNameOf()` for
unparsable `VerbatimURL`s
2025-10-20 21:40:03 +03:00
John Ericson
f05d240222
Merge pull request #14278 from obsidiansystems/adl-serializer-xp
...
Cleanup and JSON serializer and XP feature interations
2025-10-20 18:22:21 +00:00
Sergei Zimmerman
22c73868c3
libutil/archive: Use alignUp
...
With this change it's much more apparent what's going on.
2025-10-20 21:15:11 +03:00
Sergei Zimmerman
a91b787524
libutil: Add alignUp helper function
2025-10-20 21:11:00 +03:00
Eelco Dolstra
ddf7de0a76
Merge pull request #14291 from NixOS/skip-source
...
Add skip() method to Source interface to allow efficient seeks
2025-10-20 15:04:36 +00:00
Sergei Zimmerman
1fabed18b6
Merge pull request #14301 from NixOS/s3-terminate-unknown-profile
...
libstore: Fix reentrancy in AwsCredentialProviderImpl::getCredentialsRaw
2025-10-20 14:28:16 +00:00
Eelco Dolstra
6c9083db2c
Use a smaller buffer
2025-10-20 13:40:19 +02:00
Sergei Zimmerman
c663f7ec79
libstore: Fix reentrancy in AwsCredentialProviderImpl::getCredentialsRaw
...
Old code would do very much incorrect reentrancy crimes (trying to do an
erase inside the emplace callback). This would fail miserably with an assertion
in Boost:
terminating due to unexpected unrecoverable internal error: Assertion '(!find(px))&&("reentrancy not allowed")' failed in boost::unordered::detail::foa::entry_trace::entry_trace(const void *) at include/boost/unordered/detail/foa/reentrancy_check.hpp:33
This is trivially reproduced by using any S3 URL with a non-empty profile:
nix-prefetch-url "s3://happy/crash?profile=default"
2025-10-19 21:03:13 +03:00
Sergei Zimmerman
d0fb03c35d
Merge pull request #14282 from NixOS/s3-cleanup
...
Simplify meson for S3 support via aws-crt-cpp
2025-10-19 17:00:46 +00:00
Sergei Zimmerman
c847cd87f1
Merge pull request #14297 from lovesegfault/nix-s3-test-public
...
test(nixos/s3-binary-cache-store): misc improvements
2025-10-19 16:53:40 +00:00
tomberek
dbbdae926b
Merge pull request #14299 from roberth/unlocked-msg
...
Clarify unlocked input warning message
2025-10-19 16:50:16 +00:00
Eelco Dolstra
3c03050cd6
Merge pull request #14290 from NixOS/dont-write-nar-to-tty
...
nix store dump-path: Refuse to write NARs to the terminal
2025-10-19 12:41:55 +00:00
Robert Hensing
e33cd5aa38
Clarify unlocked input warning message
...
The previous message was vague about what "deprecated" meant and why
unlocked inputs with NAR hashes "may not be reproducible". It also
used "verifiable" which was confusing.
The new message makes it clear that the NAR hash provides verification
(is checked by NAR hash) and explicitly states the failure modes:
garbage collection and sharing.
2025-10-19 14:08:34 +02:00
Bernardo Meurer Costa
d9c808f8a7
refactor(tests/nixos/s3-binary-cache-store): add verify_packages_in_store helper
2025-10-19 00:21:54 +00:00
Bernardo Meurer Costa
55ea3d3476
test(tests/nixos/s3-binary-cache-store): test public bucket operations
...
Add `test_public_bucket_operations` to validate that store operations
work correctly on public S3 buckets without requiring credentials.
Tests nix store info and nix copy operations.
2025-10-19 00:04:33 +00:00
Bernardo Meurer Costa
7d0c06f921
feat(tests/nixos/s3-binary-cache-store): add public parameter to setup_s3
...
Add optional 'public' parameter to setup_s3 decorator. When set to True,
the bucket will be made publicly accessible using mc anonymous set.
2025-10-18 23:57:51 +00:00
Bernardo Meurer Costa
5b4bd5bcb8
refactor(tests/nixos/s3-binary-cache-store): inline make_http_url fn
...
Remove make_http_url helper function and inline its single usage.
2025-10-18 23:51:44 +00:00
Bernardo Meurer Costa
4ae6c65bc5
test(tests/nixos/s3-binary-cache-store): verify credential caching in concurrent fetches
...
Add assertion to test_concurrent_fetches to verify that only one
credential provider is created even with 5 concurrent fetches.
2025-10-18 23:48:55 +00:00
Bernardo Meurer Costa
4f19e63a8f
refactor(tests/nixos/s3-binary-cache-store): add --no-link to nix build commands
...
Prevent creation of result symlinks in all nix build commands by
adding the --no-link flag.
2025-10-18 23:44:13 +00:00
Bernardo Meurer Costa
f88c3055f8
refactor(tests/nixos/s3-binary-cache-store): clean client store in setup_s3
...
Add cleanup of client store in the finally block of setup_s3 decorator.
Uses `nix store delete --ignore-liveness` to properly handle GC roots
and only attempts deletion if the path exists.
2025-10-18 23:36:48 +00:00
Bernardo Meurer Costa
9058d90ab2
refactor(tests/nixos/s3-binary-cache-store): rename populate_with to populate_bucket
2025-10-18 23:27:03 +00:00
Bernardo Meurer Costa
c1a15d1a26
refactor(tests/nixos/s3-binary-cache-store): rename with_test_bucket to setup_s3
2025-10-18 23:24:30 +00:00
Bernardo Meurer Costa
22f4cccc71
refactor(tests/nixos/s3-binary-cache-store): use a PKGS dict
...
Replace individual PKG_A, PKG_B, and PKG_C variables with a PKGS
dictionary. This will enable `@with_clean_client_store` in the future.
2025-10-18 23:23:50 +00:00
John Ericson
b56e456b0d
Merge pull request #14269 from roberth/json-schema
...
Add a JSON Schema for `Derivation`
2025-10-18 18:50:39 +00:00
Robert Hensing
c92ba4b9b7
Add titles in JSON schemas
...
This way, the description isn't rendered in the tables of contents,
leading to no more formatting errors.
2025-10-17 21:53:29 +02:00
Eelco Dolstra
67bffa19a5
NullFileSystemObjectSink: Skip over file contents
2025-10-17 20:44:02 +02:00
Eelco Dolstra
daa7e0d2e9
Source: Add skip() method
...
This allows FdSource to efficiently skip data we don't care about.
2025-10-17 20:41:33 +02:00
Eelco Dolstra
109f6449cc
nix store dump-path: Refuse to write NARs to the terminal
2025-10-17 20:27:10 +02:00
John Ericson
ad2360c59f
Merge pull request #14288 from lovesegfault/repl-skip-stack
...
fix(tests/functional/repl): skip test if stack size limit is insufficient
2025-10-17 17:35:52 +00:00
Bernardo Meurer Costa
20c7c551bf
fix(tests/functional/repl): skip test if stack size limit is insufficient
...
Nix attempts to set the stack size to 64 MB during initialization, which is
required for the repl tests to run successfully. Skip the tests on systems
where the hard stack limit is less than this value rather than failing.
2025-10-17 17:05:12 +00:00
John Ericson
e78e6ca4f4
Merge pull request #14281 from NixOS/dead-code
...
libutil: Drop unused SubdirSourceAccessor
2025-10-17 03:01:17 +00:00