Skip to content

Commit 034bb44

Browse files
author
Mitsutoshi Aoe
authored
Merge pull request #84 from maoe/update-deps
Update dependencies
2 parents 8bf28ba + fa38601 commit 034bb44

File tree

11 files changed

+161
-101
lines changed

11 files changed

+161
-101
lines changed

.travis.yml

Lines changed: 67 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This Travis job script has been generated by a script via
22
#
3-
# make_travis_yml_2.hs 'threadscope.cabal' 'libgtk2.0-dev'
3+
# runghc make_travis_yml_2.hs '-o' '.travis.yml' 'threadscope.cabal' 'libgtk2.0-dev' '--osx=8.2.2'
44
#
55
# For more information, see https://github.com/hvr/multi-ghc-travis
66
#
@@ -11,11 +11,9 @@ git:
1111
submodules: false # whether to recursively clone submodules
1212

1313
cache:
14-
timeout: 1000
1514
directories:
1615
- $HOME/.cabal/packages
1716
- $HOME/.cabal/store
18-
- $HOME/Library/Caches/Homebrew
1917
- $HOME/.ghc-install
2018

2119
before_cache:
@@ -27,82 +25,92 @@ before_cache:
2725
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar
2826
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar.idx
2927

28+
- rm -rfv $HOME/.cabal/packages/head.hackage
29+
3030
matrix:
3131
include:
32-
- compiler: "ghc-7.8.3"
33-
# env: TEST=--disable-tests BENCH=--disable-benchmarks
34-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.8.3,libgtk2.0-dev], sources: [hvr-ghc]}}
3532
- compiler: "ghc-7.10.2"
3633
# env: TEST=--disable-tests BENCH=--disable-benchmarks
3734
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.10.2,libgtk2.0-dev], sources: [hvr-ghc]}}
3835
- compiler: "ghc-8.0.2"
3936
# env: TEST=--disable-tests BENCH=--disable-benchmarks
4037
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.0.2,libgtk2.0-dev], sources: [hvr-ghc]}}
41-
- compiler: "ghc-8.2.1"
38+
- compiler: "ghc-8.2.2"
4239
# env: TEST=--disable-tests BENCH=--disable-benchmarks
43-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.2.1,libgtk2.0-dev], sources: [hvr-ghc]}}
44-
- compiler: "ghc-8.2.1"
40+
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.2.2,libgtk2.0-dev], sources: [hvr-ghc]}}
41+
- compiler: "ghc-8.4.2"
4542
# env: TEST=--disable-tests BENCH=--disable-benchmarks
43+
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.4.2,libgtk2.0-dev], sources: [hvr-ghc]}}
44+
- compiler: "ghc-8.2.2"
45+
# env: TEST=--disable-tests BENCH=--disable-benchmarks
46+
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.2.2,libgtk2.0-dev], sources: [hvr-ghc]}}
4647
os: osx
4748

4849
before_install:
49-
- HC=${CC}
50-
- unset CC
51-
- sh scripts/install-on-osx.sh $HC
52-
- PATH=/opt/ghc/bin:/opt/ghc-ppa-tools/bin:$HOME/.ghc-install/bin:$PATH
53-
- PKGNAME='threadscope'
54-
- |
55-
if [ `uname` = "Darwin" ]; then
56-
brew install ghc gtk+ gtk-mac-integration
57-
fi
50+
- HC=${CC}
51+
- HCPKG=${HC/ghc/ghc-pkg}
52+
- unset CC
53+
- ROOTDIR=$(pwd)
54+
- mkdir -p $HOME/.local/bin
55+
- "if [ \"$(uname)\" = \"Darwin\" ]; then brew update; brew install gtk+ gtk-mac-integration; brew upgrade python@3; curl https://haskell.futurice.com/haskell-on-macos.py | python3 - --make-dirs --install-dir=$HOME/.ghc-install --cabal-alias=head install cabal-install-head ${HC}; fi"
56+
- "if [ \"$(uname)\" = \"Darwin\" ]; then PATH=$HOME/.ghc-install/ghc/bin:$HOME/local/bin:$PATH; else PATH=/opt/ghc/bin:/opt/ghc-ppa-tools/bin:$HOME/local/bin:$PATH; fi"
57+
- HCNUMVER=$(( $(${HC} --numeric-version|sed -E 's/([0-9]+)\.([0-9]+)\.([0-9]+).*/\1 * 10000 + \2 * 100 + \3/') ))
58+
- echo $HCNUMVER
5859

5960
install:
60-
- cabal --version
61-
- echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
62-
- BENCH=${BENCH---enable-benchmarks}
63-
- TEST=${TEST---enable-tests}
64-
- travis_retry cabal update -v
65-
- sed -i'.bak' 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
66-
- rm -fv cabal.project.local
67-
- "echo 'packages: .' > cabal.project"
68-
- rm -f cabal.project.freeze
69-
- |
70-
if [ `uname` = "Darwin" ]; then
71-
cabal new-configure --constraint="gtk +have-quartz-gtk"
72-
fi
73-
- cabal new-build -w ${HC} ${TEST} ${BENCH} --dep -j2 all
74-
- cabal new-build -w ${HC} --disable-tests --disable-benchmarks --dep -j2 all
61+
- cabal --version
62+
- echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
63+
- BENCH=${BENCH---enable-benchmarks}
64+
- TEST=${TEST---enable-tests}
65+
- HADDOCK=${HADDOCK-true}
66+
- INSTALLED=${INSTALLED-true}
67+
- GHCHEAD=${GHCHEAD-false}
68+
- travis_retry cabal update -v
69+
- "sed -i.bak 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config"
70+
- rm -fv cabal.project cabal.project.local
71+
- grep -Ev -- '^\s*--' ${HOME}/.cabal/config | grep -Ev '^\s*$'
72+
- "printf 'packages: \".\"\\n' > cabal.project"
73+
- cat cabal.project
74+
- if [ -f "./configure.ac" ]; then
75+
(cd "." && autoreconf -i);
76+
fi
77+
- rm -f cabal.project.freeze
78+
- cabal new-configure -w ${HC} --allow-newer=Cabal
79+
- "if [ \"$(uname)\" = \"Darwin\" ]; then cabal new-configure -w ${HC} --allow-newer=Cabal --constraint='gtk +have-quartz-gtk'; fi"
80+
- cabal new-build -w ${HC} ${TEST} ${BENCH} --project-file="cabal.project" --dep -j2 all
81+
- cabal new-build -w ${HC} --disable-tests --disable-benchmarks --project-file="cabal.project" --dep -j2 all
82+
- rm -rf .ghc.environment.* "."/dist
83+
- DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
7584

7685
# Here starts the actual work to be performed for the package under test;
7786
# any command which exits with a non-zero exit code causes the build to fail.
7887
script:
79-
- if [ -f configure.ac ]; then autoreconf -i; fi
80-
- rm -rf .ghc.environment.* dist/
81-
- cabal sdist # test that a source-distribution can be generated
82-
- cd dist/
83-
- SRCTAR=(${PKGNAME}-*.tar.gz)
84-
- SRC_BASENAME="${SRCTAR/%.tar.gz}"
85-
- tar -xvf "./$SRC_BASENAME.tar.gz"
86-
- cd "$SRC_BASENAME/"
87-
## from here on, CWD is inside the extracted source-tarball
88-
- rm -fv cabal.project.local
89-
- "echo 'packages: .' > cabal.project"
90-
# this builds all libraries and executables (without tests/benchmarks)
91-
- rm -f cabal.project.freeze
92-
- |
93-
if [ `uname` = "Darwin" ]; then
94-
cabal new-configure --constraint="gtk +have-quartz-gtk"
95-
fi
96-
- cabal new-build -w ${HC} --disable-tests --disable-benchmarks all
97-
# this builds all libraries and executables (including tests/benchmarks)
98-
# - rm -rf ./dist-newstyle
88+
# test that source-distributions can be generated
89+
- (cd "." && cabal sdist)
90+
- mv "."/dist/threadscope-*.tar.gz ${DISTDIR}/
91+
- cd ${DISTDIR} || false
92+
- find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \;
93+
- "printf 'packages: threadscope-*/*.cabal\\n' > cabal.project"
94+
- cat cabal.project
95+
- cabal new-configure -w ${HC} --allow-newer=Cabal
96+
- "if [ \"$(uname)\" = \"Darwin\" ]; then cabal new-configure -w ${HC} --allow-newer=Cabal --constraint='gtk +have-quartz-gtk'; fi"
97+
# this builds all libraries and executables (without tests/benchmarks)
98+
- cabal new-build -w ${HC} --disable-tests --disable-benchmarks all
99+
100+
# Build with installed constraints for packages in global-db
101+
- if $INSTALLED; then echo cabal new-build -w ${HC} --disable-tests --disable-benchmarks $(${HCPKG} list --global --simple-output --names-only | sed 's/\([a-zA-Z0-9-]\{1,\}\) */--constraint="\1 installed" /g') all | sh; else echo "Not building with installed constraints"; fi
99102

100-
# build & run tests
101-
- cabal new-build -w ${HC} ${TEST} ${BENCH} all
103+
# build & run tests, build benchmarks
104+
- cabal new-build -w ${HC} ${TEST} ${BENCH} all
105+
106+
# cabal check
107+
- (cd threadscope-* && cabal check)
108+
109+
# REGENDATA ["-o",".travis.yml","threadscope.cabal","libgtk2.0-dev","--osx=8.2.2"]
102110

103111
before_deploy:
104-
- cp $(find dist-newstyle/ -type f -name threadscope -exec test -x {} \; -print) threadscope.$TRAVIS_OS_NAME
105-
- gzip -f threadscope.$TRAVIS_OS_NAME
112+
- cp $(find dist-newstyle/ -type f -name threadscope -exec test -x {} \; -print) threadscope.$TRAVIS_OS_NAME
113+
- gzip -f threadscope.$TRAVIS_OS_NAME
106114

107115
deploy:
108116
provider: releases
@@ -113,5 +121,6 @@ deploy:
113121
on:
114122
repo: haskell/ThreadScope
115123
tags: true
116-
condition: "$HC = ghc-8.2.1"
124+
condition: "$HC = ghc-8.2.2"
125+
117126
# EOF

GUI/BookmarkView.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ module GUI.BookmarkView (
1313
import GHC.RTS.Events (Timestamp)
1414

1515
import Graphics.UI.Gtk
16+
import qualified Graphics.UI.Gtk.ModelView.TreeView.Compat as Compat
1617
import Numeric
1718

1819
---------------------------------------------------------------------------
@@ -81,7 +82,7 @@ bookmarkViewNew builder BookmarkViewActions{..} = do
8182
treeViewAppendColumn bookmarkTreeView columnTs
8283
treeViewAppendColumn bookmarkTreeView columnLabel
8384

84-
treeViewSetModel bookmarkTreeView bookmarkStore
85+
Compat.treeViewSetModel bookmarkTreeView (Just bookmarkStore)
8586

8687
cellLayoutSetAttributes columnTs cellTs bookmarkStore $ \(ts,_) ->
8788
[ cellText := showFFloat (Just 6) (fromIntegral ts / 1000000) "s" ]

GUI/KeyView.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import GUI.ViewerColours
77
import GUI.Timeline.Render.Constants
88

99
import Graphics.UI.Gtk
10+
import qualified Graphics.UI.Gtk.ModelView.TreeView.Compat as Compat
1011
import qualified Graphics.Rendering.Cairo as C
1112

1213

@@ -40,7 +41,7 @@ keyViewNew builder = do
4041

4142
let tooltipColumn = makeColumnIdString 0
4243
customStoreSetColumn keyStore tooltipColumn (\(_,tooltip,_) -> tooltip)
43-
treeViewSetModel keyTreeView keyStore
44+
Compat.treeViewSetModel keyTreeView (Just keyStore)
4445

4546
set keyTreeView [ treeViewTooltipColumn := tooltipColumn ]
4647

GUI/StartupInfoView.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ module GUI.StartupInfoView (
77
import GHC.RTS.Events
88

99
import Graphics.UI.Gtk
10+
import qualified Graphics.UI.Gtk.ModelView.TreeView.Compat as Compat
1011

1112
import Data.Array
1213
import Data.List
@@ -54,7 +55,7 @@ startupInfoViewNew builder = do
5455
treeViewColumnPackStart columnArgs cellArgs True
5556
treeViewAppendColumn treeviewProgArgs columnArgs
5657

57-
treeViewSetModel treeviewProgArgs storeProgArgs
58+
Compat.treeViewSetModel treeviewProgArgs (Just storeProgArgs)
5859

5960
set cellArgs [ cellTextEditable := True ]
6061
cellLayoutSetAttributes columnArgs cellArgs storeProgArgs $ \arg ->
@@ -71,7 +72,7 @@ startupInfoViewNew builder = do
7172
treeViewAppendColumn treeviewProgEnv columnVar
7273
treeViewAppendColumn treeviewProgEnv columnValue
7374

74-
treeViewSetModel treeviewProgEnv storeProgEnv
75+
Compat.treeViewSetModel treeviewProgEnv (Just storeProgEnv)
7576

7677
cellLayoutSetAttributes columnVar cellVar storeProgEnv $ \(var,_) ->
7778
[ cellText := var ]

GUI/SummaryView.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import GHC.RTS.Events
1010
import GUI.Types
1111

1212
import Graphics.UI.Gtk
13+
import qualified Graphics.UI.Gtk.ModelView.TreeView.Compat as Compat
1314

1415
import Control.Exception (assert)
1516
import Control.Monad
@@ -95,7 +96,7 @@ summaryViewNew builder = do
9596
let summaryView = SummaryView{..}
9697

9798
treeviewGcStats <- getWidget castToTreeView "treeviewGcStats"
98-
treeViewSetModel treeviewGcStats storeGcStats
99+
Compat.treeViewSetModel treeviewGcStats (Just storeGcStats)
99100
let addGcColumn = addColumn treeviewGcStats storeGcStats
100101
addGcColumn "Generation" $ \(GcStatsEntry gen _ _ _ _ _) ->
101102
[ cellText := if gen == -1 then "GC Total" else "Gen " ++ show gen ]
@@ -111,7 +112,7 @@ summaryViewNew builder = do
111112
[ cellText := (printf "%3.4fs" maxpause :: String) ]
112113

113114
treeviewSparkStats <- getWidget castToTreeView "treeviewSparkStats"
114-
treeViewSetModel treeviewSparkStats storeSparkStats
115+
Compat.treeViewSetModel treeviewSparkStats (Just storeSparkStats)
115116
let addSparksColumn = addColumn treeviewSparkStats storeSparkStats
116117
addSparksColumn "HEC" $ \(hec, _) ->
117118
[ cellText := if hec == -1 then "Total" else "HEC " ++ show hec ]

GUI/TraceView.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import Events.HECs
1010
import GUI.Types
1111

1212
import Graphics.UI.Gtk
13+
import qualified Graphics.UI.Gtk.ModelView.TreeView.Compat as Compat
1314
import Data.Tree
1415

1516

@@ -44,7 +45,7 @@ traceViewNew builder actions = do
4445
treeViewColumnPackStart traceColumn togglecell False
4546
treeViewAppendColumn tracesTreeView traceColumn
4647

47-
treeViewSetModel tracesTreeView tracesStore
48+
Compat.treeViewSetModel tracesTreeView (Just tracesStore)
4849

4950
cellLayoutSetAttributes traceColumn textcell tracesStore $ \(tr, _) ->
5051
[ cellText := renderTrace tr ]
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{-# LANGUAGE CPP #-}
2+
module Graphics.UI.Gtk.ModelView.TreeView.Compat
3+
( treeViewSetModel
4+
) where
5+
import Graphics.UI.Gtk hiding (treeViewSetModel)
6+
import qualified Graphics.UI.Gtk.ModelView.TreeView as Gtk
7+
#if !MIN_VERSION_gtk(0, 14, 9)
8+
import qualified System.Glib.FFI as Glib
9+
import qualified Graphics.UI.GtkInternals as Gtk
10+
#endif
11+
12+
treeViewSetModel
13+
:: (TreeViewClass self, TreeModelClass model)
14+
=> self
15+
-> Maybe model
16+
-> IO ()
17+
#if MIN_VERSION_gtk(0, 14, 9)
18+
treeViewSetModel = Gtk.treeViewSetModel
19+
#else
20+
treeViewSetModel self model = Gtk.treeViewSetModel self
21+
(maybe (Gtk.TreeModel Glib.nullForeignPtr) toTreeModel model)
22+
#endif

appveyor.yml

Lines changed: 44 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,53 @@
1-
platform: x64
1+
version: "{build}"
22
shallow_clone: true
3+
clone_folder: "c:/WORK"
4+
5+
platform: x64
6+
37
environment:
48
global:
5-
STACK_ROOT: c:\sr
9+
APPVEYOR_SAVE_CACHE_ON_ERROR: true
10+
CABOPTS: "--store-dir=c:/SR --http-transport=plain-http"
11+
# C_INCLUDE_PATH: "c:/msys64/mingw64/include"
12+
# LIBRARY_PATH: "c:/msys64/mingw64/lib;c:/msys64/mingw64/bin"
13+
matrix:
14+
- GHCVER: "8.0.2"
15+
- GHCVER: "8.2.2"
16+
- GHCVER: "8.4.3"
17+
618
cache:
7-
- c:\sr -> appveyor.yml
8-
- c:\msys64\var\cache\pacman\pkg -> appveyor.yml
19+
- "c:/SR"
20+
#- c:\msys64\var\cache\pacman\pkg -> appveyor.yml
21+
922
install:
10-
- set HOME=.
11-
- set "PATH=c:\msys64\usr\bin;%PATH%"
12-
- curl -ostack.zip -LsS --insecure https://www.stackage.org/stack/windows-x86_64
13-
- 7z x stack.zip stack.exe
14-
- stack setup > nul
15-
- stack exec -- pacman --noconfirm --needed --ask 20 -Sy bash pacman pacman-mirrors msys2-runtime msys2-runtime-devel
16-
- stack exec -- pacman --noconfirm -Syu
17-
- stack exec -- pacman --noconfirm -Syuu
18-
- stack exec -- pacman --noconfirm -S base-devel mingw-w64-x86_64-pkg-config mingw-w64-x86_64-toolchain mingw-w64-x86_64-gtk2
19-
- stack exec -- pacman --noconfirm -Sc
23+
- "choco install -y ghc --version %GHCVER%"
24+
- "refreshenv"
25+
- "set PATH=C:\\msys64\\mingw64\\bin;C:\\msys64\\usr\\bin;%PATH%"
26+
- "pacman --noconfirm -Sy mingw-w64-x86_64-gtk2"
27+
- "cabal --version"
28+
- "ghc --version"
29+
- "cabal %CABOPTS% update -vverbose+nowrap"
30+
2031
build_script:
21-
- stack --no-terminal build --only-dependencies
32+
- "cabal %CABOPTS% new-build -vnormal+nowrap --dry all"
33+
- ps: "Push-AppveyorArtifact dist-newstyle\\cache\\plan.json"
34+
- "cabal %CABOPTS% new-build -j -vnormal+nowrap all --dep"
35+
2236
test_script:
23-
- stack --no-terminal build --ghc-options -Werror
24-
- stack sdist
25-
version: '{build}'
37+
- "cabal %CABOPTS% new-build -j1 -vnormal+nowrap all"
38+
#- "cabal %CABOPTS% new-test -j1 -vnormal+nowrap all"
39+
2640
after_test:
27-
- ps: cp "$(./stack.exe path --local-install-root)/bin/threadscope.exe" threadscope.exe
28-
- 7z a threadscope.windows.%PLATFORM%.zip threadscope.exe
29-
artifacts:
30-
- path: threadscope.windows.%PLATFORM%.zip
41+
- bash -c "cp -v $(find -name threadscope.exe) ./threadscope.exe"
42+
- 7z a threadscope.windows.%PLATFORM%.ghc-%GHCVER%.zip threadscope.exe
43+
- ps: "Push-AppveyorArtifact threadscope.windows.$($env:PLATFORM).ghc-$($env:GHCVER).zip"
44+
3145
deploy:
32-
- provider: GitHub
33-
auth_token:
34-
secure: IbU7Tokqkdq4bI5PT+HvzG0hO4O8t2Lxq3GamSuAzWsQWt4vZahOGL9StxIXIe94
35-
artifact: threadscope.windows.$(platform).zip
36-
release: $(appveyor_repo_tag_name)
37-
on:
38-
appveyor_repo_tag: true
46+
- provider: GitHub
47+
auth_token:
48+
secure: IbU7Tokqkdq4bI5PT+HvzG0hO4O8t2Lxq3GamSuAzWsQWt4vZahOGL9StxIXIe94
49+
artifact: threadscope.windows.$(platform).ghc-$(GHCVER).zip
50+
release: $(appveyor_repo_tag_name)
51+
on:
52+
appveyor_repo_tag: true
53+
GHCVER: "8.4.3"

cabal.project

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
-- see http://cabal.readthedocs.io/en/latest/nix-local-build-overview.html for more information
2+
3+
packages: .

0 commit comments

Comments
 (0)