-
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
Stack install should take a --path option #342
Comments
I do a similar thing. This feature would be nice to have. |
I was a bit surprised to see |
See the discussion in #153 |
That was my idea, here. It's a standard-that-isn't, but one I'm comfortable pushing towards being de facto. |
@chreekat re: |
@bitemyapp ~/.local is XDG, yes. ~/.local/bin is not specified (yet). As I mentioned in my linked comment, it's nonetheless supported and used by other projects already. |
I like the idea of |
But the point of installing is to make the binary available outside the stack world. For within stack, you can just use |
Adding it to XDG seemed to stall, if I read the Fedora thread I linked to in my linked comment correctly, because it was new and therefore scary to seasoned UNIX veterans. e.g., "Oh it seems very useful for purposes like installing executables that most users will never find." and "[The arguments for adding it are] bogus because this is the first I've heard of ~/.local/bin, speaking as a Unix user since long before Linux existed." @gregwebs that's a fair point — once we're installing into a "standardized" location, we're back at needing a system-wide package manager to manage conflicts. Yikes? |
@chreekat I think OTOH, I've found adding |
@snoyberg This is actually blocking me slightly on #353, where I want to use stack to build the git version of it self inside a chroot. I just want to put install the bin to a fixed location relative to the build directory. It seems like a straightforward addition to me. Do you have any thoughts on where the flag should go, in |
Neither. It should only apply to the install command. |
@snoyberg code review requested for my proposed changes at I'll want to add support for relative dirs before opening a PR. |
It's easier to comment on a PR than a compare, so I'll hold off comments until that's ready. |
It would also be useful if |
It's probably a good time to ask if stack is expected to generate anything else than binaries ? Usually |
@zimbatm Personally I don't think it's a good idea to make stack a user-facing installation tool. It's meant for developers, and it's annoying as a user to have to install something like stack before being able to install some program I want to run. However, I think it would be a great idea for stack to have plugins to create distributable artifacts in various formats: for example, windows MSIs , Debs, RPMs, etc. |
@radix actually the use-case I have in mind is packaging. Most of them want an install to "$DEST/$PREFIX" where DEST is a temporary root and PREFIX is the path where the files will end up once installed. Eg: |
@zimbatm so ok, then that just means in your debian script (or whatever) you'll just need to invoke |
This is exactly my usecase (as a packager) and some Haskell software (e.g. pandoc) installs also to /usr/share... |
Functionality for |
I tend to keep my user binaries in ~/bin instead of ~/.local/bin. The directory path seems to be set in.
getAppUserDataDirectory is defined in
System.Directory
. Is it should return $HOME/.local always, so it doesn't appear to be able to take a flag or anything. The install function takes bothBuildOpts
andGlobalOpts
parameters, so perhaps such a parameter could live in one of there as a Maybe and be passed as a --path option from the command line.stack/src/main/Main.hs
Line 346 in 118cb3e
The text was updated successfully, but these errors were encountered: