Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

path fetcher: Allow the lastModified attribute to be overriden again #11695

Merged
merged 2 commits into from
Oct 16, 2024

Conversation

edolstra
Copy link
Member

Motivation

It's common to have local registry overrides like

      "from": {
        "id": "nixpkgs",
        "type": "indirect"
      },
      "to": {
        "lastModified": 1728500571,
        "narHash": "sha256-dOymOQ3AfNI4Z337yEwHGohrVQb4yPODCW9MDUyAc4w=",
        "path": "/nix/store/m1szqwijms610n6325mwjswslha4nd92-source",
        "rev": "d51c28603def282a24fa034bcb007e2bcb5b5dd0",
        "revCount": 635766,
        "type": "path"
      }

However, this only worked by accident because the presence of the narHash attribute inhibited checking of attributes (see #10601, #10612). Now that we do check them, we have to explicitly respect the user-supplied lastModified.

Fixes #11660.

Context

Priorities and Process

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 fetching Networking with the outside (non-Nix) world, input locking label Oct 14, 2024
Copy link
Member

@bryanhonof bryanhonof left a comment

Choose a reason for hiding this comment

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

LGTM!

question(non-blocking): Are there some sort of tests that already capture this behavior?

Copy link
Member

@bobvanderlinden bobvanderlinden left a comment

Choose a reason for hiding this comment

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

This fixes the problem described in #11660 for me 👍

@github-actions github-actions bot added the with-tests Issues related to testing. PRs with tests have some priority label Oct 16, 2024
@edolstra
Copy link
Member Author

@bryanhonof I've added a test.

@edolstra edolstra enabled auto-merge October 16, 2024 15:18
@edolstra edolstra merged commit facc502 into NixOS:master Oct 16, 2024
11 checks passed
@edolstra edolstra deleted the override-lastModified branch October 16, 2024 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fetching Networking with the outside (non-Nix) world, input locking 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.

error: 'lastModified' attribute mismatch in input 'path:…', expected …
3 participants