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

Wishlist: `stack run` #233

Closed
andrewthad opened this Issue Jun 9, 2015 · 16 comments

Comments

Projects
None yet
7 participants
@andrewthad
Copy link

andrewthad commented Jun 9, 2015

It would do the same thing as cabal run. For now, I can make due with a bash script I have, but this would be a good thing to add at some point.

@chrisdone

This comment has been minimized.

Copy link
Member

chrisdone commented Jun 9, 2015

Also: For now you can do stack build && stack exec foo.

@andrewthad

This comment has been minimized.

Copy link

andrewthad commented Jun 9, 2015

I was unaware of that. Good to know.

@chrisdone

This comment has been minimized.

Copy link
Member

chrisdone commented Jun 9, 2015

(Because stack build installs the packages into the ~/.stack-work/ dir and stack exec runs things with that in its PATH.)

@snoyberg snoyberg added this to the First stable release (0.1.0.0?) milestone Jun 10, 2015

@snoyberg

This comment has been minimized.

Copy link
Contributor

snoyberg commented Jun 11, 2015

Given that stack build && stack exec foo works pretty well for this, do you have any objection with sticking to that as the recommended workflow? I'm concerned about using up the command namespace for something general like run with something that's easily achieved in another way.

@cocreature

This comment has been minimized.

Copy link
Contributor

cocreature commented Jun 11, 2015

imho the current state is fine as long as there is some documentation. I didn't understand that this works before finding this issue.

@cocreature

This comment has been minimized.

Copy link
Contributor

cocreature commented Jun 11, 2015

I added it to the transition page on the wiki.

@snoyberg

This comment has been minimized.

Copy link
Contributor

snoyberg commented Jun 11, 2015

Cool, good call. I was about to ask you where you thought a good place would be to cover that.

@cocreature

This comment has been minimized.

Copy link
Contributor

cocreature commented Jun 11, 2015

I am actually not quite sure what belongs to faq and what belongs in the transition page. I imagine the questions people ask most frequently are probably related to a transition so it's hard to make that distinction.

@chrisdone

This comment has been minimized.

Copy link
Member

chrisdone commented Jun 14, 2015

So we close this one?

@snoyberg

This comment has been minimized.

Copy link
Contributor

snoyberg commented Jun 15, 2015

@cocreature I agree, it's unclear what should go where. We may need to change the break-up of the pages, it was just the first thing that came to mind when I started on it. Suggestions welcome!

@chrisdone Yes, let's close it.

@johnynek

This comment has been minimized.

Copy link
Contributor

johnynek commented Aug 9, 2015

What if stack exec without args ran the first (is more than one allowed?) executable in the .cabal file? Right now, without args you get a help message (which could be there with stack exec --help?).

@Wizek

This comment has been minimized.

Copy link

Wizek commented Mar 30, 2018

+1 for stack run. I find myself reaching for it quite a few times. I have a workaround script installed in my main dev env named stack-run, but whenever I install stack on another machine I get surprised that it's unavailable. Also would be nice for it to work like cabal run.

@snoyberg You mention a concern about command namespace filling up. Are you still concerned with that? If so, can you imagine any competing feature(s) that might have a claim for stack run that would not do the same/something similar to cabal run?

@snoyberg

This comment has been minimized.

Copy link
Contributor

snoyberg commented Apr 1, 2018

@rszibele rszibele referenced this issue Apr 1, 2018

Merged

Introduce `stack run` command line option #3952

1 of 1 task complete
@Wizek

This comment has been minimized.

Copy link

Wizek commented Apr 5, 2018

Hey @rszibele, thank you for starting to work on this and submitting a PR, I hope the feature will get merged.

Wrt 'general desire' for the feature, there is also this related stack overflow question: https://stackoverflow.com/questions/34842333/is-there-a-stack-run-similar-to-cabal-run/35107441

@rszibele

This comment has been minimized.

Copy link
Contributor

rszibele commented Apr 15, 2018

Would there be any objections to being able to specify in the stack project which executable should be run by stack run and fall back on running the first available executable if it isn't defined?

@Wizek

This comment has been minimized.

Copy link

Wizek commented Apr 16, 2018

@rszibele no objection from me. I'm not even sure if cabal had support for such a configuration, and I was able to use it fine without, so this is not a requirement from me. Many of my projects build a single executable anyway, but that may change. So I guess it's not required, but could be nice to have.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment