Browse Source

Update build environment for snap to use stack

Isamu Mogi 9 years ago
parent
commit
9aaaeeeaa8

+ 1 - 3
frameworks/Haskell/snap/.gitignore

@@ -1,3 +1 @@
-dist/
-/bench/.cabal-sandbox/
-/bench/cabal.sandbox.config
+/bench/.stack-work/

+ 7 - 8
frameworks/Haskell/snap/README.md

@@ -7,14 +7,13 @@ This is the Snap portion of a [benchmarking test suite](../) comparing a variety
 
 
 ## Infrastructure Software Versions
 ## Infrastructure Software Versions
 The tests were run with:
 The tests were run with:
-* GHC 7.4.1
-* snap-core 0.9.3.1
-* snap-server 0.9.3.3
-* json 0.7
-* configurator 0.2.0.2
-* resource-pool 0.2.1.1
-* HDBC-mysql 0.6.6.1
-* HDBC 2.3.1.2
+* GHC 7.10.3
+* snap-core 0.9.8.0
+* snap-server 0.9.5.1
+* aeson 0.9.0.1
+* configurator 0.3.0.0
+* resource-pool 0.2.3.2
+* mysql-simple 0.2.2.5
 
 
 ## Test URLs
 ## Test URLs
 ### JSON Encoding Test
 ### JSON Encoding Test

+ 16 - 19
frameworks/Haskell/snap/bench/snap-bench.cabal

@@ -15,23 +15,20 @@ Executable snap-bench
   main-is: Main.hs
   main-is: Main.hs
 
 
   Build-depends:
   Build-depends:
-    aeson                     >= 0.6.1.0  && < 0.7,
-    base                      >= 4        && < 5,
-    bytestring                >= 0.9.1    && < 0.11,
-    MonadCatchIO-transformers >= 0.2.1    && < 0.4,
-    mtl                       >= 2        && < 3,
-    snap-core                 >= 0.9      && < 0.10,
-    snap-server               >= 0.9      && < 0.10,
-    configurator              >= 0.2      && < 0.3,
-    resource-pool             >= 0.2      && < 0.3,
-    mysql-simple              >= 0.2.2.4  && < 0.3,
-    text                      >= 0.11.0.0 && < 0.12,
-    transformers              >= 0.3      && < 0.4,
-    random                    >= 1        && < 2,
-    unordered-containers      >= 0.2.3.1  && < 0.3
+    aeson,
+    base,
+    bytestring,
+    MonadCatchIO-transformers,
+    mtl,
+    snap-core,
+    snap-server,
+    configurator,
+    resource-pool,
+    mysql-simple,
+    text,
+    transformers,
+    random,
+    unordered-containers
 
 
-  if impl(ghc >= 6.12.0)
-    ghc-options: -threaded -Wall -fwarn-tabs -funbox-strict-fields -O2
-                 -fno-warn-unused-do-bind -rtsopts
-  else
-    ghc-options: -threaded -Wall -fwarn-tabs -funbox-strict-fields -O2
+  ghc-options: -threaded -Wall -fwarn-tabs -funbox-strict-fields -O2
+               -fno-warn-unused-do-bind -rtsopts

+ 5 - 0
frameworks/Haskell/snap/bench/stack.yaml

@@ -0,0 +1,5 @@
+flags: {}
+packages:
+- '.'
+extra-deps: []
+resolver: lts-5.14

+ 3 - 5
frameworks/Haskell/snap/setup.sh

@@ -2,12 +2,10 @@
 
 
 sed -i 's|host=".*"|host="'"${DBHOST}"'"|g' bench/cfg/db.cfg
 sed -i 's|host=".*"|host="'"${DBHOST}"'"|g' bench/cfg/db.cfg
 
 
-fw_depends haskell
+fw_depends stack
 
 
 cd bench
 cd bench
 
 
-cabal update
-cabal sandbox init
-cabal --bindir=${TROOT}/bench/dist/build/snap-bench install
+${IROOT}/stack --allow-different-user build --install-ghc
 
 
-dist/build/snap-bench/snap-bench +RTS -A4M -N -qg2 -I0 -G2 &
+${IROOT}/stack --allow-different-user exec snap-bench +RTS -A4M -N -qg2 -I0 -G2 &