Error in vscode: "gcc.exe' failed in phase
C pre-processor'. (Exit code: 1)" #1519
Description
@jneira found that it happens on our install script project when you have never built it before.
Steps to reproduce:
git clone https://github.com/mpickering/haskell-ide-engine hie
cd hie/install
code .
or, if project is already cloned
cd <path-to-haskell-ide-engine>/install
rm -rf .stack-work/ dist-newstyle/ dist/
code .
where code .
is just an arbitrary lsp-client.
In the project hie-install
, the cradle Cabal-Helper-v2
will be selected due to the presence of cabal.project
.
Simply opening any haskell source file in the project will lead to the described error message.
Error is specifically that a cabal_macros.h
can not be found, which is not generated when c-h initialises the project context.
Workaround: use stack build
and cabal build
respectively to generate this file.
EDIT: adding a hie.yaml
works for me as expected even when the project has never been built before.
Originally posted by @fendor in mpickering#47 (comment)
Related issue haskell/cabal#2209.