Skip to content

Comments

fix(libstore): improve http-binary-cache-store S3 compatibility#14209

Merged
xokdvium merged 1 commit intoNixOS:masterfrom
lovesegfault:curl-based-s3-pieces-fix
Oct 11, 2025
Merged

fix(libstore): improve http-binary-cache-store S3 compatibility#14209
xokdvium merged 1 commit intoNixOS:masterfrom
lovesegfault:curl-based-s3-pieces-fix

Conversation

@lovesegfault
Copy link
Member

Motivation

This commit adds two key fixes to http-binary-cache-store.cc to
properly support the new curl-based S3 implementation:

  1. Consistent cache key handling: Use getReference().render(withParams=false)
    for disk cache keys instead of cacheUri.to_string(). This ensures cache
    keys are consistent with the S3 implementation and don't include query
    parameters, which matches the behavior expected by Store::queryPathInfo()
    lookups.

  2. S3 query parameter preservation: When generating file transfer requests
    for S3 URLs, preserve query parameters from the base URL (region, endpoint,
    etc.) when the relative path doesn't have its own query parameters. This
    ensures S3-specific configuration is propagated to all requests.

Context

Carve out of #13752, should have made it onto #14198 but I missed it.


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

@github-actions github-actions bot added the store Issues and pull requests concerning the Nix store label Oct 10, 2025
@lovesegfault lovesegfault requested a review from xokdvium October 10, 2025 19:43
This commit adds two key fixes to http-binary-cache-store.cc to
properly support the new curl-based S3 implementation:

1. **Consistent cache key handling**: Use `getReference().render(withParams=false)`
   for disk cache keys instead of `cacheUri.to_string()`. This ensures cache
   keys are consistent with the S3 implementation and don't include query
   parameters, which matches the behavior expected by Store::queryPathInfo()
   lookups.

2. **S3 query parameter preservation**: When generating file transfer requests
   for S3 URLs, preserve query parameters from the base URL (region, endpoint,
   etc.) when the relative path doesn't have its own query parameters. This
   ensures S3-specific configuration is propagated to all requests.
@lovesegfault lovesegfault force-pushed the curl-based-s3-pieces-fix branch from 5d91c63 to f022188 Compare October 10, 2025 22:06
@lovesegfault lovesegfault requested a review from xokdvium October 10, 2025 22:14
@xokdvium xokdvium added this pull request to the merge queue Oct 11, 2025
Merged via the queue into NixOS:master with commit 97e770a Oct 11, 2025
18 checks passed
@edolstra edolstra mentioned this pull request Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

store Issues and pull requests concerning the Nix store

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants