haskell / ThreadScope

A graphical tool for profiling parallel Haskell programs
http://www.haskell.org/haskellwiki/ThreadScope
Other
154 stars 36 forks source link

AppVeyor builds are broken on master #98

Closed maoe closed 4 years ago

maoe commented 5 years ago

GHC 8.0 is failing due to https://github.com/gtk2hs/gtk2hs/issues/285. 8.2 and 8.4 are failing as follows:

[00:05:22] Completed    cairo-0.13.6.1 (all, legacy fallback)
[00:05:22] 
[00:05:22] Failed to build glib-0.13.7.1.
[00:05:22] Build log ( C:\Users\appveyor\AppData\Roaming\cabal\logs\ghc-8.4.3\glib-0.13.7.1-c9bf0c6a7cd0793f0968b845c8e790239c1db992.log ):
[00:05:22] Preprocessing library for glib-0.13.7.1..
[00:05:22] dist\\build\\System\\Glib\\StoreValue_hsc_utils.o:StoreValue_hsc_utils.c:(.text+0x0): multiple definition of `__debugbreak'
[00:05:22] dist\\build\\System\\Glib\\StoreValue_hsc_make.o:StoreValue_hsc_make.c:(.text+0x0): first defined here
[00:05:22] dist\\build\\System\\Glib\\StoreValue_hsc_utils.o:StoreValue_hsc_utils.c:(.text+0x8): multiple definition of `wcsnlen_s'
[00:05:22] dist\\build\\System\\Glib\\StoreValue_hsc_make.o:StoreValue_hsc_make.c:(.text+0x85): first defined here
[00:05:22] collect2.exe: error: ld returned 1 exit status
[00:05:22] linking dist\build\System\Glib\StoreValue_hsc_make.o failed (exit code 1)
[00:05:22] command was: C:\ProgramData\chocolatey\lib\ghc\tools\ghc-8.4.3\lib/../mingw/bin\gcc.exe dist\build\System\Glib\StoreValue_hsc_make.o dist\build\System\Glib\StoreValue_hsc_utils.o -o dist\build\System\Glib\StoreValue_hsc_make.exe -fno-stack-protector -LC:\msys64\mingw64\lib -LC:/msys64/mingw64/lib -lgobject-2.0 -lglib-2.0 -lintl -LC:\SR\ghc-8.4.3\utf8-string-1.0.1.1-1217b190a64290c06013c6d0892a517edf75b21b\lib -LC:\msys64\mingw64\lib -LC:\ProgramData\chocolatey\lib\ghc\tools\ghc-8.4.3\lib\text-1.2.3.0 -LC:\ProgramData\chocolatey\lib\ghc\tools\ghc-8.4.3\lib\binary-0.8.5.1 -LC:\ProgramData\chocolatey\lib\ghc\tools\ghc-8.4.3\lib\containers-0.5.11.0 -LC:\ProgramData\chocolatey\lib\ghc\tools\ghc-8.4.3\lib\bytestring-0.10.8.2 -LC:\ProgramData\chocolatey\lib\ghc\tools\ghc-8.4.3\lib\deepseq-1.4.3.0 -LC:\ProgramData\chocolatey\lib\ghc\tools\ghc-8.4.3\lib\array-0.5.2.0 -LC:\ProgramData\chocolatey\lib\ghc\tools\ghc-8.4.3\lib\base-4.11.1.0 -lwsock32 -luser32 -lshell32 -lmsvcrt -lmingw32 -lmingwex -LC:\ProgramData\chocolatey\lib\ghc\tools\ghc-8.4.3\lib\integer-gmp-1.0.2.0 -LC:\ProgramData\chocolatey\lib\ghc\tools\ghc-8.4.3\lib\ghc-prim-0.5.2.0 -luser32 -lmingw32 -lmingwex -LC:\ProgramData\chocolatey\lib\ghc\tools\ghc-8.4.3\lib/rts -lm -lwsock32 -lgdi32 -lwinmm -lDbghelp -lPsapi
[00:05:22] cabal.exe: Failed to build glib-0.13.7.1 (which is required by gtk-0.15.3). See the build log above for details.

See https://ci.appveyor.com/project/maoe/threadscope-44t6e/build/job/p4v7ub35q7rrwlx7 for the full log.

Related #97

maoe commented 5 years ago

I started calling for Windows maintainer(s) on reddit: https://www.reddit.com/r/haskell/comments/e66p4y/call_for_maintainers_threadscope_on_windows/

kakkun61 commented 5 years ago

I got to be able to reproduce the same error on my machine. I start to check the details.

kakkun61 commented 5 years ago

Interim report

The error seems a gtk2hs's problem. There is a PR for gtk2hs which is created just two days ago, https://github.com/gtk2hs/gtk2hs/pull/289. But this PR is not enough, and so I created a new PR toward the PR, https://github.com/PaulJohnson/gtk2hs/pull/1.

I made ThreadScope use the fixed revision (the diff is https://github.com/haskell/ThreadScope/compare/master...kakkun61:windows).

Another new error occurred, although the error which occurred on AppVeyor was fixed.

With GHC 8.8.1 and Cabal 3.0.0.0 on PowerShell,

Error Log ``` > cabal build threadscope --only-dependencies # this succeeded > cabal build threadscope Resolving dependencies... Build profile: -w ghc-8.8.1 -O1 In order, the following will be built (use -v for more details): - threadscope-0.2.11.1 (exe:threadscope) (configuration changed) Configuring threadscope-0.2.11.1... Preprocessing executable 'threadscope' for threadscope-0.2.11.1.. Building executable 'threadscope' for threadscope-0.2.11.1.. GUI\EventsView.hs:118:0: error: error: missing binary operator before token "(" #if MIN_VERSION_gtk(0,13,0) | 118 | #if MIN_VERSION_gtk(0,13,0) | ^ GUI\Timeline.hs:256:0: error: error: missing binary operator before token "(" | | ^ error: missing binary operator before token "(" #if MIN_VERSION_gtk(0,12,1) | 470 | #if MIN_VERSION_gtk(0,12,1) | ^ GUI\Timeline\Render.hs:396:0: error: error: missing binary operator before token "(" #if MIN_VERSION_gtk(0,13,0) | 396 | #if MIN_VERSION_gtk(0,13,0) | ^ Graphics\UI\Gtk\ModelView\TreeView\Compat.hs:7:0: error: error: missing binary operator before token "(" #if !MIN_VERSION_gtk(0, 14, 9) | 7 | #if !MIN_VERSION_gtk(0, 14, 9) | ^ error: missing binary operator before token "(" | 17 | #if MIN_VERSION_gtk(0, 14, 9) | ^ GUI\EventsView.hs:1:1: error: `gcc.exe' failed in phase `C pre-processor'. (Exit code: 1) | 1 | {-# LANGUAGE CPP #-} | ^ GUI\Timeline.hs:1:1: error: `gcc.exe' failed in phase `C pre-processor'. (Exit code: 1) | 1 | {-# LANGUAGE CPP #-} | ^ GUI\Timeline\Render.hs:1:1: error: `gcc.exe' failed in phase `C pre-processor'. (Exit code: 1) | 1 | {-# LANGUAGE CPP #-} | ^ Graphics\UI\Gtk\ModelView\TreeView\Compat.hs:1:1: error: `gcc.exe' failed in phase `C pre-processor'. (Exit code: 1) | 1 | {-# LANGUAGE CPP #-} | ^ ```

The MinGW64 shell seems unnecessary when using cabal v2-build, and I encountered the same error with MinGW64 shell.

I don't know why MIN_VERSION_gtk is not generated. Does anyone have any information about this?

TODO

kakkun61 commented 5 years ago

Ah, I found my mistake. I changed the dependency from gtk to gtk3, so MIN_VERSION_gtk3 should be used.

maoe commented 5 years ago

Thanks for the heads up. Nice to hear that you fixed the original issue.

As for the version macros, note that ThreadScope is currently written for gtk2. Porting it to gtk3 needs non-trivial amount of work and perhaps should be done with #100. So I think it's better to focus on the build issue and stick to gtk2 for now.

Mistuke commented 5 years ago

This isn't an issue with ThreadScope. The current version of hsc2hs are broken on Windows. Because of this any haskell project using Windows is currently unstable until the next version is released. Your builds will randomly fail or pass. See https://github.com/haskell/hsc2hs/blob/master/changelog.md

Mistuke commented 4 years ago

Ah no sorry this is a different issue, I didn't notice the first part of the error. But keep in mind that your builds will be unstable till the new version of hsc2hs.

kakkun61 commented 4 years ago

I have been able to build the latest ThreadScope on Windows finally!

After the PR of https://github.com/gtk2hs/gtk2hs/pull/289 is merged and the gtk package and so on are released, we can build it.

If you build it now, use this cabal.project https://github.com/haskell/ThreadScope/compare/master...kakkun61:windows.

TODO

maoe commented 4 years ago

@kakkun61 Nice. Unfortunately in your windows branch glib doesn't seem to build on macOS though:

% PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig" cabal build --constraint='gtk +have-quartz-gtk' -w ghc-8.6.5
Build profile: -w ghc-8.6.5 -O1
In order, the following will be built (use -v for more details):
 - glib-0.13.7.1 (lib:glib) (first run)
 - pango-0.13.6.1 (lib:pango) (first run)
 - gio-0.13.6.1 (lib:gio) (first run)
 - gtk-0.15.3 (lib:gtk) (first run)
 - gtk-mac-integration-0.3.4.0 (lib:gtk-mac-integration) (requires build)
 - threadscope-0.2.11.1 (exe:threadscope) (configuration changed)
Preprocessing library for glib-0.13.7.1..
setup: Error in C header file.

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/time.h:154: (column 17) [FATAL] 
  >>> Syntax error!
  The symbol `__attribute__' does not fit here.

cabal: Failed to build glib-0.13.7.1 (which is required by
threadscope-0.2.11.1).
kakkun61 commented 4 years ago

@maoe I don't know why, but this patch may fix it by any chance, https://github.com/gtk2hs/gtk2hs/pull/289#issuecomment-562409162.

maoe commented 4 years ago

AppVeyor builds are fixed.