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 sdist" does not include stack.yaml file by default #2105

Closed
varosi opened this issue May 5, 2016 · 9 comments
Closed

"stack sdist" does not include stack.yaml file by default #2105

varosi opened this issue May 5, 2016 · 9 comments

Comments

@varosi
Copy link

varosi commented May 5, 2016

Currently when I do "stack sdist" it include *.cabal files, but doesn't include stack.yaml. So after distribution I cannot build what's in the archive with stack anymore.

Stack version 0.1.8.0 x86_64

@mgsloan
Copy link
Contributor

mgsloan commented May 5, 2016

@varosi Since sdists are typically used for hackage, they do not need to include stack.yaml files. That said, I can see it being valuable metadata to include.

I can think of just one potential downside, which is that if you stack unpack a package into your project, and then cd into it, you might expect stack build to build the project you're working on, and not the inner stack.yaml. One solution to this could be to warn when there are multiple stack.yamls on the path.

I think the upsides outweigh the downside, I'm in favor of making that change.

Also, that stack version is old, you should probably upgrade.

@mgsloan mgsloan added this to the P3: Optional milestone May 5, 2016
@borsboom
Copy link
Contributor

borsboom commented May 5, 2016

You can also put this in your .cabal file:

extra-source-files: stack.yaml

@varosi
Copy link
Author

varosi commented May 6, 2016

@borsboom, Thanks!

@mgsloan, it will be really great! Because I hit this problem for the second time.

@seagreen
Copy link

Yikes, that will be confusing for people who didn't intend to include stack.yaml in their upload.

@varosi
Copy link
Author

varosi commented May 10, 2016

I'm just giving it "stack sdist" to distribute whole package, not to upload
it to Hackage.

2016-05-10 23:14 GMT+03:00 Ian Jeffries [email protected]:

Yikes, that will be confusing for people who didn't intend to include
stack.yaml in their upload.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#2105 (comment)

@mgsloan
Copy link
Contributor

mgsloan commented May 10, 2016

One reason to include it in the package is a future feature like #2122

@quasicomputational
Copy link

How would this work for megarepos, where each project is in a subdirectory and there's a top-level stack.yaml?

@mgsloan
Copy link
Contributor

mgsloan commented Dec 9, 2017

@quasicomputational Great question. It should be possible to generate an appropriate stack.yaml for each. This would look like:

  1. Remove the packages list (implicitly it's just the current directory).

  2. Add extra-deps for every local package that it depends on.

With current YAML decoding / encoding, this would forget about any of the user's ordering, comments, or layout. But it should work. Doing better would be somewhat tracked by #115

@snoyberg
Copy link
Contributor

snoyberg commented Apr 5, 2019

Being explicit about listing the file in extra-source-files as mentioned above is the best approach, closing

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

6 participants