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

Feature request: stack configure #820

Closed
scturtle opened this issue Aug 19, 2015 · 6 comments
Closed

Feature request: stack configure #820

scturtle opened this issue Aug 19, 2015 · 6 comments

Comments

@scturtle
Copy link

As adding stack support to ghc-mod at ghc-mod/pull/549, we find that it would be helpful to have a command stack configure which should be similar to cabal configure. So that when the cabal file changes, the setup files can be updated without compile the project again :)

BTW: Locking messages at src/main/Main.hs#L586-L587 are printed to stdout and confuse us when using stack path. It would be nice to print them to stderr or add a '--quiet' option.

@snoyberg
Copy link
Contributor

I'm a bit hesitant about adding this, for multiple reasons:

  1. I don't want to add to the confusion of cabal users thinking that configure is a necessary part of the stack workflow (since it isn't)
  2. This would have weird behavior in multi-package projects. For example, if you have foo and bar in a project, and bar depends on foo, you can't configure bar until you build foo. I'm not sure how this kind of interface would tie in to that.

Do you have any thoughts on these?

(I'll look into those locking messages, they definitely shouldn't be on stdout.)

snoyberg added a commit that referenced this issue Aug 20, 2015
@DanielG
Copy link
Contributor

DanielG commented Aug 21, 2015

  1. How about just a sub-command then, something like stack build --only-configure. That would make it somewhat clear that the configure step is a subset of the build command.

  2. It would be fine if the configure command built all dependent packages before configuring the current project. As far as ghc-mod is concerned we just need to get a setup-config through whatever means necessary. We recently added a way for ghc-mod to communicate log messages to the editor as well so we could show the output of the configure command doing it's thing as it's happening so the user isn't worried about a command taking forever.

snoyberg added a commit that referenced this issue Aug 23, 2015
@snoyberg
Copy link
Contributor

I've added an --only-configure option. However, I haven't implemented the full details you listed in (2), as that's quite a bit more complicated. Instead, the flag simply does not perform build and install. You should be able to get the behavior you're expecting with:

stack build --only-dependencies <package-name>
stack build --only-configure <package-name>

@DanielG
Copy link
Contributor

DanielG commented Aug 24, 2015

Looks good. What stack version is this going in do you think? Should I check stack is >= 0.1.4 before using --only-configure? Also there doesn't seem to be a --numeric-version command like all the other build tools (ghc and cabal) have, mind adding one so I don't have to parse the format of --version which seems to depend on if stack was built from git or not and would probably be fragile anyways.

@snoyberg
Copy link
Contributor

It should be in 0.1.4. Can you open up a separate issue about
--numeric-version?

On Mon, Aug 24, 2015 at 1:47 PM, Daniel Gröber [email protected]
wrote:

Looks good. What stack version is this going in do you think? Should I
check stack is >= 0.1.4 before using --only-configure? Also there doesn't
seem to be a --numeric-version command like all the other build tools
(ghc and cabal) have, mind adding one so I don't have to parse the format
of --version which seems to depend on if stack was built from git or not
and would probably be fragile anyways.


Reply to this email directly or view it on GitHub
#820 (comment)
.

@DanielG
Copy link
Contributor

DanielG commented Aug 24, 2015

Sure

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