on master help sign in
Use staticWhich for ghcid, and add custom source

This adds a custom ghcid pointing to https://github.com/ndmitchell/ghcid/pull/288 for better error messages. Also uses staticWhich to find ghcid for use in ob run. As a result, we no include ghcid in Obelisk runtime. Fixes #563

commit5b8da3dd4644295cc61576d54379a0fdd1844fc3 authorMatthew Bauer <mjbauer95@gmail.com> dateFri 29 Nov 2019, 18:10 (7 years ago) parentb3f1717
5 files changed+21−2
ChangeLog.md+3 default.nix+3−1 dep/ghcid/default.nix+7 dep/ghcid/github.json+7 lib/command/src/Obelisk/Command/Run.hs+1−1
ChangeLog.md+3
@@ -14,6 +14,9 @@ This project's release branch is `master`. This log is written from the perspect
1414* Use `--keep NIX_PATH` for all pure shells so references to `<nixpkgs>` continues to work.
1515* Backport ACMEv2 support in obelisk server to regain LetsEncrypt account creation.
1616* Enable https in `ob run`
17+* `ob run` now handles ghci errors better, and includes a custom ghcid
18+ version. As a result, you no longer need to have ghcid installed to
19+ use `ob run`, as we provide one for you.
1720
1821## v0.2.0.0 - 2019-8-17
1922
default.nix+3−1
@@ -45,6 +45,8 @@ let
4545 doCheck = false;
4646 });
4747 hnix-store-core = self.callHackage "hnix-store-core" "0.1.0.0" {};
48+
49+ ghcid = haskellLib.justStaticExecutables (self.callCabal2nix "ghcid" (hackGet ./dep/ghcid) {});
4850 })
4951
5052 pkgs.obeliskExecutableConfig.haskellOverlay
@@ -59,7 +61,7 @@ let
5961 obelisk-asset-serve-snap = self.callCabal2nix "obelisk-asset-serve-snap" (cleanSource ./lib/asset/serve-snap) {};
6062 obelisk-backend = self.callCabal2nix "obelisk-backend" (cleanSource ./lib/backend) {};
6163 obelisk-cliapp = self.callCabal2nix "obelisk-cliapp" (cleanSource ./lib/cliapp) {};
62− obelisk-command = haskellLib.overrideCabal (self.callCabal2nix "obelisk-command" (cleanSource ./lib/command) {}) { librarySystemDepends = [ pkgs.nix ]; };
64+ obelisk-command = haskellLib.overrideCabal (self.callCabal2nix "obelisk-command" (cleanSource ./lib/command) {}) { librarySystemDepends = [ pkgs.nix self.ghcid ]; };
6365 obelisk-frontend = self.callCabal2nix "obelisk-frontend" (cleanSource ./lib/frontend) {};
6466 obelisk-run = self.callCabal2nix "obelisk-run" (cleanSource ./lib/run) {};
6567 obelisk-route = self.callCabal2nix "obelisk-route" (cleanSource ./lib/route) {};
dep/ghcid/default.nixnew file+7
@@ -0,0 +1,7 @@
1+# DO NOT HAND-EDIT THIS FILE
2+import ((import <nixpkgs> {}).fetchFromGitHub (
3+ let json = builtins.fromJSON (builtins.readFile ./github.json);
4+ in { inherit (json) owner repo rev sha256;
5+ private = json.private or false;
6+ }
7+))
dep/ghcid/github.jsonnew file+7
@@ -0,0 +1,7 @@
1+{
2+ "owner": "obsidiansystems",
3+ "repo": "ghcid",
4+ "branch": "show-unexpected-exit-msg",
5+ "rev": "54e047560002711b30554a966d6fc511baf0eede",
6+ "sha256": "18b86j078b9li3q3cvzf9i1l571k0ci8a3f8likzhc1p7bsb5b8d"
7+}
lib/command/src/Obelisk/Command/Run.hs+1−1
@@ -227,7 +227,7 @@ runGhcid
227227 => FilePath -- ^ Path to .ghci
228228 -> Maybe String -- ^ Optional command to run at every reload
229229 -> m ()
230−runGhcid dotGhci mcmd = callCommand $ unwords $ "ghcid" : opts
230+runGhcid dotGhci mcmd = callCommand $ unwords $ $(staticWhich "ghcid") : opts
231231 where
232232 opts =
233233 [ "-W"