Skip to content
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

Error in vscode: "gcc.exe' failed in phase C pre-processor'. (Exit code: 1)" #47

Closed
jneira opened this issue Nov 14, 2019 · 7 comments
Closed

Comments

@jneira
Copy link

jneira commented Nov 14, 2019

GhcException on cradle initialisation: "`gcc.exe' failed in phase `C pre-processor'. (Exit code: 1)"
  • The posible fix could involve handle that exception in runActionWithContext (thanks for point it out @mpickering)
@fendor fendor mentioned this issue Nov 14, 2019
26 tasks
@fendor
Copy link
Collaborator

fendor commented Nov 18, 2019

To add more context to this issue and how to reproduce it:
@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.

@lukel97
Copy link
Collaborator

lukel97 commented Nov 18, 2019

@jneira
Copy link
Author

jneira commented Nov 18, 2019

Thanks for summarize the bug @fendor.

@fendor
Copy link
Collaborator

fendor commented Nov 18, 2019

What @bubba is observing may or may not be a different issue :(

@jneira
Copy link
Author

jneira commented Nov 19, 2019

adding a hie.yaml works for me as expected even when the project has never been built before.

i think it is caused by using hie.yaml's which triggers a cabal repl or stack repl and those commands generate the cabal_macros.h file. That observation could help us to fix the issue.

What @bubba is observing may or may not be a different issue :(

To check it we should execute the ghc command with the args shown in the log, after deleting dist-newstyle and call cabal v2-build --dry-run.

@jneira
Copy link
Author

jneira commented Nov 25, 2019

@fendor
Copy link
Collaborator

fendor commented Dec 29, 2019

Closed in favour of haskell#1519

@fendor fendor closed this as completed Dec 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants