on master help sign in
Merge remote-tracking branch 'origin/develop' into ci-profiled
commit254a08cc8b8b371e864eaaba037471c9cc0c5b68 authorJohn Ericson <John.Ericson@Obsidian.Systems> dateFri 10 Jan 2020, 23:30 (7 years ago) parentcbff16a5c29c50
6 files changed+38−21
ChangeLog.md+2−1 default.nix+6−1 dep/reflex-platform/github.json+3−3 lib/command/obelisk-command.cabal+1−1 lib/selftest/src/Obelisk/SelfTest.hs+23−14 release.nix+3−1
ChangeLog.md+2−1
@@ -2,7 +2,7 @@
22
33This project's release branch is `master`. This log is written from the perspective of the release branch: when changes hit `master`, they are considered released, and the date should reflect that release.
44
5−## Unreleased
5+## v0.4.0.0 - 2020-01-10
66
77* Bump reflex-platform which, notably, bumps nixpkgs to 19.09. ([#585](https://github.com/obsidiansystems/obelisk/pull/585))
88* Add new thunk loader for Git repositories that supports `file://` Git remotes and supports private repositories via `builtins.fetchGit` for private repositories (when the `git.json` file specifies `"private": true`). ([#594](https://github.com/obsidiansystems/obelisk/pull/594))
@@ -11,6 +11,7 @@ This project's release branch is `master`. This log is written from the perspect
1111* Improve error messaging when a dependency doesn't have the expected `.cabal` or `package.yaml` file. ([#597](https://github.com/obsidiansystems/obelisk/pull/597))
1212* Improve the skeleton in small ways. ([#593](https://github.com/obsidiansystems/obelisk/pull/593), [#589](https://github.com/obsidiansystems/obelisk/pull/589))
1313* Fix `ob` commands to again support running from any subdirectory of an obelisk project ([#591](https://github.com/obsidiansystems/obelisk/pull/591))
14+* Add `reflex-platform-func` argument to Obelisk's `default.nix`. It defaults to it's prior behavior of using the reflex-platform in in `dep`. ([#612](https://github.com/obsidiansystems/obelisk/pull/612))
1415
1516## v0.3.0.0 - 2019-12-20
1617
default.nix+6−1
@@ -67,7 +67,12 @@ let
6767 haskellLib.overrideCabal pkg (drv: { librarySystemDepends = [ pkgs.iproute ]; })
6868 );
6969 obelisk-route = self.callCabal2nix "obelisk-route" (cleanSource ./lib/route) {};
70− obelisk-selftest = self.callCabal2nix "obelisk-selftest" (cleanSource ./lib/selftest) {};
70+ obelisk-selftest = haskellLib.overrideCabal (self.callCabal2nix "obelisk-selftest" (cleanSource ./lib/selftest) {}) {
71+ librarySystemDepends = [
72+ pkgs.cabal-install
73+ pkgs.coreutils
74+ ];
75+ };
7176 obelisk-snap-extras = self.callCabal2nix "obelisk-snap-extras" (cleanSource ./lib/snap-extras) {};
7277 tabulation = self.callCabal2nix "tabulation" (cleanSource ./lib/tabulation) {};
7378 })
dep/reflex-platform/github.json+3−3
@@ -1,7 +1,7 @@
11{
22 "owner": "reflex-frp",
33 "repo": "reflex-platform",
4− "branch": "master",
5− "rev": "76c27da89f624407717239a813128fd899dd2f4c",
6− "sha256": "0b09nq86kb7vv4jm14mc3d8gz361hhm0i48hicrsfr5g3a1dwgrn"
4+ "branch": "develop",
5+ "rev": "90351bdb2c99d416ea95fd5b8b474e8f9fab2942",
6+ "sha256": "0bbzz4ckdx0ilhhpd3drfbsc0zdb2rnhw2m3nls9villbs3lz3lh"
77}
lib/command/obelisk-command.cabal+1−1
@@ -1,5 +1,5 @@
11name: obelisk-command
2−version: 0.3
2+version: 0.4
33cabal-version: >= 1.8
44build-type: Simple
55
lib/selftest/src/Obelisk/SelfTest.hs+23−14
@@ -12,7 +12,7 @@ import Control.Monad
1212import Control.Monad.IO.Class
1313import Data.Bool (bool)
1414import Data.Function (fix)
15−import Data.Semigroup (Semigroup, (<>))
15+import Data.Semigroup ((<>))
1616import qualified Data.Set as Set
1717import Data.String
1818import Data.Text (Text)
@@ -49,13 +49,14 @@ data ObRunState
4949cp :: FilePath
5050cp = $(staticWhich "cp")
5151
52+cabalPath :: FilePath
53+cabalPath = $(staticWhich "cabal")
54+
55+gitUserConfig :: [Text]
56+gitUserConfig = ["-c", "user.name=Obelisk Selftest", "-c", "user.email=noreply@example.com"]
57+
5258commit :: Text -> Sh ()
53−commit msg = void $ run "git"
54− [ "-c"
55− , "user.name=Obelisk Selftest"
56− , "-c"
57− , "user.email=noreply@example.com"
58− , "commit"
59+commit msg = void $ run "git" $ gitUserConfig <> [ "commit"
5960 , "--no-gpg-sign"
6061 , "--allow-empty"
6162 , "-m"
@@ -113,14 +114,19 @@ main = do
113114 hspec $ parallel $ do
114115 let shelly_ = void . shellyOb verbosity
115116
116− inTmp :: (FilePath -> Sh a) -> IO ()
117− inTmp f = withTmp (chdir <*> f)
117+ defaultTmpDirName = "test λ"
118+
119+ inTmp' :: FilePath -> (FilePath -> Sh a) -> IO ()
120+ inTmp' dirname f = withTmp' dirname (chdir <*> f)
121+ inTmp = inTmp' defaultTmpDirName
118122
119− withTmp f = shelly_ . withSystemTempDirectory "test λ" $ f . fromString
123+ withTmp' dirname f = shelly_ . withSystemTempDirectory dirname $ f . fromString
124+ withTmp = withTmp' defaultTmpDirName
120125
121− inTmpObInit f = inTmp $ \dir -> do
126+ inTmpObInit' dirname f = inTmp' dirname $ \dir -> do
122127 run_ cp ["-rT", fromString initCache, toTextIgnore dir]
123128 f dir
129+ inTmpObInit = inTmpObInit' defaultTmpDirName
124130
125131 -- To be used in tests that change the obelisk impl directory
126132 inTmpObInitWithImplCopy f = inTmpObInit $ \dir ->
@@ -200,9 +206,12 @@ main = do
200206 forM_ ["ghc", "ghcjs"] $ \compiler -> do
201207 let
202208 shellName = "shells." <> compiler
203− inShell cmd' = run "nix-shell" ["default.nix", "-A", fromString shellName, "--run", cmd']
209+ inShell cmd' = run_ "nix-shell" ["default.nix", "-A", fromString shellName, "--run", cmd']
204210 it ("can enter " <> shellName) $ inTmpObInit $ \_ -> inShell "exit"
205− it ("can build in " <> shellName) $ inTmpObInit $ \_ -> inShell $ "cabal new-build --" <> fromString compiler <> " all"
211+ -- NOTE: We override the temporary directory name because cabal has a bug preventing new-build from working
212+ -- in a path that has unicode characters.
213+ it ("can build in " <> shellName) $ inTmpObInit' "test" $ \_ -> inShell $
214+ T.pack cabalPath <> " --version; " <> T.pack cabalPath <> " new-build --" <> T.pack compiler <> " all"
206215
207216 it "has idempotent thunk update" $ inTmpObInitWithImplCopy $ \_ -> do
208217 _ <- pack
@@ -308,7 +317,7 @@ testThunkPack path' = withTempFile (T.unpack $ toTextIgnore path') "test-file" $
308317 liftIO $ T.hPutStrLn handle "test file" >> hClose handle
309318 ensureThunkPackFails "modified"
310319 -- Existing stashes
311− void $ git ["stash"]
320+ void $ git $ gitUserConfig <> [ "stash" ]
312321 ensureThunkPackFails "has stashes"
313322
314323-- | Blocks until a non-empty line is available
release.nix+3−1
@@ -1,8 +1,10 @@
11{
22 supportedSystems ? [ "x86_64-linux" "x86_64-darwin" ]
33}:
4−{
4+rec {
55 recurseForDerivations = true;
66 build = import ./all-builds.nix { inherit supportedSystems; };
77 test = import ./all-tests.nix { inherit supportedSystems; };
8+
9+ inherit (build) metaCache;
810}