haskell / haskell/haskell-language-server

HOST_OS macros not set

Open
#3,756 2 comments 0 reactions 0 assignees View on GitHub
type: bug
Dominant language
Haskell
Stars
3k
Forks
455
Avg merge
2d 19h
Merged PRs (30d)
11

Description

See this repo: https://github.com/fintara/hls-bug-error-directive

[There are](https://github.com/fintara/hls-bug-error-directive/blob/trunk/app/Main.hs) a bunch of `#ifdef` for `_HOST_OS` and while the project compiles fine, HLS jumps to the `else` branch.

```
# error Unsupported platform
in /Users/fintara/hls-bug-error-directive/app/Main.hs at line 18 col 1
CallStack (from HasCallStack):
error, called at ./Language/Preprocessor/Cpphs/CppIfdef.hs:113:21 in
cpphs-1.20.9.1-11b55022:Language.Preprocessor.Cpphs.CppIfdef
```
(it can be seen by calling `haskell-language-server .` in the repo's directory)

I've tried to manually `#include ` but it doesn't seem to have any effect. (afaik this is the auto-generated header file which contains these macros).

This is with cabal 3.10.1.0, ghc 9.2.8, HLS 2.1.0.0.
The HLS is compiled with this command: `ghcup compile hls --version 2.1.0.0 --ghc 9.2.8 --cabal-update`
I'm using macOS 13.5, but the same is observable on ArchLinux.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.