Skip to content

Add setting narinfo-cache-meta-ttl#15287

Merged
edolstra merged 2 commits intomasterfrom
narinfo-cache-meta-ttl
Feb 18, 2026
Merged

Add setting narinfo-cache-meta-ttl#15287
edolstra merged 2 commits intomasterfrom
narinfo-cache-meta-ttl

Conversation

@edolstra
Copy link
Member

Motivation

This makes the current hard-coded 7-day nix-cache-info TTL configurable, making --offline and --refresh do the right thing.

Based on DeterminateSystems#355.

Context


Add 👍 to pull requests you find important.

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

This makes the current hard-coded 7-day `nix-cache-info` TTL
configurable, making `--offline` and `--refresh` do the right thing.
@github-actions github-actions bot added new-cli Relating to the "nix" command with-tests Issues related to testing. PRs with tests have some priority labels Feb 18, 2026
Copy link
Contributor

@xokdvium xokdvium left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth a release note? Otherwise LGTM

@edolstra edolstra enabled auto-merge February 18, 2026 21:28
@edolstra edolstra added this pull request to the merge queue Feb 18, 2026
Merged via the queue into master with commit fef83c9 Feb 18, 2026
18 checks passed
@edolstra edolstra deleted the narinfo-cache-meta-ttl branch February 18, 2026 23:01
auto i = state.caches.find(uri);
if (i == state.caches.end()) {
auto queryCache(state.queryCache.use()(uri)(time(0) - cacheInfoTtl));
auto queryCache(state.queryCache.use()(uri)(time(0) - settings.ttlMeta));
Copy link
Contributor

@xokdvium xokdvium Feb 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is subtle, note that the test on i686 (and other 32 bit platforms) fails because this does a silent integral unsigned promotion.
https://hydra.nixos.org/build/322992746/nixlog/1

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will put up a fix

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in #15356

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation new-cli Relating to the "nix" command with-tests Issues related to testing. PRs with tests have some priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants