-
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 hmatrix is ugly #1463
Comments
This category of use case is pretty much what my colleague @YPares's @tweag work on Nix support for Stack is meant to help. The idea is: leverage an existing lightweight system to install system packages (such as OpenBLAS) with project-local scope (so no global install and then pointing to Stack the exact location required). See PR #1285. It's a cross platform solution, so should work where Docker does not ( |
@ndmitchell It's actually |
@YPares - thanks - that's pulled from the hmatrix website, and in this case, I think the command line parser should be smart enough to default if there is only one prefix. @mboes / @YPares - what would this look like as someone who wants to use a package the depends on hmatrix? Would I have to do anything, or would hmatrix have to tweak their stack.yaml to add Nix info? My guess is that Nix on Windows is not that great (it's a weird intersection of people), but only way to be sure is try it and find out. |
The Nix support conforms to the existing Stack model. That is, if you want to build a project, it'll do its magic and transparently deal with all dependencies (haskell or system) for you. It doesn't deal with libraries or apps installed using the global stack config. And owing to the fact that projects are non-compositional, if you're building your own project, you'll have to copy the relevant snippets (e.g. the So if you want to build an app that uses hmatrix, if the author of that app added a |
That's a little unfortunate. If I am using hmatrix, as a transitive dependency (e.g. I'm really using hnn), then I don't want to care about hmatrix at all - it's entirely an implementation detail of a library I care about. Couldn't Stack/Stackage suck the Nix bits out of the stack.yaml if the hmatrix author included it? Or maybe have some extra metadata somewhere? You can put custom metadata in a Cabal project I think (something like beginning with X or some other prefix) which might work too. Until |
I agree. That's just the limit of the model that consists in pushing more and more metadata into the stack.yaml, which is for project metadata, not package metadata. If you want to make packages self contained, then as you say, the right place to push the metadata is in the .cabal I think, and to ideally have the Cabal library deal with it (it just takes invoking nix-shell during evaluation of Setup.lhs, which would transparently make the required system libraries available). |
Maybe if a custom Setup.hs detected an environment variable STACK and then wrote out some information in a predictable file location (perhaps given by the env var), then Stack would know what needed to be done? |
IIUC, the .cabal file can't accept relative paths; I mention this because I'm working on a package that has to build an FFI dependency and link the dynlibs from GHC afterwards. I use the "ugly" workaround of specifying |
Isn't "pkgconfig" the way for cabal files to specify these dependencies? |
Yes and no. pkgconfig names don't always correspond to the distro package names. Which in any case change from distro to distro. |
Distros could provide a (system-wide) config file that maps the pkgconfig names used on Hackage to the package name that's appropriate for that particular distro. That is what |
For whom it may be useful: I use NixOS and wanted to install SubHask, which requires HMatrix to be exactly 0.16.1.5. This is how my
|
#2122 is also somewhat relevant. It would allow |
I am closing given the lack of activity over a long period of time and Stack and |
Currently installing hmatrix with stack is difficult. The advice is to download some files then do:
Alas, that doesn't work because
extra-include-dir
is not a valid flag anymore. But either way, it would be nice if it was simpler and didn't require any download or complex messing around.The text was updated successfully, but these errors were encountered: