Open dpwiz opened 3 years ago
Implicit snapshots which are one of the main things introduced in Stack 2 take into account not only (ordinary?) snapshots (aka resolvers) but also any other immutable packages. I suppose the doc and the section should answer most of your questions
While having docs is nice, having the actual values somewhere in snapshot directory would be even nicer.
Extra-nice, if it would result in the same hash, but I expect it would hurt readability.
Having actual values of what?
And how do you want to get the same hash? Maybe I'm wrong but it sounds like you didn't read he doc I'm referencing and my comment above as well
I can see the compiler in the path, but not the other things that went into hash. Maybe they are somewhere in the snapshot directory, I just don't know where.
@dpwiz not all of them come from a snapshot - that's exactly what I was talking about. E.g. if you have an extra-dep that also is an immutable dependency. Global or "boot" packages come with GHC so those are determined by your GHC. To get package dependencies you could use e.g. stack ls
.
If you want to know more details you could see them in the source code - https://github.com/commercialhaskell/stack/blob/065af79fc205e3008808e592976fcfcfea886b47/src/Stack/Build/Source.hs#L118
In principle stack ls snapshots
with the introduction of implicit snapshots in Stack 2 makes not so much sense but it's not clear what to replace it with.
Yep. Let's put those into snapshot directory:
cat $(stack path --snapshot-install-root)/sourcemap.yaml
compiler-path: ...
compiler-info: ...
boot-ghc-opts: ...
immutable-deps:
...
I can contribute the code.
What about showing that on demand instead? Such a file doesn't look to be required in most cases.
I would like to know, for debugging custom snapshots, what information went into particular hash.
The situation goes like this: 1) I build project and make snapshot read-only for next builds of the same stuff. 2) I build another project off the same local snapshot 3) Stack tries to start from scratch and I would like to know why.
There is
stack ls snapshots
that gives hashes, but there's no way to find out what's "inside". Or, in my case, what's changed.