fix: Add lastModified to git sources#3
Conversation
|
Can you point me to some documentation for the lastModified field (or source code). Couldn't find anything on a quick glance. Afaik Nix doesn't fetch the sources again if they're in the store already as long as it has the hash. |
|
So, both lix and nix start at the same point, CppNixThe real fetch is done here: https://github.com/NixOS/nix/blob/master/src/libexpr/primops/fetchTree.cc#L207 So in the case of cppnix, the remote git repo will always be fetched using LixFor lix, the ending is better. We start at https://git.lix.systems/lix-project/lix/src/branch/main/lix/libexpr/primops/fetchTree.cc#L194 maybeGetIntAttr(input.attrs, "lastModified")
&& (shallow || maybeDirty || maybeGetIntAttr(input.attrs, "revCount"));Thus, specifying |
|
Also, just having a |
|
This seems like a bug in Nix and Lix to be honest. Why would I need this piece of metadata information to substitute? This seems like a flakeism that should be fixed in Lix. Not saying I'm not accepting the change, but this would just be a workaround for a bug in Nix/Lix IMO. |
|
True, the whole issue is that |
Awesome! In the meanwhile I'm happy to merge this as a stopgap solution when my comments are addressed. |
This is needed for nix to consider looking in the store instead of fetching the source each time. We also need to set shallow to `true` (which is the case technically).
|
I did https://gerrit.lix.systems/c/lix/+/3009, it's a hack, but it works |
|
Thank you! |
This is needed for nix to consider looking in the store instead of fetching the source each time. We also need to set shallow to
true(which is the case technically).I modified the v1 lock, which is incorrect, as a migration will be needed to add the
lastModifiedfield. But I didn't want to duplicate all the code, as this is only a filed addition.Fixes: #2