-
Notifications
You must be signed in to change notification settings - Fork 37
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
Fix pattern errors in windows #93
Conversation
The errors calling
This one (you can see it here) is fixed by the patch.
Unfortunately the error is not very specific |
Seems pretty specific to me: I think you guys really should be capturing stderr for the tests, otherwise that sort of thing is going to remain a mistery. But honestly it's probably quite difficult to do with hspec because of it's parallel test support. I'd use something else for integration tests like this TBH. (If you find a good alternative let me know, I just roll my own ATM :) |
3b77386
to
a54febb
Compare
After replacing the missing pattern case with an error i can see the following in azure ci:
However it seems being cabal-helper/src/CabalHelper/Compiletime/CompPrograms.hs Lines 59 to 65 in c677e72
If all the three programs follow that scheme... So it seems not all follow it but |
With the last commit (87f41cf) the build with stack and ghc-8.6.4 return to green: |
87fc71f
to
2812d43
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This smells pretty hacky to me overall, I think you're trying to paper over a symptom not the root cause here.
From some more staring at the existing code I notice two problems:
- I'm using
withSystemTempDirectory
which will remove the tempdir afterpatchBuildToolProgs
returns, that can't be right :) GHC.configure
doesn't actually require haddock to be present, that together with yourError trying to create symlink to haddock: haddock executable not found
error from above makes me think that's probably the real problem we have here.
So instead of deciding whether to create the symlink based on the respective setting being non-default I think you should check if the program was found and skip creating the symlink if not, but only for haddock, since ghc and ghc-pkg are legitimately required (though GHC.configure will already have errored out about that).
when (ghcPkgProgram progs /= "ghc-pkg") $ | ||
createProgSymlink bindir $ ghcPkgProgram progs | ||
when (haddockProgram progs /= "haddock") $ | ||
createProgSymlink bindir $ haddockProgram progs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty sure this isn't going to work either. IIRC Stack will search for the ghc related tools in the directory it found ghc.
So if ghc is unqualified here but the other tools aren't we create the symlink farm but stack will search for ghc, find it on PATH, say in /usr/bin or something and pick up ghc-pkg and haddock from there too instead of the ones the user specified.
Also you're not handling the case where the tools are unqualified but have a version postfix.
ok, with 257273c i think i've adressed:
About:
and your alternative proposed in irc:
do you think we could merge the pr as is (the code will be reused in the alternative)? |
257273c
to
83f1af4
Compare
Detected in the azure ci of haskell-ide-engine
I am pretty sure one of the errors (in
createProgSymlink
) is fixed:The other one (
Stack.paths
) is intermittent and this patch does not fix it, only move it up. I think it should be handle there. However it removes the missing pattern and makes it a little bit more resilient againststack path
format changes. I think the error is triggered cause thestack path
output is an error but i am not able to replicate it in local.I've added
-fwarn-incomplete-uni-patterns
to cabal config but maybe you are fine without them, i will remove in that caseFixes Runtime errors using stack and ghc-8.6.4/ghc-8.4.4 on windows #91