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 init should try to create a stack.yaml even if it cannot download the snapshot list #1374

Closed
sjakobi opened this issue Nov 19, 2015 · 6 comments

Comments

@sjakobi
Copy link
Member

sjakobi commented Nov 19, 2015

$ stack init --force
Writing default config file to: /home/simon/src/stack/test/integration/tests/1198-multiple-exes-with-same-name/files/stack.yaml
Basing on cabal files:
- /home/simon/src/stack/test/integration/tests/1198-multiple-exes-with-same-name/files/has-exe-foo.cabal
- /home/simon/src/stack/test/integration/tests/1198-multiple-exes-with-same-name/files/also-has-exe-foo/also-has-exe-foo.cabal
- /home/simon/src/stack/test/integration/tests/1198-multiple-exes-with-same-name/files/has-exe-foo-too/has-exe-foo-too.cabal

Unable to download snapshot list, and therefore could not generate a stack.yaml file automatically
This sometimes happens due to missing Certificate Authorities on your system. For more information, see:

    https://github.com/commercialhaskell/stack/issues/234

You can try again, or create your stack.yaml file by hand. See:

    https://github.com/commercialhaskell/stack/blob/release/doc/yaml_configuration.md

Exception was: FailedConnectionException "s3.amazonaws.com" 443
There was no snapshot found that matched the package bounds in your .cabal files.
Please choose one of the following commands to get started.


You'll then need to add some extra-deps. See:

    https://github.com/commercialhaskell/stack/blob/release/doc/yaml_configuration.md#extra-deps

You can also try falling back to a dependency solver with:

    stack init --solver

Instead of giving up and pointing me at internet ressources right when I seem to have connectivity problems, stack should have created a stack.yaml using the latest snapshot on the system.

The output here could take some improvements too:

  • Writing default config file to: /home/simon/src/stack/test/integration/tests/1198-multiple-exes-with-same-name/files/stack.yaml isn't quite correct: the stack.yaml isn't generated.
  • Please choose one of the following commands to get started. <...nothing>?
  • The sample project in this case doesn't need any extra-deps.

Also, couldn't the documentation I'm referred to be installed my system instead?

@mgsloan mgsloan added this to the P2: Should milestone Nov 21, 2015
@mgsloan
Copy link
Contributor

mgsloan commented Nov 21, 2015

I agree that the things you pointed out about the output should get fixed.

Instead of giving up and pointing me at internet ressources right when I seem to have connectivity problems, stack should have created a stack.yaml using the latest snapshot on the system.

One thing I don't like about this is that the user would have to look at the output to notice that the behavior has changed due to connectivity issues. How about instead having a --no-download flag or -offline? Feel free to add something like this :)

Also, couldn't the documentation I'm referred to be installed my system instead?

That would be nice, I'm not sure how we'd do that, though. Maybe compile the markdown to html? The markdown is included in the source distribution, but

@sjakobi
Copy link
Member Author

sjakobi commented Nov 21, 2015

One thing I don't like about this is that the user would have to look at the output to notice that the behavior has changed due to connectivity issues. How about instead having a --no-download flag or -offline? Feel free to add something like this :)

Wouldn't a warning like Unable to download snapshot list. Using the latest snapshot available (lts-X.Y). be enough?

That would be nice, I'm not sure how we'd do that, though. Maybe compile the markdown to html? The markdown is included in the source distribution, but

Seems like part of your response was lost. I've moved this idea to #1395.

@mgsloan
Copy link
Contributor

mgsloan commented Nov 22, 2015

Wouldn't a warning like Unable to download snapshot list. Using the latest snapshot available (lts-X.Y). be enough?

That could be enough. I don't like the idea of the behavior changing due to exceptional cases, though. What if it's some failure other than not being connected to the internet? So, I'd prefer having a --no-download flag, and have the message look like this:

$ stack init --force
Writing default config file to: /home/simon/src/stack/test/integration/tests/1198-multiple-exes-with-same-name/files/stack.yaml
Basing on cabal files:
- /home/simon/src/stack/test/integration/tests/1198-multiple-exes-with-same-name/files/has-exe-foo.cabal
- /home/simon/src/stack/test/integration/tests/1198-multiple-exes-with-same-name/files/also-has-exe-foo/also-has-exe-foo.cabal
- /home/simon/src/stack/test/integration/tests/1198-multiple-exes-with-same-name/files/has-exe-foo-too/has-exe-foo-too.cabal

Unable to download snapshot list, and therefore could not generate a stack.yaml file automatically
This sometimes happens due to missing Certificate Authorities on your system. For more information, see:

    https://github.com/commercialhaskell/stack/issues/234

You can try again, or create your stack.yaml file by hand. See:

    https://github.com/commercialhaskell/stack/blob/release/doc/yaml_configuration.md

Exception was: FailedConnectionException "s3.amazonaws.com" 443
Use the "--no-download" flag to skip this download and instead only use locally installed snapshots.

It should fail at this point and not print the rest of the output.

@borsboom
Copy link
Contributor

The idea sounds fine to me as well, and I agree about making it an explicit flag. A pull request would be welcome.

@borsboom borsboom modified the milestones: P3: Optional, P2: Should Nov 22, 2015
@harendra-kumar
Copy link
Collaborator

The message about writing to the file coming even when not actually modifying the file is fixed via PR #1583 .

@sjakobi
Copy link
Member Author

sjakobi commented Jul 14, 2016

#1594 encompasses this issue.

@sjakobi sjakobi closed this as completed Jul 14, 2016
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

4 participants