SimulaVR / Simula

Linux VR Desktop
MIT License
2.95k stars 87 forks source link

C2HS errors make Simula fail on first build. #65

Closed georgewsinger closed 5 years ago

georgewsinger commented 5 years ago

When compiling Simula for the first time via make:

$ make
# ...
Progress 99/101               

--  While building package simula-wayland-0.0.0 using:
      /home/george/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_2.4.0.1_ghc-8.6.2 --builddir=.stack-work/dist/x86_64-linux/Cabal-2.4.0.1 build lib:simula-wayland --ghc-options " -ddump-hi -ddump-to-file -fdiagnostics-color=always"
    Process exited with code: ExitFailure (-6)
    Logs have been written to: /home/george/Simula_/addons/godot-haskell-plugin/.stack-work/logs/simula-wayland-0.0.0.log

    Configuring simula-wayland-0.0.0...
    Preprocessing library for simula-wayland-0.0.0..
    c2hs__bool_size.c: In function ‘main’:
    /home/george/Simula_/addons/godot-haskell-plugin/simula-wayland/c2hs__bool_size.c:2:45: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 2 has type ‘long unsigned int’ [-Wformat=]
     int main(int argc, char *argv[]) { printf("%u\n", sizeof(_Bool)); return 0; }
                                                ~^
                                                %lu
    c2hs: internal error: stg_ap_p_ret
        (GHC version 8.6.2 for x86_64_unknown_linux)
        Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
Makefile:5: recipe for target 'all' failed
make[1]: *** [all] Error 1
make[1]: Leaving directory '/home/george/Simula_/addons/godot-haskell-plugin'
/home/george/Simula_

Running make N times more fixes this issue for me (where N is at least 1). This is evidently an error that is even stumping the C2HS team.

Question: Until C2HS developers fix this issue for us, is there a way for us to intercept this error ourselves and re-run make until it goes away?

georgewsinger commented 5 years ago

In light of these C2HS errors:

Question: Are these C2HS errors only local to simula-wayland? Or even if we replaced the bindings in simula-wayland with something else (i.e., inline-C bindings), since godot-haskell also makes heavy use of C2HS we'd presumably still get them?