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

Comments

Projects
None yet
3 participants
@scturtle

scturtle commented Aug 19, 2015

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

This comment has been minimized.

Contributor

snoyberg commented Aug 20, 2015

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

Replace some stdout output with stderr #820
@chrisdone see anything wrong with this?
@DanielG

This comment has been minimized.

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

This comment has been minimized.

Contributor

snoyberg commented Aug 23, 2015

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>

@snoyberg snoyberg closed this Aug 23, 2015

@DanielG

This comment has been minimized.

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

This comment has been minimized.

Contributor

snoyberg commented Aug 24, 2015

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 notifications@github.com
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

This comment has been minimized.

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