Open flip111 opened 4 years ago
Maybe project failed to load? Are hover requests working?
I restarted vs code (the editor that i'm using) seems that this issue is first stuck on another issue
Fail on initialisation for "C:\Users\flip111\haskell\cabal\cabal-install\Distribution\Client\ProjectPlanning.hs". Could not obtain flags for: "Distribution\Client\ProjectPlanning.hs".
Or maybe it's the same issue but another manifestation of it.
there should be a diagnostic in the first line with more infos
First line where ?
In the file you load, there should be a diagnostic in the first line. In the logs, you see the full error message, too.
Could not obtain flags for: "Distribution\Client\ProjectPlanning.hs".
We could not build all components.
If one of these components exposes this Module, make sure they compile.
You can try to invoke the commands yourself.
The following commands failed:
callProcessStderr: cabal v2-build --with-ghc=C:\Users\flip111\AppData\Local\Programs\stack\x86_64-windows\ghc-8.6.5\bin\ghc.exe --with-ghc-pkg=C:\Users\flip111\AppData\Local\Programs\stack\x86_64-windows\ghc-8.6.5\bin\ghc-pkg.exe --with-haddock=C:\Users\flip111\AppData\Local\Programs\stack\x86_64-windows\ghc-8.6.5\bin\haddock.exe --project-file=C:\Users\flip111\haskell\cabal\cabal.project --builddir=C:\Users\flip111\haskell\cabal\dist-newstyle --only-configure cabal-install:exe:cabal cabal-install:setup (exit 1): failed
Calling the command cabal v2-build --with-ghc=C:\Users\flip111\AppData\Local\Programs\stack\x86_64-windows\ghc-8.6.5\bin\ghc.exe --with-ghc-pkg=C:\Users\flip111\AppData\Local\Programs\stack\x86_64-windows\ghc-8.6.5\bin\ghc-pkg.exe --with-haddock=C:\Users\flip111\AppData\Local\Programs\stack\x86_64-windows\ghc-8.6.5\bin\haddock.exe --project-file=C:\Users\flip111\haskell\cabal\cabal.project --builddir=C:\Users\flip111\haskell\cabal\dist-newstyle --only-configure cabal-install:exe:cabal cabal-install:setup
will show you the exact error message
Error:
The given project file 'C:Usersflip111haskellcabalcabal.project' does not exist.
Looks that somewhere windows paths are not properly handled
interesting, could be a cabal bug. Needs more investigating. cc @jneira you have never encountered something like that before, right?
Do you think it's worth to report upstream ?
Probably, if you can provide a nice way to reproduce the issue.
I think i launched that command from a mingw shell. When i launch from cmd.exe
i get the following
cabal: Unknown target 'cabal-install:setup'.
The package cabal-install has no component 'setup'.
I will try to load cabal
in my local to reproduce it
I've just adding:
build-type: custom
custom-setup
setup-depends:
base
to a simple, working cabal project and i've got the same error so i am afraid that the error is generic.
cabal-helper
tries to configure a component named package:setup
that simply does not exist.
I guess the fix would be in cabal-helper
itself but further investigation is needed.
@fendor could you comfirm that it is reproduced in linux, please?
workarounds:
build-type: custom
and custom-setup
from .cabal
and lose the custom processing (maybe it is not needed for your actual interest in the project)hie.yaml
to bypass cabal-helper
(i've tested it in the simple cabal project and it worked)Can reproduce on linux as well. Adds a component package:setup
Note, my custom setup looks like:
build-type: Custom
custom-setup
setup-depends: base, Cabal
@jneira with which package is the root cause of this? Is it cabal-helper? Would reporting upstream be helpful?
I can not use the workaround to drop the custom setup because the project is cabal itself (cloned from github) and i'm sure the cabal developers have their good reasons to do a custom setup.
What should go into hie.yaml
for the second workaround ?
It seems to be an issue with cabal-helper
.
My hie.yaml looks like this:
cradle:
cabal:
- path: ./cabal-install
component: "exe:cabal"
- path: ./Cabal
component: "lib:Cabal"
I can not use the workaround to drop the custom setup because the project is cabal itself (cloned from github) and i'm sure the cabal developers have their good reasons to do a custom setup.
well, examining the Setup.hs
, it seems it generates the manpages so maybe it is no essential for your actual work on cabal
But i agree the cleaner workaround is adding a hie.yaml
Would reporting upstream be helpful?
just @fendor has confimed me that cabal-helper is choosing the targets so it is the appropiate thing to do
https://github.com/haskell/cabal/blob/ac84fa2f25505ed604769d6fc3f00ecf3933b248/cabal-install/Distribution/Client/ProjectPlanning.hs#L1417