GHA Windows-2022: hsc2hs-0.68.10 fails to build with GHC 8.0 and 8.2
hsc2hs-0.68.10 fails to build with GHC 8.0 on the windows-2022 github runner.
https://github.com/haskell-hvr/missingh/actions/runs/6343543781/job/17231649304#step:7:149
[12 of 12] Compiling Main ( src\Main.hs, dist\build\hsc2hs\hsc2hs-tmp\Main.o )
In file included from C:\ghcup\ghc\8.0.2\lib\base-4.9.1.0\include/HsBase.h:29,
from cbits\utils.c:9:0: error:
C:\ghcup\ghc\8.0.2\lib\base-4.9.1.0\include/HsBase.h:545:15: warning: '__p__environ' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
545 | extern char** environ;
| ^~~~~~~
Linking dist\build\hsc2hs\hsc2hs.exe ...
dist\build\hsc2hs\hsc2hs-tmp\cbits\utils.o:utils.c:(.text+0x33): undefined reference to `__stdio_common_vswprintf_s'
C:\sr\ghc-8.0.2\process-1.6.11.0-83080639175e64c2523572d20174f475836e04ed\lib/libHSprocess-1.6.11.0-83080639175e64c2523572d20174f475836e04ed.a(runProcess.o):runProcess.c:(.text+0x137): undefined reference to `__stdio_common_vswprintf_s'
This has been actually reported by the AppVeyor CI, but those failures have been ignored for the last 18 months according to https://ci.appveyor.com/project/hvr/hsc2hs/history. First failed build report was in Spring 2022: https://ci.appveyor.com/project/hvr/hsc2hs/builds/42916119/job/7nomuj2jiar3yg02
My understanding is that this isn't an hsc2hs bug at all. Rather, GHC 8.0 simply isn't compatible with headers provided by msys2.
It somehow used to work before, maybe upstream upgraded something. E.g. here is some evidence (soon will be scrapped) that hsc-0.68.9 builds fine on Windows with GHC 8.0: https://github.com/haskell-hvr/missingh/actions/runs/5741623308/job/15562101669
0.68.10 works with GHC 8.4 and higher, so maybe the Windows CI should be updated to reflect this.
Maybe the base lower bound for 0.68.10 should be lifted to exclude GHC < 8.4. This could also address the issue, but I am just speculating this based on the evidence I got from these CI runs.
There is successful AppVeyor builds for hsc2hs-0.68.10 here:
- GHC 8.2 https://ci.appveyor.com/project/hvr/windns/builds/48554044/job/va5osjqmo3ix9541
- GHC 8.0: https://ci.appveyor.com/project/hvr/windns/builds/48554044/job/y16aph0cjrk59kxv