-
Notifications
You must be signed in to change notification settings - Fork 841
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
stack unpack
downloads deprecated package versions
#1391
Comments
I just scanned hackage index trying to find what other packages are affected. As it turns out, at the moment 15 out of 9069 packages have
I hope it will be useful for anyone who decides to fix this bug (at least for testing). I initially wanted to fix it myself, but it seems that it is not that trivial. We need to either make a request to Hackage API each time a user runs |
Hmm, it's surprising to me that |
Yeah, I could go either way on this. Not really clear to me whether it's preferable to use the latest version or the snapshot version, so I'd tend toward staying with the current behaviour unless there's a compelling reason to change it (and I'm not sure that this issue qualifies as compelling enough). I just confirmed that the package index in |
hmm there are a couple ways mentioned above to approach this Z. query hackage api each time S Z. extend package-cache map to contain this information newtype PackageCacheMap
= PackageCacheMap (Map PackageName (Maybe PreferredVersions, Map Version PackageCache)) also from skimming the code looks like a change like this will rebuild cache correctly once users upgrade and maybe have a flag to support @mgsloan comment on fetching it using the snapshot? |
Just playing with the |
@tolysz Good point. The case of unpacking a local package (in particular, I'm thinking it's fine to change the meaning of |
Or even |
I prefer |
Not if |
For ghcjs/ghcjs#442 @luigy had the excellent idea of using |
Note that you can do
Here's where the code for unpack lives: Line 133 in 704764f
|
@mgsloan to be clear we want to replace the submodules with a Thanks for that tip on the code. I guess I need to hook that up with the "normal" fetching stuff in https://github.com/commercialhaskell/stack/blob/master/src/Stack/Config.hs |
hehe it looked promising to use stack for a bigger part of it before looking into the sorcery inside ghcjs-boot which will require a bit more custom support from inside stack. To give in a bit more context, we wanted in the least to pin ghcjs boot packages into stackage snapshots. In the end if unpack gets snapshot support I still think stack would be a convenient way to fetch boot packages in order to continue with the boot process, but probably too much of a dependency to incur? We were just tossing ideas to improve maintainability of ghcjs
I should have some code laying around for the second option I mentioned here |
did we come up in agreement wether to use hackage or resolver(if snapshot) as the default? |
I'm operating on the assumption that the package version stack would use is the one it should unpack. so whatever the version is in |
Since |
@luigy if you want to take it it would be very much appreciated. All this GHCJS is some serious yack-shaving on my capstone project for school I'm worried I should soon be getting back too. :) |
I'd be open to adding some code to stack for the purpose of supporting ghcjs-boot's usecase, ideally remaining as generic as possible. |
* fetches version present in snapshot otherwise falls back to hackage * caches `preferred-versions` from index * only versions within `preferred-versions` are fetched unless explicitly asked by package identifier * added --latest flag to fetch latest version from hackage regardless of resolver
(CC @RyanGlScott, @vollmerm) Likewise, we expected to be able to pass Reading this issue it sounds like there's some consensus around giving stack the ability to unpack stack-dictated package versions. |
Agreed that we really should make this change. Hopefully we can get #1858 finished up for this release. |
Ideally, we would need to get the latest revision of |
We don't want to use the latest revisions, because that can make stack builds non reproducible. |
NOTE: Existing workThe PR for this has languished for a long time, so I've closed it - https://github.com/commercialhaskell/stack/pull/1839/files . Future efforts should use this as reference, as a lot of work already got done by @luigy here. One thing to note that that PR doesn't do is to also consider extra-deps. Hopefully with the implementation of #1265 there will be a straightforward way to implement a query of "What is the package version specified by a given stack.yaml configuration" |
This has already been fixed in Stack, closing. |
Steps to reproduce:
Run
stack unpack stack
Expected:
It unpacks the latest non-deprecated version (as of this filing,
stack-0.1.8.0
).Actual:
It unpacks
stack-9.9.9
, which is deprecated and unbuildable.The text was updated successfully, but these errors were encountered: