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

Incorrect lastModified value #10601

Open
edolstra opened this issue Apr 24, 2024 · 0 comments · May be fixed by #10612
Open

Incorrect lastModified value #10601

edolstra opened this issue Apr 24, 2024 · 0 comments · May be fixed by #10612
Assignees
Labels
bug flakes regression Something doesn't work anymore

Comments

@edolstra
Copy link
Member

Describe the bug

I observed this random failure in the flake regression test suite:

diff --git a/tests/acaloiaro/di-tui/0.1.85+rev-12ae555a00205926da7cb5216d7f070e57b7508e/contents.json b/tests/acaloiaro/di-tui/0.1.85+rev-12ae555a00205926da7cb5216d7f070e57b7508e/contents-new.json
index 478c4e8..81b18d3 100644
--- a/tests/acaloiaro/di-tui/0.1.85+rev-12ae555a00205926da7cb5216d7f070e57b7508e/contents.json
+++ b/tests/acaloiaro/di-tui/0.1.85+rev-12ae555a00205926da7cb5216d7f070e57b7508e/contents-new.json
@@ -1 +1 @@
 {"docs":{"devShells":"The `devShells` flake output contains derivations that provide a build environment for `nix develop`.\n","packages":"The `packages` flake output contains packages that can be added to a shell using `nix shell`.\n"},"inventory":{"devShells":{"children":{"aarch64-darwin":{"children":{"default":{"derivation":"/nix/store/1br0kf1jymr6hfymmsnql1nw09qiw9cf-nix-shell.drv","forSystems":["aarch64-darwin"],"outputs":{"out":"/nix/store/p5dgb83nm1q1vrsds85gk7l4vvfa93g0-nix-shell"},"shortDescription":"","what":"development environment"}}},"aarch64-linux":{"children":{"default":{"derivation":"/nix/store/lrhq97gbihryj828fyf77aji4g44iyj9-nix-shell.drv","forSystems":["aarch64-linux"],"outputs":{"out":"/nix/store/xk0yxvlzkar69ipnksl215zsl94a1598-nix-shell"},"shortDescription":"","what":"development environment"}}},"x86_64-darwin":{"children":{"default":{"derivation":"/nix/store/1yplmrjp3976qg1aw5bc0km3sfa7qf56-nix-shell.drv","forSystems":["x86_64-darwin"],"outputs":{"out":"/nix/store/y8p6an9pwqbdvvln32gazpk8gj5bx37w-nix-shell"},"shortDescription":"","what":"development environment"}}},"x86_64-linux":{"children":{"default":{"derivation":"/nix/store/7wbzj4rf0hbjx9i3maxn6x8161afmyj5-nix-shell.drv","forSystems":["x86_64-linux"],"outputs":{"out":"/nix/store/n8k7k154h8pcr8zygw773ddy1m7506bp-nix-shell"},"shortDescription":"","what":"development environment"}}}}},"packages":{"children":{"aarch64-darwin":{"children":{"default":{"derivation":"
-/nix/store/5nxrgmw3s2rq3r3rpkrg5g8sga6sa5hh-di-tui-19700101.drv
+/nix/store/1pdn1icf5xv9afmdarx5rvaj6kbfd550-di-tui-20230915.drv
 ","forSystems":["aarch64-darwin"],"outputs":{"out":"
-/nix/store/z6gx1fpm6ckrqjc8ahr50hr8i5balgh4-di-tui-19700101
+/nix/store/gxzqxpwnwn97ijwfp9vi7yhzh3yilylr-di-tui-20230915
 "},"shortDescription":"","what":"package"}}},"aarch64-linux":{"children":{"default":{"derivation":"
-/nix/store/znqkcfw9cliq5vymfv831bdyw2jdsrps-di-tui-19700101.drv
+/nix/store/w0v14fhvb1xwwvvfr0qyhvsbggxshn0i-di-tui-20230915.drv
 ","forSystems":["aarch64-linux"],"outputs":{"out":"
-/nix/store/qdx3m7cqah8r6l28b7i9lj33sh8w2nnd-di-tui-19700101
+/nix/store/6yjc58p6nw3ljsj06fdjhflnz4pr4b71-di-tui-20230915
 "},"shortDescription":"","what":"package"}}},"x86_64-darwin":{"children":{"default":{"derivation":"
-/nix/store/hgg0i7pn588d4cbhvj19j2b3mz2lm6ad-di-tui-19700101.drv
+/nix/store/64g3dmkbxl4als9xwvrb8ym4qbsfdsln-di-tui-20230915.drv
 ","forSystems":["x86_64-darwin"],"outputs":{"out":"
-/nix/store/1qcdm8a8xgimi06d8swpqp2cffa1wn70-di-tui-19700101
+/nix/store/b0aziipy3c6j0dyiw8a7my4xa5wl6h9v-di-tui-20230915
 "},"shortDescription":"","what":"package"}}},"x86_64-linux":{"children":{"default":{"derivation":"
-/nix/store/izp8wbyfpd4h05fk9k6agskahlk9bixg-di-tui-19700101.drv
+/nix/store/q9r0xx4lwklaws7m1j6a9whmzypf558h-di-tui-20230915.drv
 ","forSystems":["x86_64-linux"],"outputs":{"out":"
-/nix/store/sg8pf2mi34m372ydfii7qjmwbqanxnrz-di-tui-19700101
+/nix/store/paqqrhbjdwn0wgk7xs5pcxd7sazrh3r2-di-tui-20230915
 "},"shortDescription":"","what":"package"}}}}}},"version":1}
~
❌ tests/acaloiaro/di-tui/0.1.85+rev-12ae555a00205926da7cb5216d7f070e57b7508e

The diff suggests that the lastModified value of the flake input isn't always passed correctly.

Steps To Reproduce

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

A clear and concise description of what you expected to happen.

nix-env --version output

Additional context

Add any other context about the problem here.

Priorities

Add 👍 to issues you find important.

@edolstra edolstra added bug regression Something doesn't work anymore flakes labels Apr 24, 2024
@edolstra edolstra self-assigned this Apr 24, 2024
edolstra added a commit to edolstra/nix that referenced this issue Apr 26, 2024
Having a narHash doesn't mean that we have the other attributes
returned by the fetcher (such as lastModified or rev). For instance,

   $ nix flake metadata github:NixOS/patchelf/7c2f768bf9601268a4e71c2ebe91e2011918a70f
   Last modified: 2024-01-15 10:51:22

but

   $ nix flake metadata github:NixOS/patchelf/7c2f768bf9601268a4e71c2ebe91e2011918a70f?narHash=sha256-PPXqKY2hJng4DBVE0I4xshv/vGLUskL7jl53roB8UdU%3D
   (does not print a "Last modified")

The latter only happens if the store path already exists or is
substitutable, which made this impure behaviour unpredictable.

Fixes NixOS#10601.
@edolstra edolstra linked a pull request Apr 26, 2024 that will close this issue
edolstra added a commit to edolstra/nix that referenced this issue Apr 26, 2024
Having a narHash doesn't mean that we have the other attributes
returned by the fetcher (such as lastModified or rev). For instance,

   $ nix flake metadata github:NixOS/patchelf/7c2f768bf9601268a4e71c2ebe91e2011918a70f
   Last modified: 2024-01-15 10:51:22

but

   $ nix flake metadata github:NixOS/patchelf/7c2f768bf9601268a4e71c2ebe91e2011918a70f?narHash=sha256-PPXqKY2hJng4DBVE0I4xshv/vGLUskL7jl53roB8UdU%3D
   (does not print a "Last modified")

The latter only happens if the store path already exists or is
substitutable, which made this impure behaviour unpredictable.

Fixes NixOS#10601.
edolstra added a commit to DeterminateSystems/flake-regressions-data that referenced this issue Apr 27, 2024
edolstra added a commit to DeterminateSystems/flake-regressions-data that referenced this issue Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug flakes regression Something doesn't work anymore
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant