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 build in an empty directory downloads a new package cache #231

Closed
chreekat opened this issue Jun 9, 2015 · 8 comments
Closed

stack build in an empty directory downloads a new package cache #231

chreekat opened this issue Jun 9, 2015 · 8 comments
Assignees
Milestone

Comments

@chreekat
Copy link
Member

chreekat commented Jun 9, 2015

b@fuzzbomb ~/tmp/foo $ stack build
PackageNoCabalFileFound "/home/b/tmp/foo/"
Writing default config file to: /home/b/tmp/foo/stack.yaml
Downloading build plan from: https://raw.githubusercontent.com/fpco/lts-haskell/master/lts-2.13.yaml

That seems like extra work for a failure condition.

@snoyberg
Copy link
Contributor

snoyberg commented Jun 9, 2015

Well, it's not exactly a failure condition. There are legitimate use cases here, e.g.:

$ stack build
$ stack deps vector
$ stack ghci

So it seems at least somewhat reasonable for it to behave this way IMO.

@snoyberg snoyberg added this to the First stable release (0.1.0.0?) milestone Jun 9, 2015
@chrisdone
Copy link
Member

Perhaps an improvement to this behaviour would be explaining its intentions. I.e. "I don't have anything to do and I didn't find a cabal file, so I'm going to assume you want a configuration."

@chreekat
Copy link
Member Author

chreekat commented Jun 9, 2015

What is stack build being used for in that case?

How does that mesh with #59, and the idea that "It also caters to newbies reading books who just want to run ghc on a file. You can run stack ghc X.hs and it will download GHC if necessary, etc...". Would a yaml be created in the latter scenario? It would be nice if it wasn't necessary, since it is likely X.hs will be in a home directory, or in a directory full of other one-off test files.

@snoyberg
Copy link
Contributor

snoyberg commented Jun 9, 2015

Fair point, maybe we should just change behavior to exiting if there's no .cabal file present. We already have plans to improve stack ghci and friends so that they can run without a stack.yaml file, so perhaps this all adds up nicely.

@chreekat
Copy link
Member Author

chreekat commented Jun 9, 2015

@chrisdone, or: "I don't have anything to do. Shall I run stack init for you?"

@chrisdone
Copy link
Member

Fair points, indeed. I'm not really sure on this one. Going to think about it.

@snoyberg
Copy link
Contributor

Discussed with @chrisdone, we'll just exit stack.yaml construction if no .cabal file exists, and leave the rest of init to #253.

@snoyberg
Copy link
Contributor

OK, this is implemented, with the real solution to be handled via #253. Closing.

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

No branches or pull requests

3 participants