John Ericson
de192794c9
Fix issue #14287
...
The test added in the previous commit now passes.
Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
2025-10-29 02:15:46 -04:00
John Ericson
6280905638
Convert store path info JSON docs to formal JSON Schema, and test
...
This continues the work for formalizing our current JSON docs. Note that
in the process, a few bugs were caught:
- `closureSize` was repeated twice, forgot `closureDownloadSize`
- `file*` fields should be `download*`. They are in fact called that in
the line-oriented `.narinfo` file, but were renamed in the JSON
format.
2025-10-28 23:28:16 -04:00
Sergei Zimmerman
194c21fc82
Merge pull request #14407 from NixOS/fix-upload-put-http
...
libstore/filetransfer: Add HttpMethod::PUT
2025-10-29 03:24:10 +00:00
Sergei Zimmerman
e08853a67c
Merge pull request #14406 from NixOS/better-error-message
...
libstore/http-binary-cache-store: Improve error messages in HttpBinar…
2025-10-29 03:23:49 +00:00
Sergei Zimmerman
ae49074548
libstore/filetransfer: Add HttpMethod::PUT
...
This got lost in f1968ea38e and
now we had incorrect logs that confused "downloading" when we were
in fact "uploading" things.
2025-10-29 02:48:26 +03:00
Sergei Zimmerman
c874e7071b
libstore/http-binary-cache-store: Improve error messages in HttpBinaryCacheStore::upsertFile
...
Now the error message doesn't cram everything into a single line and we now instead get:
error:
… while uploading to HTTP binary cache at 's3://my-cache?endpoint=http://localhost:9000?compression%3Dzstd®ion=eu-west-1 '
error: unable to download 'http://localhost:9000/my-cache/nar/1125zqba8cx8wbfa632vy458a3j3xja0qpcqafsfdildyl9dqa7x.nar.xz ': Operation was aborted by an application callback (42)
2025-10-29 02:05:14 +03:00
John Ericson
c67966418f
Create JSON Schema for Store Paths
...
We immediately use this in the JSON schemas for Derivation and Deriving
Path, but we cannot yet use it in Store Object Info because those paths
*do* include the store dir currently.
2025-10-28 17:22:51 -04:00
John Ericson
e3246301a6
Enable JSON schema testing for derivation outputs
...
I figured out what the problem was: the fragment needs to start with a
`/`.
2025-10-28 16:07:44 -04:00
Robert Hensing
5fc0c4f102
doc: Improve libexpr-c docs
...
- Uses the more explicit `@ingroup` most of the time, to avoid problems
with nested groups, and to make group membership more explicit.
The division into headers is not great for documentation purposes,
so this helps.
- More attention for memory management details
- Various other improvements to doc comments
2025-10-28 17:57:15 +01:00
Bernardo Meurer Costa
c77317b1a9
feat(libstore/s3-binary-cache-store): implement completeMultipartUpload()
...
`completeMultipartUpload()`: Build XML with part numbers and `ETags`,
POST to key with `?uploadId` to finalize the multipart upload
2025-10-28 01:13:28 +00:00
Jörg Thalheim
dd0d006517
Merge pull request #14375 from lovesegfault/nix-s3-upload-part
...
feat(libstore/s3-binary-cache-store): implement `uploadPart()`
2025-10-27 22:40:00 +00:00
John Ericson
1d3f0ca22e
Merge pull request #14383 from obsidiansystems/misc-cleanups
...
Two misc cleanups
2025-10-27 22:16:37 +00:00
Bernardo Meurer Costa
c592090fff
feat(libstore/s3-binary-cache-store): implement uploadPart()
...
Implement `uploadPart()` for uploading individual parts in S3 multipart
uploads:
- Constructs URL with `?partNumber=N&uploadId=ID` query parameters
- Uploads chunk data with `application/octet-stream` mime type
- Extracts and returns `ETag` from response
2025-10-27 21:09:39 +00:00
Bernardo Meurer Costa
4b6d07d642
feat(libstore/s3-binary-cache-store): implement createMultipartUpload()
...
POST to key with `?uploads` query parameter, optionally set
`Content-Encoding` header, parse `uploadId` from XML response using
regex
2025-10-27 21:07:29 +00:00
John Ericson
e177f42536
Merge pull request #14379 from Radvendii/exprlist-alloc
...
libexpr: store ExprList data in Exprs::alloc
2025-10-27 21:04:45 +00:00
John Ericson
ac8b1efcf9
Merge pull request #14379 from Radvendii/exprlist-alloc
...
libexpr: store ExprList data in Exprs::alloc
2025-10-27 21:04:45 +00:00
John Ericson
18941a2421
Optimize DummyStore::isValidPathUncached
...
See the API docs for the rationale of why this is needed.
2025-10-27 16:49:18 -04:00
John Ericson
136825b4a2
Make Dummy store store derivations separately
...
This makes for more efficiency. Once we have JSON for the dummy store,
it will also make for better JSON, too.
2025-10-27 16:49:18 -04:00
John Ericson
28b73cabcc
Make reading and writing derivations store methods
...
This allows for different representations.
2025-10-27 16:49:18 -04:00
John Ericson
aa4106fd68
Merge pull request #14360 from lovesegfault/scan-for-references-detailed
...
feat(libstore): add scanForReferencesDeep and use it for why-depends
2025-10-27 20:38:10 +00:00
John Ericson
7f1d92793e
Merge pull request #14360 from lovesegfault/scan-for-references-detailed
...
feat(libstore): add scanForReferencesDeep and use it for why-depends
2025-10-27 20:38:10 +00:00
John Ericson
234f029940
Add consuming ref <-> std::share_ptr methods/ctrs
...
This can help churning ref counts when we don't need to.
2025-10-27 16:23:43 -04:00
John Ericson
dd716dc9be
Create default Store::narFromPath implementation in terms of getFSAccessor
...
This is a good default (the methods that allow for an arbitrary choice
of source accessor are generally preferable both to implement and to
use). And it also pays its way by allowing us to delete *both* the
`DummyStore` and `LocalStore` implementations.
2025-10-27 15:57:26 -04:00
John Ericson
ea17cc1b57
Merge pull request #14376 from lovesegfault/nix-s3-abort-multipart
...
feat(libstore/s3-binary-cache-store): implement `abortMultipartUpload()`
2025-10-27 19:52:36 +00:00
John Ericson
0c1be3aabe
Merge pull request #14309 from obsidiansystems/json-schema-content-address
...
` nlohmann::json` instance and JSON Schema for `ContentAddress`
2025-10-27 19:52:19 +00:00
John Ericson
6ca3434cac
Merge pull request #14309 from obsidiansystems/json-schema-content-address
...
` nlohmann::json` instance and JSON Schema for `ContentAddress`
2025-10-27 19:52:19 +00:00
Bernardo Meurer Costa
6129aee988
refactor(nix/why-depends): use scanForReferencesDeep for --precise mode
...
Replaces manual tree-walking and reference scanning with the new
scanForReferencesDeep function.
2025-10-27 19:14:49 +00:00
Bernardo Meurer Costa
5e220271e2
feat(libstore): add scanForReferencesDeep for per-file reference tracking
...
Introduces `scanForReferencesDeep` to provide per-file granularity when
scanning for store path references, enabling better diagnostics for
cycle detection and `nix why-depends --precise`.
2025-10-27 19:14:49 +00:00
John Ericson
8e6b69de54
Merge pull request #14378 from Radvendii/parser-improvements
...
parser.y: remove some unnecessary copies
2025-10-27 19:11:11 +00:00
Bernardo Meurer Costa
3915b3a111
feat(libstore/s3-binary-cache-store): implement abortMultipartUpload()
...
Implement `abortMultipartUpload()` for cleaning up incomplete multipart
uploads on error:
- Constructs URL with `?uploadId=ID` query parameter
- Issues `DELETE` request to abort the multipart upload
2025-10-27 18:56:52 +00:00
Jörg Thalheim
c5515bb22e
Merge pull request #14364 from MarcelCoding/human-sizes
...
diff-closures: print sizes with dynamic unit
2025-10-27 18:49:23 +00:00
John Ericson
91b69e9e70
nlohmann::json instance and JSON Schema for ContentAddress
...
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2025-10-27 14:47:50 -04:00
Taeer Bar-Yam
9e9dfe36df
libexpr: store ExprList data in Exprs::alloc
2025-10-27 19:38:03 +01:00
Taeer Bar-Yam
50e8d17f3c
parser.y: use emplace_back() for vector<AttrName>
2025-10-27 19:30:32 +01:00
Taeer Bar-Yam
ef8dd58d9b
parser.y: use std::move() to avoid unnecessary copies
...
With #14314 , in some places in the parser we started using C++ objects
directly rather than pointers. In those places lines like `$$ = $1` now
imply a copy when we don't need one. This commit changes those to `$$ =
std::move($1)` to avoid those copies.
2025-10-27 19:30:32 +01:00
John Ericson
91ed3701fe
Merge pull request #14377 from lovesegfault/makerequest-stringview
...
refactor(libstore): use string_view in HttpBinaryCacheStore::makeRequest
2025-10-27 17:58:53 +00:00
Jörg Thalheim
b8e5d1f290
Merge pull request #14369 from NixOS/copy-sigs-docs
...
nix store copy-sigs: Add docs
2025-10-27 17:55:56 +00:00
Jörg Thalheim
d44b33562f
Merge pull request #14373 from NixOS/copy-sigs-parallel
...
nix store copy-sigs: Use http-connections setting to control parallelism
2025-10-27 17:53:23 +00:00
Jörg Thalheim
d46504a136
Merge pull request #14359 from obsidiansystems/structured-attrs-always-object
...
Use types to show that structured attrs are always JSON objects
2025-10-27 17:51:33 +00:00
Eelco Dolstra
126f30deb2
Merge pull request #14366 from NixOS/const-fields
...
EvalState: Make some more fields const
2025-10-27 17:47:21 +00:00
Bernardo Meurer Costa
5dcfa86910
refactor(libstore): use string_view in HttpBinaryCacheStore::makeRequest
2025-10-27 17:13:48 +00:00
Eelco Dolstra
6b6ceddf72
nix store copy-sigs: Use http-connections setting to control parallelism
...
Previously it used the `ThreadPool` default,
i.e. `std:🧵 :hardware_concurrency()`. But copying signatures is
not primarily CPU-bound so it makes more sense to use the
`http-connections` setting (since we're typically copying from/to a
binary cache).
2025-10-27 16:43:25 +01:00
Eelco Dolstra
60f9489b83
Merge pull request #14370 from NixOS/misc-cleanups
...
Miscellaneous cleanups
2025-10-27 15:04:53 +00:00
Marcel
584a8e8a00
treewide: replace manual MiB calculations with renderSize
2025-10-27 16:04:19 +01:00
Marcel
f234633e27
refactor(libutil): remove showBytes() in favor of renderSize()
...
The `showBytes()` function was redundant with `renderSize()` as the
latter automatically selects the appropriate unit (KiB, MiB, GiB, etc.)
based on the value, whereas `showBytes()` always formatted as MiB
regardless of size.
Co-authored-by: Bernardo Meurer Costa <beme@anthropic.com>
2025-10-27 16:04:08 +01:00
Sergei Zimmerman
6417863ce9
Merge pull request #14357 from lovesegfault/s3-setup-pub
...
refactor(libstore/filetransfer): make setupForS3 public
2025-10-27 14:36:41 +00:00
Eelco Dolstra
91cd42511e
Introduce MINIMUM_PROTOCOL_VERSION constant
2025-10-27 15:11:20 +01:00
Eelco Dolstra
1af5a98955
Document removed WorkerProto ops
2025-10-27 15:09:03 +01:00
Eelco Dolstra
17777e3b70
Settings typos
2025-10-27 15:07:56 +01:00
Eelco Dolstra
9321669353
Make getDefaultCores() static
2025-10-27 15:07:01 +01:00