-
Notifications
You must be signed in to change notification settings - Fork 848
Is it expected that data files do not get installed to where bin is? #4857
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
Comments
Yes, this is a known issue — the same problem affects data files (e.g. with pandoc). I intend to add this to the wishlist — a brief summary description would be helpful. I suspect that the solution to this is related to #4243, which should also be added to the wishlist. Do let me know what you think. And thanks for raising the issue! (Edit: I suspect there may be a workaround — if you're interested I could ask around.) |
#848 is very much related to this. |
I've added that to the wishlist. |
It's by far our very oldest P1: Must issue. I wonder if the new |
I couldn't help but try this.
Following the above, When I did the same except skipped the |
I don't think so. All this would do is move the snapshot cache to a different location, but removing the snapshot cache would have the same effect as it does now. |
Part of the reason So here's my thought: what if One case this wouldn't cover is if one of the dependencies of the executable has data files that the executable needs. Handling that is more complicated and time consuming because it could mean having to rebuild a lot of dependencies as well. However, I can't think of any programs off the top of my head where this would actually be a required. @snoyberg what do you think of my simplified approach above? I think it may resolve the most common pitfall people run into. |
What would it take to avoid that (potentially expensive) rebuild? Could we at least avoid the first build if you call
|
Just a thought, if we cannot figure out a perfect solution soon, why not trying to use a stack bin folder which is managed (by stack), instead of installing to any unmanaged bin folder? The mechanism can be really simple. Install binaries into, for example ~/.stack/snapshots/happy/bin, then link into ~/.local/bin. So stack can check if the "command" is installed by stack. And if I removed the snapshot, the link would be dead with clear messages instead of something unpredictable (tools may or may not prompt for missing resource files, or just crash). |
@borsboom I think an approach like that could work. |
I believe this approach would, indeed, avoid the first build if you initially called |
* Fix destroot issue in binary caused by datadir in stack_root * Fix stack/cabal data-files hardcoded path issue with Paths_${name}.hs file * Allow initialization of proxy configuration files * See commercialhaskell/stack#848 * See commercialhaskell/stack#4857
* Fix destroot issue in binary caused by datadir in stack_root * Fix stack/cabal data-files hardcoded path issue with Paths_${name}.hs file * Allow initialization of proxy configuration files * See commercialhaskell/stack#848 * See commercialhaskell/stack#4857
@Magicloud, your notes here are similar to what I've posted about in https://discourse.haskell.org/t/how-to-fix-package-breakage-due-to-file-corruption-stack/2366, so maybe I've stepped on the same issue you have with happy? I read through the comments here, and maybe I missed it, but I'm not really following: is there a short-term work around for this while the more ideal cc @borsboom |
@ketzacoatl I think it is. |
For example, hackage happy, which contains some resource files like HappyTemplate-arrays-coerce in share folder.
Now that
stack
installs the executablehappy
in ~/.local/bin, but leaves the resources in ~/.stack/snapshots. If I remove the snapshots to release the disk space,happy
breaks.Wondering if there can be a solution.
The text was updated successfully, but these errors were encountered: