-
Notifications
You must be signed in to change notification settings - Fork 710
Cabal cannot find GHC when using relative path in -w flag #758
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
(Imported comment by @dcoutts on 2010-11-19) Presumably due to cabal-install changing the current directory when it builds the package in question. See |
Any solution suggestions as I got a similar error here ? When I was trying to build an operating systems and the course requires that ghc and cabal should be installed, and because I am trying to do it on a ubuntu 12.04 hegazy@AHegazy:/sbin$ cabal install ghc-paths unrecognized option `--disable-benchmarks' I will be grateful if you listed how did you solve this thing happened to you ?! |
Thanks byorgey, you are right it worked. |
This is still an issue on windows using:
|
Could someone with access to a Windows machine try this? (@jneira?) It works fine on Linux. At least, we could stick the |
Thanks for the mention, i have been able to test it amd it works for me using |
Still broken for me:
|
@AndreasPK: does |
cabal build behaves quite strangly:
|
very weird, i've tried to get close to @AndreasPK use case, using msys2 console, with ghc-8.10.7 and 9.2.1 (i dont have a ghc built from source at hand) and trying cabal build and install and i cant reproduce 🤔 :
Dont know where could be the difference, could you create a fresh simple cabal project like i did? i even would use a fresh cabal global config just in case. Another check could be use a ghc release (like mine one from ghcup) or start the path with |
What I observed was that the configure step of a dependency failed. By extension this would mean if you (re)compile a project where all dependencies are already available your build might succeed. Which would explain the difference. |
Good point, still cant reproduce with I wonder if cabal does not like the ghc dir layout, checking a regular distribution may discard it. Otoh unix like paths are source of problems so maybe trying |
I did try I just tried it quoting the compiler path Same for a windows-style path: cabal build -w "..\ghc_master\_dwarf\stage1\bin\ghc.exe" It seems the path isn't turned into an absolute path for configure because with high verbosity I see:
Of particular note being that there is an absolute path for ghc-pkg but a relative path for ghc and this error message:
It's supposed to be a relative path and NOT something in path. I think this happens because in
and |
It seems to work with the version of cabal I built from source today. |
weird, I've observed my cabal version mentions Cabal-3.6.2.0 and yours 3.6.3.0, not sure if it would be related |
Actually, Cabal 3.6.3.0 has been released (but not cabal-install 3.6.3.0). I don't remember what the changes were, but I think they were requested by the kind GHC folk. I wonder how master branch would fare... |
I did test master (0a2e68c) and it worked there. |
Great news. I hope that means 3.8 has the fix, too, whatever it is. Is it important that we identify which PR fixed this, or can we close as is? |
For me closing as is is fine. |
Thank you all. Closing. |
I just encountered this, using cabal-3.10.1.0 on Linux, while trying to build with a modified GHC 9.4.4.
Using an absolute path solves the issue. |
@konsumlamm thank you for reporting! Would it be possible to try cabal 3.8 on your end? |
With cabal 3.8 (and cabal 3.6) I get the same result. |
This is still something that happens with -with-compiler: ghc-9.7
+with-compiler: ../../_build/stage1/bin/ghc
|
It also happens on arm macos. Could we resolve the relative path instead of passing it around? |
(Imported from Trac #768, reported by @tibbe on 2010-11-19)
Trying to build the network package while standing at the root of a GHC build tree fails to find GHC:
The text was updated successfully, but these errors were encountered: