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 solver --update-config does not update the config if the resolver changes #2252

Closed
nomeata opened this Issue Jun 7, 2016 · 1 comment

Comments

Projects
None yet
5 participants
@nomeata

nomeata commented Jun 7, 2016

I tried to use

stack solver --update-config --resolver lts-6

to change my stack.yaml from a different resolver. This works if stack solver has to apply other changes (extra-deps for example). But if the yaml requires no change but the resolver field, then stack solver says:

test -z "$STACK" || echo "resolver: lts-1.0" > stack.yaml # dummy value
test -z "$STACK" || stack solver --update-config --resolver "$STACK"
Selected resolver: lts-3.22
Using configuration file: stack.yaml
Using cabal packages:
- arbtt.cabal

No changes needed to stack.yaml
@harendra-kumar

This comment has been minimized.

Collaborator

harendra-kumar commented Jun 7, 2016

Yeah I know it does not work. We do not detect and account a resolver change. I intended to detect the resolver change and recorded it as a todo but never got back to it. Should be easy to fix though, we will have to check if the resolver is different than the one in the config file and treat that as a change right away. Here is the code in Solver.hs:

        changed =    any (not . Map.null) [newVersions, goneVersions]
                  || any (not . Map.null) [newFlags, goneFlags]

    if changed then do
        $logInfo ""
        $logInfo $ "The following changes will be made to "
                   <> T.pack relStackYaml <> ":"

        -- TODO print whether resolver changed from previous
        $logInfo $ "* Resolver is " <> resolverName resolver

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment