-
Notifications
You must be signed in to change notification settings - Fork 843
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
Installing executables (was: yesod-bin as "extra build tool") #153
Comments
It's not an extra build tool in the sense of the others, since it's not used during the build process in order to compile your code. alex and happy are dependencies of the build, whereas yesod-bin is a user-facing tool. I can add that distinction to the README if it's clear (or, if you'd like, please modify the README yourself for clarity). Now actually using |
I felt a twinge writing this ticket because it wasn't very focused, so I'm glad we agree on the definition of a build tool. This might not be the place to talk about it, but I guess the underlying question is, is it within stack's scope to set up (Haskell) binaries where a user can get to them? I want to say no, because the two tasks seem very different, yet the two tasks share many identical pain points that stack is designed to solve. |
So firstly, we have part of a solution with the I was talking about the lack of an
Perhaps I'm overthinking this and we should just provide
|
I would say you use a completely different name precisely because so much of the confusion around cabal stems from the fact that 'cabal install' and 'cabal build' are such different commands. Better to avoid that legacy. The tradeoff, of course, would be having two separate commands. That would be acceptable to me, but if it's too much, perhaps one could use 'install-tool' instead of 'install'? As for where to install, I would suggest ~/.local/bin. It's a can of worms, but npm uses it, and apparently python too. Fedora supports it out of the box, but I had to add it to my PATH manually on Ubuntu. Using ~/.local/bin would be a nice shortcut for me because I already sandbox-build tools and copy them there manually. :) |
So to summarize, I'm seeing the following work items coming out of this:
Does that sound reasonable? |
In addition to copying, install-tool should also do stripping. That can reduce the size of a Haskell executable by ~40%. |
👍 |
That said, with the new DWARF support in GHC 7.10, the extra debug info
that strip removes become very useful (e.g. for performance profiling).
There's something to be said about being able to quick and dirty perf
analysis by default for an haskell executable. Is the executable size an
issue?
|
This is now implemented. Some details:
Now that I've implemented this, I'm beginning to think I made a mistake about saying we should give it a name besides |
Fixing the Windows upgrade problem was easy, and I've implemented it. But I forgot to mention: there's some discussion warranted around the path on Windows. Currently, it's using directories like C:\Users\Michael\AppData\Roaming\local\bin. Any better ideas? |
I have no problem with Does it work for non-local targets? E.g. I may want to just say |
Yes, it should. One thing we could consider is figuring out good behavior for running |
My real preference is to have two commands with the same distinction as If a command is to do both, it may as well be called On Wed, Jun 10, 2015 at 4:47 AM, Michael Snoyman notifications@github.com
|
Right now, if you run stack install pandoc outside of a project directory, you'll be guaranteed to get the version from upstream, which may be pretty close to what you're looking for |
Aye, but if I run Well, except for the following:
|
That might be that the buildable flag isn't being tracked properly right On Wed, Jun 10, 2015, 5:44 PM Bryan Richter notifications@github.com
|
Is yesod-bin an "extra build tool"?
From the FAQ:
yesod-bin is not technically required, as anyone can use Yesod libraries without bothering with yesod-bin. However, I want it to be available to my project's contributors with a minimum of fuss. Should stack solve this problem for me?
Self-answer: Yes. I can add yesod-bin as an extra-dep, and then 'stack exec yesod' works. Still, the difference between yesod-bin and e.g. happy are a bit magical to me. Do you just have a list of packages known to need a particular tool? What distinguishes them from tool XYZ, needed to build XYZmabob? Will I still need another build tool on top of stack to solve the general problem? Why don't I have to add 'happy' as an extra-dep?
The following issue seems sufficiently related:
yesod-bin as extra-dep
After I add yesod-bin to extra-deps and rebuild, the following occurs:
The text was updated successfully, but these errors were encountered: