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

stack.yaml.lock is not created when --resolver option is used. #5492

Closed
debug-ito opened this issue Feb 23, 2021 · 2 comments
Closed

stack.yaml.lock is not created when --resolver option is used. #5492

debug-ito opened this issue Feb 23, 2021 · 2 comments

Comments

@debug-ito
Copy link

I use stack 2.5.1 on Linux.

stack doesn't create stack.yaml.lock file when --resolver option is used.

For example, the command stack clean (with stack.yaml file in the working directory) creates stack.yaml.lock file. stack --resolver lts-16.11 clean doesn't create stack.yaml.lock file.

Is this an expected behavior?

@mpilgrem
Copy link
Member

@debug-ito, thanks for asking. The short answer is: Yes.

When you override the resolver (--resolver option) the default lock file behaviour is set to 'read only'. That happens in Stack.Options.GlobalParser.globalOptsFromMonoid (extract):

  pure GlobalOpts
...
    , globalLockFileBehavior =
        let defLFB =
              case getFirst globalMonoidResolver of
                Nothing -> LFBReadWrite
                _ -> LFBReadOnly
        in  fromFirst defLFB globalMonoidLockFileBehavior
    }

and that is documented online here: https://docs.haskellstack.org/en/stable/global_flags/#-lock-file-option.

@debug-ito
Copy link
Author

Thanks for explanation!

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

No branches or pull requests

3 participants