-
Notifications
You must be signed in to change notification settings - Fork 841
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
Provide method for installing resolver-independent compiler-specific binaries #1796
Comments
This has been previously discussed here: #662 That said, generalizing the stuff |
Minor annoyances without this feature (using
As you say, it's not a big priority, since most users don't use multiple versions of the compiler in their development and can But it would be nice. |
I consider that to be a ghc-mod bug, and I'm not sure why it still doesn't check ghc version.
It should share the ghc-mod library, which is the majority of compilation time. So the main cost is the time to link the binary, and hard drive space for the binary.
Fair point. A workaround is to compile ghc-mod with a resolver / extra-deps that work, and manually copy it into your project or snapshot's bin dir.
What's wrong with it? My understanding is that @DanielG does not regularly use stack to build ghc-mod, so the stack.yaml doesn't get maintained. ghc-mod should really run "stack build" on travis CI. Maybe open an issue on the ghc-mod tracker about it? |
This bug in particular. But I ran into what might be the same issue with Liquid Haskell (here), and I'm sure there will be more projects which rely on the GHC they're using being the same as the one used to compile them. It's fine to say that they all should check versions, but that doesn't save the hapless programmer who has to spend time debugging PATH issues.
I thought it could only do sharing if all dependencies are also shared, in which case there's a lot less sharing between distant lts versions.
At that point, why not just copy it into the
Nothing, but I can't use it if I already have a different |
Yeah, there's also this PR - DanielG/ghc-mod#687 . I believe the reason it didn't get merged is that it'd add overhead to every ghc-mod invocation, which happens for every query. My proposed solution is to run the ghc version check whenever compilation fails. This may add a bit of overhead before ghc-mod exits, but hopefully the editor will display this output before it exits.
True! I suppose it is rather rare that you can avoid recompiling the ghc-mod library
Valid! You could already do EDIT: Ooh, based off the text of your issue, maybe |
|
Yeah, it's probably better to put things in a I wonder if it'd be best to put it in a separate |
@mgsloan the ghc-mod PR didn't get merged since it's unfinished and I haven't found the time to work on it, not because anything is wrong with it. Just FYI. Probably a silly idea but how about looking at a binary's build-dependencies and when they include |
@DanielG Interesting idea! Not all uses of ghc need to match the project's version, since they might not need the dist dir. However, in the name of consistency it does make sense to try to use binaries which use the exact same ghc version. |
We could add a field to the package's cabal file, something like |
Yeah, it'd be nice if it just "did the right thing" without the user thinking about it. Adding this degree of magic seems like it could potentially be confusing. It should come with a big notice in the output that "Hey I did something magical! Disable this magic with --no-magic". One question is whether this magic would still be in effect when |
|
Hey all! Given that intero and other tools will benefit greatly from this, I have summarized our conclusions in #2643 , and so will close this discussion issue. @rpglover64 I do not think |
In particular, I'm thinking of
ghc-mod
(butliquid
might also be in this boat).stack exec
sets the binary path to include the snapshot's bin directory and the compiler's bin directory (where things likeghc
andhaddock
can be found). There is currently no high-level way to add a binary to all projects using the same compiler version; you could manually copy the binary to the same directory asghc
, but this doesn't seem like an ideal solution.These binaries are typically installed for a user but, once compiled, care only which
ghc
version compiled it, not the snapshot it was compiled with.The text was updated successfully, but these errors were encountered: