From 51bfa8a56fc8fd2f49107b20d0cb6db674186340 Mon Sep 17 00:00:00 2001 From: Tobi Oloke Date: Thu, 24 Oct 2024 18:48:53 +0100 Subject: [PATCH 1/6] Working shell.nix --- shell.nix | 21 +++++++++++++++++++++ stack.yaml | 9 ++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 shell.nix diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..562bfe6 --- /dev/null +++ b/shell.nix @@ -0,0 +1,21 @@ +let + nixpkgs = import (builtins.fetchTarball { + url = "https://github.com/NixOS/nixpkgs/archive/5c79b3dda06744a55869cae2cba6873fbbd64394.tar.gz";}) {}; + + hpkgs = nixpkgs.haskell.packages."ghc884"; + # hs = import ./parconc-examples.nix; +in + hpkgs.shellFor { + name = "parconc-examples"; + packages = _: []; + nativeBuildInputs = with hpkgs; [ + stack + cabal-install + haskell-language-server + nixpkgs.pkg-config + nixpkgs.zlib + parallel + implicit-hie + threadscope + ]; # ++ hs.hackages hpkgs; +} diff --git a/stack.yaml b/stack.yaml index 2c67237..6f5bb6a 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,5 +1,12 @@ -resolver: lts-10.10 +resolver: lts-16.31 flags: parconc-examples: distributed: true accelerate: true + +nix: + enable: true + shell-file: shell.nix + packages: [ zlib.dev, zlib.out, pkg-config ] + + From 3cc9c5cae5db0c0896481aaf9bf8a4a42995a778 Mon Sep 17 00:00:00 2001 From: Tobi Oloke Date: Fri, 25 Oct 2024 11:54:58 +0100 Subject: [PATCH 2/6] Updating gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 115fe25..422baf3 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ *.old dist +dist-newstyle cabal-dev cabal.sandbox.config From 058eebd1fab99bc9941282e4400ffd078b7b9566 Mon Sep 17 00:00:00 2001 From: Tobi Oloke Date: Fri, 25 Oct 2024 11:58:40 +0100 Subject: [PATCH 3/6] Modified stack.yaml: some modules like sudoku-par do not have HLS --- hie.yaml | 532 +++++++++++++++++++++++++++++++++++++++++++++++++++++ stack.yaml | 2 +- 2 files changed, 533 insertions(+), 1 deletion(-) create mode 100644 hie.yaml diff --git a/hie.yaml b/hie.yaml new file mode 100644 index 0000000..58c7fa2 --- /dev/null +++ b/hie.yaml @@ -0,0 +1,532 @@ +cradle: + cabal: + - path: "./rpar.hs" + component: "parconc-examples:exe:rpar" + + - path: "./sudoku1.hs" + component: "parconc-examples:exe:sudoku1" + + - path: "./Sudoku.hs" + component: "parconc-examples:exe:sudoku1" + + - path: "./sudoku2.hs" + component: "parconc-examples:exe:sudoku2" + + - path: "./Sudoku.hs" + component: "parconc-examples:exe:sudoku2" + + - path: "./sudoku3.hs" + component: "parconc-examples:exe:sudoku3" + + - path: "./Sudoku.hs" + component: "parconc-examples:exe:sudoku3" + + - path: "./sudoku4.hs" + component: "parconc-examples:exe:sudoku4" + + - path: "./Sudoku.hs" + component: "parconc-examples:exe:sudoku4" + + - path: "./sudoku5.hs" + component: "parconc-examples:exe:sudoku5" + + - path: "./Sudoku.hs" + component: "parconc-examples:exe:sudoku5" + + - path: "./strat.hs" + component: "parconc-examples:exe:strat" + + - path: "./strat2.hs" + component: "parconc-examples:exe:strat2" + + - path: "./strat3.hs" + component: "parconc-examples:exe:strat3" + + - path: "./rsa.hs" + component: "parconc-examples:exe:rsa" + + - path: "./ByteStringCompat.hs" + component: "parconc-examples:exe:rsa" + + - path: "./rsa1.hs" + component: "parconc-examples:exe:rsa1" + + - path: "./ByteStringCompat.hs" + component: "parconc-examples:exe:rsa1" + + - path: "./rsa2.hs" + component: "parconc-examples:exe:rsa2" + + - path: "./ByteStringCompat.hs" + component: "parconc-examples:exe:rsa2" + + - path: "kmeans/kmeans.hs" + component: "parconc-examples:exe:kmeans" + + - path: "kmeans/KMeansCore.hs" + component: "parconc-examples:exe:kmeans" + + - path: "kmeans/GenSamples.hs" + component: "parconc-examples:exe:GenSamples" + + - path: "kmeans/KMeansCore.hs" + component: "parconc-examples:exe:GenSamples" + + - path: "./parmonad.hs" + component: "parconc-examples:exe:parmonad" + + - path: "./rsa-pipeline.hs" + component: "parconc-examples:exe:rsa-pipeline" + + - path: "./ByteStringCompat.hs" + component: "parconc-examples:exe:rsa-pipeline" + + - path: "./Stream.hs" + component: "parconc-examples:exe:rsa-pipeline" + + - path: "fwsparse/fwsparse.hs" + component: "parconc-examples:exe:fwsparse" + + - path: "fwsparse/SparseGraph.hs" + component: "parconc-examples:exe:fwsparse" + + - path: "fwsparse/MapCompat.hs" + component: "parconc-examples:exe:fwsparse" + + - path: "fwsparse/fwsparse1.hs" + component: "parconc-examples:exe:fwsparse1" + + - path: "fwsparse/SparseGraph.hs" + component: "parconc-examples:exe:fwsparse1" + + - path: "fwsparse/MapCompat.hs" + component: "parconc-examples:exe:fwsparse1" + + - path: "./timetable.hs" + component: "parconc-examples:exe:timetable" + + - path: "./timetable1.hs" + component: "parconc-examples:exe:timetable1" + + - path: "./timetable2.hs" + component: "parconc-examples:exe:timetable2" + + - path: "./timetable3.hs" + component: "parconc-examples:exe:timetable3" + + - path: "parinfer/parinfer.hs" + component: "parconc-examples:exe:parinfer" + + - path: "parinfer/InferMonad.hs" + component: "parconc-examples:exe:parinfer" + + - path: "parinfer/Term.hs" + component: "parconc-examples:exe:parinfer" + + - path: "parinfer/FiniteMap.hs" + component: "parconc-examples:exe:parinfer" + + - path: "parinfer/Shows.hs" + component: "parconc-examples:exe:parinfer" + + - path: "parinfer/Environment.hs" + component: "parconc-examples:exe:parinfer" + + - path: "parinfer/Lex.hs" + component: "parconc-examples:exe:parinfer" + + - path: "parinfer/MaybeM.hs" + component: "parconc-examples:exe:parinfer" + + - path: "parinfer/Parse.hs" + component: "parconc-examples:exe:parinfer" + + - path: "parinfer/MyList.hs" + component: "parconc-examples:exe:parinfer" + + - path: "parinfer/Type.hs" + component: "parconc-examples:exe:parinfer" + + - path: "parinfer/Infer.hs" + component: "parconc-examples:exe:parinfer" + + - path: "parinfer/Substitution.hs" + component: "parconc-examples:exe:parinfer" + + - path: "parinfer/StateX.hs" + component: "parconc-examples:exe:parinfer" + + - path: "./fwdense.hs" + component: "parconc-examples:exe:fwdense" + + - path: "./fwdense1.hs" + component: "parconc-examples:exe:fwdense1" + + - path: "./rotateimage.hs" + component: "parconc-examples:exe:rotateimage" + + - path: "./fwaccel.hs" + component: "parconc-examples:exe:fwaccel" + + - path: "./AccelerateCompat.hs" + component: "parconc-examples:exe:fwaccel" + + - path: "./fwaccel-gpu.hs" + component: "parconc-examples:exe:fwaccel-gpu" + + - path: "mandel/mandel.hs" + component: "parconc-examples:exe:mandel" + + - path: "mandel/Config.hs" + component: "parconc-examples:exe:mandel" + + - path: "./fork.hs" + component: "parconc-examples:exe:fork" + + - path: "./reminders.hs" + component: "parconc-examples:exe:reminders" + + - path: "./reminders2.hs" + component: "parconc-examples:exe:reminders2" + + - path: "./mvar1.hs" + component: "parconc-examples:exe:mvar1" + + - path: "./mvar2.hs" + component: "parconc-examples:exe:mvar2" + + - path: "./mvar3.hs" + component: "parconc-examples:exe:mvar3" + + - path: "./logger.hs" + component: "parconc-examples:exe:logger" + + - path: "./phonebook.hs" + component: "parconc-examples:exe:phonebook" + + - path: "./chan.hs" + component: "parconc-examples:exe:chan" + + - path: "./chan2.hs" + component: "parconc-examples:exe:chan2" + + - path: "./geturls1.hs" + component: "parconc-examples:exe:geturls1" + + - path: "./GetURL.hs" + component: "parconc-examples:exe:geturls1" + + - path: "./geturls2.hs" + component: "parconc-examples:exe:geturls2" + + - path: "./GetURL.hs" + component: "parconc-examples:exe:geturls2" + + - path: "./geturls3.hs" + component: "parconc-examples:exe:geturls3" + + - path: "./TimeIt.hs" + component: "parconc-examples:exe:geturls3" + + - path: "./GetURL.hs" + component: "parconc-examples:exe:geturls3" + + - path: "./geturls4.hs" + component: "parconc-examples:exe:geturls4" + + - path: "./GetURL.hs" + component: "parconc-examples:exe:geturls4" + + - path: "./geturls5.hs" + component: "parconc-examples:exe:geturls5" + + - path: "./GetURL.hs" + component: "parconc-examples:exe:geturls5" + + - path: "./geturls6.hs" + component: "parconc-examples:exe:geturls6" + + - path: "./TimeIt.hs" + component: "parconc-examples:exe:geturls6" + + - path: "./GetURL.hs" + component: "parconc-examples:exe:geturls6" + + - path: "./geturlscancel.hs" + component: "parconc-examples:exe:geturlscancel" + + - path: "./TimeIt.hs" + component: "parconc-examples:exe:geturlscancel" + + - path: "./GetURL.hs" + component: "parconc-examples:exe:geturlscancel" + + - path: "./geturlscancel2.hs" + component: "parconc-examples:exe:geturlscancel2" + + - path: "./TimeIt.hs" + component: "parconc-examples:exe:geturlscancel2" + + - path: "./GetURL.hs" + component: "parconc-examples:exe:geturlscancel2" + + - path: "./modifytwo.hs" + component: "parconc-examples:exe:modifytwo" + + - path: "./chan3.hs" + component: "parconc-examples:exe:chan3" + + - path: "./timeout.hs" + component: "parconc-examples:exe:timeout" + + - path: "./catch-mask.hs" + component: "parconc-examples:exe:catch-mask" + + - path: "./catch-mask2.hs" + component: "parconc-examples:exe:catch-mask2" + + - path: "miscmodules/miscmodules.hs" + component: "parconc-examples:exe:miscmodules" + + - path: "./miscmodules.hs" + component: "parconc-examples:exe:miscmodules" + + - path: "miscmodules/TMVar.hs" + component: "parconc-examples:exe:miscmodules" + + - path: "miscmodules/TList.hs" + component: "parconc-examples:exe:miscmodules" + + - path: "miscmodules/TQueue.hs" + component: "parconc-examples:exe:miscmodules" + + - path: "miscmodules/TBQueue.hs" + component: "parconc-examples:exe:miscmodules" + + - path: "miscmodules/WindowManager.hs" + component: "parconc-examples:exe:miscmodules" + + - path: "./TMVar.hs" + component: "parconc-examples:exe:miscmodules" + + - path: "./TList.hs" + component: "parconc-examples:exe:miscmodules" + + - path: "./TQueue.hs" + component: "parconc-examples:exe:miscmodules" + + - path: "./TBQueue.hs" + component: "parconc-examples:exe:miscmodules" + + - path: "./WindowManager.hs" + component: "parconc-examples:exe:miscmodules" + + - path: "./geturlsfirst.hs" + component: "parconc-examples:exe:geturlsfirst" + + - path: "./ConcurrentUtils.hs" + component: "parconc-examples:exe:geturlsfirst" + + - path: "./GetURL.hs" + component: "parconc-examples:exe:geturlsfirst" + + - path: "./TChan.hs" + component: "parconc-examples:exe:TChan" + + - path: "./geturls7.hs" + component: "parconc-examples:exe:geturls7" + + - path: "./ConcurrentUtils.hs" + component: "parconc-examples:exe:geturls7" + + - path: "./GetURL.hs" + component: "parconc-examples:exe:geturls7" + + - path: "./geturls8.hs" + component: "parconc-examples:exe:geturls8" + + - path: "./Async.hs" + component: "parconc-examples:exe:geturls8" + + - path: "./GetURL.hs" + component: "parconc-examples:exe:geturls8" + + - path: "./geturls9.hs" + component: "parconc-examples:exe:geturls9" + + - path: "./Async.hs" + component: "parconc-examples:exe:geturls9" + + - path: "./GetURL.hs" + component: "parconc-examples:exe:geturls9" + + - path: "./timeout.hs" + component: "parconc-examples:exe:timeout2" + + - path: "./findseq.hs" + component: "parconc-examples:exe:findseq" + + - path: "./findpar.hs" + component: "parconc-examples:exe:findpar" + + - path: "./findpar2.hs" + component: "parconc-examples:exe:findpar2" + + - path: "./findpar3.hs" + component: "parconc-examples:exe:findpar3" + + - path: "./CasIORef.hs" + component: "parconc-examples:exe:findpar3" + + - path: "./findpar4.hs" + component: "parconc-examples:exe:findpar4" + + - path: "./findpar5.hs" + component: "parconc-examples:exe:findpar5" + + - path: "./server.hs" + component: "parconc-examples:exe:server" + + - path: "./ConcurrentUtils.hs" + component: "parconc-examples:exe:server" + + - path: "./server2.hs" + component: "parconc-examples:exe:server2" + + - path: "./ConcurrentUtils.hs" + component: "parconc-examples:exe:server2" + + - path: "./chat.hs" + component: "parconc-examples:exe:chat" + + - path: "./ConcurrentUtils.hs" + component: "parconc-examples:exe:chat" + + - path: "./distrib-ping/ping.hs" + component: "parconc-examples:exe:ping" + + - path: "./DistribUtils.hs" + component: "parconc-examples:exe:ping" + + - path: "./distrib-ping/ping-multi.hs" + component: "parconc-examples:exe:ping-multi" + + - path: "./DistribUtils.hs" + component: "parconc-examples:exe:ping-multi" + + - path: "./distrib-ping/ping-tc.hs" + component: "parconc-examples:exe:ping-tc" + + - path: "./DistribUtils.hs" + component: "parconc-examples:exe:ping-tc" + + - path: "./distrib-ping/ping-tc-merge.hs" + component: "parconc-examples:exe:ping-tc-merge" + + - path: "./DistribUtils.hs" + component: "parconc-examples:exe:ping-tc-merge" + + - path: "./distrib-ping/ping-tc-notify.hs" + component: "parconc-examples:exe:ping-tc-notify" + + - path: "./DistribUtils.hs" + component: "parconc-examples:exe:ping-tc-notify" + + - path: "./distrib-ping/ping-fail.hs" + component: "parconc-examples:exe:ping-fail" + + - path: "./DistribUtils.hs" + component: "parconc-examples:exe:ping-fail" + + - path: "./distrib-chat/chat.hs" + component: "parconc-examples:exe:distrib-chat" + + - path: "./ConcurrentUtils.hs" + component: "parconc-examples:exe:distrib-chat" + + - path: "./DistribUtils.hs" + component: "parconc-examples:exe:distrib-chat" + + - path: "./distrib-chat/chat-noslave.hs" + component: "parconc-examples:exe:distrib-chat-noslave" + + - path: "./ConcurrentUtils.hs" + component: "parconc-examples:exe:distrib-chat-noslave" + + - path: "./db.hs" + component: "parconc-examples:exe:distrib-db" + + - path: "distrib-db/db.hs" + component: "parconc-examples:exe:distrib-db" + + - path: "./DistribUtils.hs" + component: "parconc-examples:exe:distrib-db" + + - path: "./Database.hs" + component: "parconc-examples:exe:distrib-db" + + - path: "distrib-db/DistribUtils.hs" + component: "parconc-examples:exe:distrib-db" + + - path: "distrib-db/Database.hs" + component: "parconc-examples:exe:distrib-db" + + - path: "./mvar4.hs" + component: "parconc-examples:exe:mvar4" + + - path: "./deadlock1.hs" + component: "parconc-examples:exe:deadlock1" + + - path: "./deadlock2.hs" + component: "parconc-examples:exe:deadlock2" + + - path: "./threadperf1.hs" + component: "parconc-examples:exe:threadperf1" + + - path: "./threadperf2.hs" + component: "parconc-examples:exe:threadperf2" + + - path: "other/bingtranslator.hs" + component: "parconc-examples:exe:bingtranslator" + + - path: "./bingtranslator.hs" + component: "parconc-examples:exe:bingtranslator" + + - path: "other/BingTranslate.hs" + component: "parconc-examples:exe:bingtranslator" + + - path: "other/GetURL.hs" + component: "parconc-examples:exe:bingtranslator" + + - path: "./BingTranslate.hs" + component: "parconc-examples:exe:bingtranslator" + + - path: "./GetURL.hs" + component: "parconc-examples:exe:bingtranslator" + + - path: "other/bingtranslatorconc.hs" + component: "parconc-examples:exe:bingtranslatorconc" + + - path: "./bingtranslatorconc.hs" + component: "parconc-examples:exe:bingtranslatorconc" + + - path: "other/BingTranslate.hs" + component: "parconc-examples:exe:bingtranslatorconc" + + - path: "other/GetURL.hs" + component: "parconc-examples:exe:bingtranslatorconc" + + - path: "./BingTranslate.hs" + component: "parconc-examples:exe:bingtranslatorconc" + + - path: "./GetURL.hs" + component: "parconc-examples:exe:bingtranslatorconc" + + - path: "./geturlsstm.hs" + component: "parconc-examples:exe:geturlsstm" + + - path: "./TimeIt.hs" + component: "parconc-examples:exe:geturlsstm" + + - path: "./GetURL.hs" + component: "parconc-examples:exe:geturlsstm" diff --git a/stack.yaml b/stack.yaml index 6f5bb6a..095a411 100644 --- a/stack.yaml +++ b/stack.yaml @@ -5,7 +5,7 @@ flags: accelerate: true nix: - enable: true + enable: false shell-file: shell.nix packages: [ zlib.dev, zlib.out, pkg-config ] From 5e2e44444fe9605dbbf8ce0fd6c52e1b614cb195 Mon Sep 17 00:00:00 2001 From: Tobi Oloke Date: Fri, 25 Oct 2024 13:06:57 +0100 Subject: [PATCH 4/6] Rank 1 Dynamic fails test for some reason --- parconc-examples.nix | 45 ++++++++++++++++++++++++++++++++++++++++++++ shell.nix | 10 ++++++++-- stack.yaml | 2 +- 3 files changed, 54 insertions(+), 3 deletions(-) create mode 100644 parconc-examples.nix diff --git a/parconc-examples.nix b/parconc-examples.nix new file mode 100644 index 0000000..68902d9 --- /dev/null +++ b/parconc-examples.nix @@ -0,0 +1,45 @@ +{ nixpkgs ? import {}, compiler ? "default", doBenchmark ? false }: + +let + + inherit (nixpkgs) pkgs; + + f = { mkDerivation, abstract-par, accelerate, alex, array, async + , base, binary, bytestring, containers, deepseq, directory + , distributed-process, distributed-process-simplelocalnet + , distributed-static, filepath, happy, http-conduit, lib, monad-par + , network, network-uri, normaldistribution, parallel, random, repa + , stm, template-haskell, time, transformers, utf8-string, vector + , xml + }: + mkDerivation { + pname = "parconc-examples"; + version = "0.4.8"; + src = ./.; + isLibrary = false; + isExecutable = true; + executableHaskellDepends = [ + abstract-par accelerate array async base binary bytestring + containers deepseq directory distributed-process + distributed-process-simplelocalnet distributed-static filepath + http-conduit monad-par network network-uri normaldistribution + parallel random repa stm template-haskell time transformers + utf8-string vector xml + ]; + executableToolDepends = [ alex happy ]; + homepage = "http://github.com/simonmar/parconc-examples"; + description = "Examples to accompany the book \"Parallel and Concurrent Programming in Haskell\""; + license = lib.licenses.bsd3; + }; + + haskellPackages = if compiler == "default" + then pkgs.haskellPackages + else pkgs.haskell.packages.${compiler}; + + variant = if doBenchmark then pkgs.haskell.lib.doBenchmark else pkgs.lib.id; + + drv = variant (haskellPackages.callPackage f {}); + +in + + if pkgs.lib.inNixShell then drv.env else drv diff --git a/shell.nix b/shell.nix index 562bfe6..9fcfeff 100644 --- a/shell.nix +++ b/shell.nix @@ -1,11 +1,17 @@ let nixpkgs = import (builtins.fetchTarball { - url = "https://github.com/NixOS/nixpkgs/archive/5c79b3dda06744a55869cae2cba6873fbbd64394.tar.gz";}) {}; + url = "https://github.com/NixOS/nixpkgs/archive/5c79b3dda06744a55869cae2cba6873fbbd64394.tar.gz";}) {}; + + compiler = "ghc884"; - hpkgs = nixpkgs.haskell.packages."ghc884"; + hpkgs = nixpkgs.haskell.packages.${compiler}; # hs = import ./parconc-examples.nix; + + parconc-pkgs = import ./parconc-examples.nix {inherit nixpkgs compiler; doBenchmark = false; }; + in hpkgs.shellFor { + inherit parconc-pkgs; name = "parconc-examples"; packages = _: []; nativeBuildInputs = with hpkgs; [ diff --git a/stack.yaml b/stack.yaml index 095a411..01ec50e 100644 --- a/stack.yaml +++ b/stack.yaml @@ -7,6 +7,6 @@ flags: nix: enable: false shell-file: shell.nix - packages: [ zlib.dev, zlib.out, pkg-config ] + # packages: [ zlib.dev, zlib.out, pkg-config ] From 818002dec63625263fbd49e09f31045b9b0f988c Mon Sep 17 00:00:00 2001 From: Tobi Oloke Date: Sun, 27 Oct 2024 00:05:29 +0100 Subject: [PATCH 5/6] Working stack build --- .gitignore | 2 ++ shell.nix | 31 ++++++++++++++++++++----------- stack.yaml | 8 ++++++-- 3 files changed, 28 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index 422baf3..aeb7cb9 100644 --- a/.gitignore +++ b/.gitignore @@ -14,8 +14,10 @@ dist-newstyle cabal-dev cabal.sandbox.config .cabal-sandbox +cabal.project* .stack-work +stack.yaml.lock bingtranslator bingtranslatorconc diff --git a/shell.nix b/shell.nix index 9fcfeff..0374aae 100644 --- a/shell.nix +++ b/shell.nix @@ -1,27 +1,36 @@ let nixpkgs = import (builtins.fetchTarball { - url = "https://github.com/NixOS/nixpkgs/archive/5c79b3dda06744a55869cae2cba6873fbbd64394.tar.gz";}) {}; - - compiler = "ghc884"; + url = "https://github.com/NixOS/nixpkgs/archive/a5c9c6373aa35597cd5a17bc5c013ed0ca462cf0.tar.gz";}) {}; + + modern-nixpkgs = import {}; + compiler = "ghc822"; hpkgs = nixpkgs.haskell.packages.${compiler}; # hs = import ./parconc-examples.nix; + # ghc-events-pkgs = import (builtins.fetchTarball { + # url = "https://github.com/NixOS/nixpkgs/archive/7cc52df39e93d427960646a1797362048fa46011.tar.gz"; + # }) {}; + parconc-pkgs = import ./parconc-examples.nix {inherit nixpkgs compiler; doBenchmark = false; }; in hpkgs.shellFor { - inherit parconc-pkgs; + # inherit parconc-pkgs; name = "parconc-examples"; packages = _: []; nativeBuildInputs = with hpkgs; [ - stack - cabal-install - haskell-language-server - nixpkgs.pkg-config - nixpkgs.zlib + modern-nixpkgs.stack + modern-nixpkgs.cabal-install + # (nixpkgs.haskell-language-server.override { supportedGhcVersions = [ compiler ];}) + # ghc-events + # hvega + # eventlog2html + # (final: prev: {final.hpkgs.eventlog2html = prev.hpkgs.eventlog2html.override { hvega = prev.hpkgs.hvega; }; }) + nixpkgs.pkgconfig # Required to build some packages + nixpkgs.zlib # Required to build some packages parallel - implicit-hie - threadscope + modern-nixpkgs.haskellPackages.implicit-hie + modern-nixpkgs.haskellPackages.threadscope ]; # ++ hs.hackages hpkgs; } diff --git a/stack.yaml b/stack.yaml index 01ec50e..2c69ed3 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,11 +1,15 @@ -resolver: lts-16.31 +resolver: lts-10.10 flags: parconc-examples: distributed: true accelerate: true +extra-deps: + - Cabal-2.2.0.1 + - text-1.2.5.0 + nix: - enable: false + enable: true shell-file: shell.nix # packages: [ zlib.dev, zlib.out, pkg-config ] From ba8659497924f178bb29b2ae13698aef923355c8 Mon Sep 17 00:00:00 2001 From: Tobi Oloke Date: Sun, 27 Oct 2024 08:27:47 +0000 Subject: [PATCH 6/6] As good as it gets --- shell.nix | 23 ++++++++++++----------- stack.yaml | 15 +++++++++++++-- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/shell.nix b/shell.nix index 0374aae..0c6bdee 100644 --- a/shell.nix +++ b/shell.nix @@ -1,36 +1,37 @@ let nixpkgs = import (builtins.fetchTarball { - url = "https://github.com/NixOS/nixpkgs/archive/a5c9c6373aa35597cd5a17bc5c013ed0ca462cf0.tar.gz";}) {}; + url = "https://github.com/NixOS/nixpkgs/archive/59b8d9cf24e9fcf10341a0923c9bdca088dca8c8.tar.gz";}) {}; - modern-nixpkgs = import {}; - compiler = "ghc822"; + modern-nixpkgs = import {}; + compiler = "ghc884"; hpkgs = nixpkgs.haskell.packages.${compiler}; - # hs = import ./parconc-examples.nix; # ghc-events-pkgs = import (builtins.fetchTarball { # url = "https://github.com/NixOS/nixpkgs/archive/7cc52df39e93d427960646a1797362048fa46011.tar.gz"; # }) {}; - parconc-pkgs = import ./parconc-examples.nix {inherit nixpkgs compiler; doBenchmark = false; }; + parconc-pkgs = import ./parconc-examples.nix {inherit nixpkgs compiler; }; in - hpkgs.shellFor { + hpkgs.shellFor rec { # inherit parconc-pkgs; name = "parconc-examples"; packages = _: []; nativeBuildInputs = with hpkgs; [ modern-nixpkgs.stack modern-nixpkgs.cabal-install - # (nixpkgs.haskell-language-server.override { supportedGhcVersions = [ compiler ];}) + haskell-language-server # ghc-events # hvega - # eventlog2html + modern-nixpkgs.haskellPackages.eventlog2html # (final: prev: {final.hpkgs.eventlog2html = prev.hpkgs.eventlog2html.override { hvega = prev.hpkgs.hvega; }; }) - nixpkgs.pkgconfig # Required to build some packages + nixpkgs.pkg-config # Required to build some packages nixpkgs.zlib # Required to build some packages parallel modern-nixpkgs.haskellPackages.implicit-hie - modern-nixpkgs.haskellPackages.threadscope - ]; # ++ hs.hackages hpkgs; + threadscope + ]; + + LD_LIBRARY_PATH = modern-nixpkgs.lib.makeLibraryPath (with nixpkgs; [ pkg-config zlib ]); } diff --git a/stack.yaml b/stack.yaml index 2c69ed3..cdfee2b 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,4 +1,4 @@ -resolver: lts-10.10 +resolver: lts-16.31 flags: parconc-examples: distributed: true @@ -6,7 +6,18 @@ flags: extra-deps: - Cabal-2.2.0.1 - - text-1.2.5.0 + # - text-1.2.5.0 + - accelerate-1.2.0.1@sha256:bb1928efe602545df4043692916ed427c959110cbd678d03c3f9c3be25d1ae88,20112 + - distributed-process-0.7.7@sha256:a46d7e159ead20f479c3cd7e7f0758321e1f3d64ad53ab8bd8df101a2c832bf7,7868 + - distributed-process-simplelocalnet-0.2.4@sha256:044a003f81a648f9fb9b1c7ae9cd8f753f5f1c32d9db5ff8b31e91e91f525ed7,3189 + - distributed-static-0.3.11@sha256:a38f56c6128d10f1c1aeb498d5a5891cd75d7a3eeb5b5f7bb8e866a46906d8c5,2732 + - normaldistribution-1.1.0.3@sha256:2615b784c4112cbf6ffa0e2b55b76790290a9b9dff18a05d8c89aa374b213477,2160 + - parsec-3.1.17.0@sha256:8407cbd428d7f640a0fff8891bd2f7aca13cebe70a5e654856f8abec9a648b56,5149 + - repa-3.4.1.5@sha256:18688f4bfecb2c454386fe149f12e73bd1d83eefd48214cae26d4e6a7ac283ae,3697 + - network-multicast-0.2.0@sha256:7cc2bd715f98ab0d891e8893b60a9a0048b5ae5b804acea96849f4ecf7260ac2,1009 + - network-transport-tcp-0.6.1@sha256:04cf5c191eb2b93b2941027840e26ed47ab76a68e37ec958ed0feeefa285da86,3399 + +allow-newer: true nix: enable: true