From e98f10ede40e466fe5881d3339c8edb1c32741fb Mon Sep 17 00:00:00 2001 From: Elliot Cameron Date: Thu, 9 Jan 2020 14:25:27 -0500 Subject: [PATCH 1/7] Bump reflex-platform to get fix to iOS signing --- dep/reflex-platform/github.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dep/reflex-platform/github.json b/dep/reflex-platform/github.json index b51c2b1e3..f4fcca7ea 100644 --- a/dep/reflex-platform/github.json +++ b/dep/reflex-platform/github.json @@ -1,7 +1,7 @@ { "owner": "reflex-frp", "repo": "reflex-platform", - "branch": "master", - "rev": "72ca177da290dc5311c08683b8d167a205c9322e", - "sha256": "06pqml1iqc5fawwsqb7wq77gh5v07bgb92hz8r1hf0ysr0abafcg" + "branch": "develop", + "rev": "d3e7dcda076b6a2360fcc57fa808549e34c17540", + "sha256": "0bxzs9w1xcgyr6c7xarwn5kx5nwjcgs67dmrjvjdja2h1m140jf2" } From 04d4384af8a84b102d39fb3ea6667c03dbc98cd3 Mon Sep 17 00:00:00 2001 From: Ariel Nunez Date: Thu, 9 Jan 2020 16:41:26 -0500 Subject: [PATCH 2/7] Pass git user config options to git stash This is needed on a Nixos 18.09 machine with git 2.18 but not needed on a 19.09 machine. In the future, we should consider not depending on whatever git is installed and instead hardcoding it to the nix store path. --- lib/selftest/src/Obelisk/SelfTest.hs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/lib/selftest/src/Obelisk/SelfTest.hs b/lib/selftest/src/Obelisk/SelfTest.hs index 7fa90d19c..3691c9d91 100644 --- a/lib/selftest/src/Obelisk/SelfTest.hs +++ b/lib/selftest/src/Obelisk/SelfTest.hs @@ -12,7 +12,6 @@ import Control.Monad import Control.Monad.IO.Class import Data.Bool (bool) import Data.Function (fix) -import Data.Semigroup (Semigroup, (<>)) import qualified Data.Set as Set import Data.String import Data.Text (Text) @@ -49,13 +48,11 @@ data ObRunState cp :: FilePath cp = $(staticWhich "cp") +gitUserConfig :: [Text] +gitUserConfig = ["-c", "user.name=Obelisk Selftest", "-c", "user.email=noreply@example.com" ] + commit :: Text -> Sh () -commit msg = void $ run "git" - [ "-c" - , "user.name=Obelisk Selftest" - , "-c" - , "user.email=noreply@example.com" - , "commit" +commit msg = void $ run "git" $ gitUserConfig <> [ "commit" , "--no-gpg-sign" , "--allow-empty" , "-m" @@ -308,7 +305,7 @@ testThunkPack path' = withTempFile (T.unpack $ toTextIgnore path') "test-file" $ liftIO $ T.hPutStrLn handle "test file" >> hClose handle ensureThunkPackFails "modified" -- Existing stashes - void $ git ["stash"] + void $ git $ gitUserConfig <> [ "stash" ] ensureThunkPackFails "has stashes" -- | Blocks until a non-empty line is available From 89562b68bddb8117787e66938488bc0d82da51f6 Mon Sep 17 00:00:00 2001 From: Elliot Cameron Date: Thu, 9 Jan 2020 17:38:06 -0500 Subject: [PATCH 3/7] Fix selftest again by working around cabal bug --- default.nix | 7 ++++++- lib/selftest/src/Obelisk/SelfTest.hs | 26 +++++++++++++++++++------- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/default.nix b/default.nix index d651b3412..fcfca1fc9 100644 --- a/default.nix +++ b/default.nix @@ -67,7 +67,12 @@ let haskellLib.overrideCabal pkg (drv: { librarySystemDepends = [ pkgs.iproute ]; }) ); obelisk-route = self.callCabal2nix "obelisk-route" (cleanSource ./lib/route) {}; - obelisk-selftest = self.callCabal2nix "obelisk-selftest" (cleanSource ./lib/selftest) {}; + obelisk-selftest = haskellLib.overrideCabal (self.callCabal2nix "obelisk-selftest" (cleanSource ./lib/selftest) {}) { + librarySystemDepends = [ + pkgs.cabal-install + pkgs.coreutils + ]; + }; obelisk-snap-extras = self.callCabal2nix "obelisk-snap-extras" (cleanSource ./lib/snap-extras) {}; tabulation = self.callCabal2nix "tabulation" (cleanSource ./lib/tabulation) {}; }) diff --git a/lib/selftest/src/Obelisk/SelfTest.hs b/lib/selftest/src/Obelisk/SelfTest.hs index 3691c9d91..2095696ef 100644 --- a/lib/selftest/src/Obelisk/SelfTest.hs +++ b/lib/selftest/src/Obelisk/SelfTest.hs @@ -12,6 +12,7 @@ import Control.Monad import Control.Monad.IO.Class import Data.Bool (bool) import Data.Function (fix) +import Data.Semigroup ((<>)) import qualified Data.Set as Set import Data.String import Data.Text (Text) @@ -48,8 +49,11 @@ data ObRunState cp :: FilePath cp = $(staticWhich "cp") +cabalPath :: FilePath +cabalPath = $(staticWhich "cabal") + gitUserConfig :: [Text] -gitUserConfig = ["-c", "user.name=Obelisk Selftest", "-c", "user.email=noreply@example.com" ] +gitUserConfig = ["-c", "user.name=Obelisk Selftest", "-c", "user.email=noreply@example.com"] commit :: Text -> Sh () commit msg = void $ run "git" $ gitUserConfig <> [ "commit" @@ -110,14 +114,19 @@ main = do hspec $ parallel $ do let shelly_ = void . shellyOb verbosity - inTmp :: (FilePath -> Sh a) -> IO () - inTmp f = withTmp (chdir <*> f) + defaultTmpDirName = "test λ" + + inTmp' :: FilePath -> (FilePath -> Sh a) -> IO () + inTmp' dirname f = withTmp' dirname (chdir <*> f) + inTmp = inTmp' defaultTmpDirName - withTmp f = shelly_ . withSystemTempDirectory "test λ" $ f . fromString + withTmp' dirname f = shelly_ . withSystemTempDirectory dirname $ f . fromString + withTmp = withTmp' defaultTmpDirName - inTmpObInit f = inTmp $ \dir -> do + inTmpObInit' dirname f = inTmp' dirname $ \dir -> do run_ cp ["-rT", fromString initCache, toTextIgnore dir] f dir + inTmpObInit = inTmpObInit' defaultTmpDirName -- To be used in tests that change the obelisk impl directory inTmpObInitWithImplCopy f = inTmpObInit $ \dir -> @@ -197,9 +206,12 @@ main = do forM_ ["ghc", "ghcjs"] $ \compiler -> do let shellName = "shells." <> compiler - inShell cmd' = run "nix-shell" ["default.nix", "-A", fromString shellName, "--run", cmd'] + inShell cmd' = run_ "nix-shell" ["default.nix", "-A", fromString shellName, "--run", cmd'] it ("can enter " <> shellName) $ inTmpObInit $ \_ -> inShell "exit" - it ("can build in " <> shellName) $ inTmpObInit $ \_ -> inShell $ "cabal new-build --" <> fromString compiler <> " all" + -- NOTE: We override the temporary directory name because cabal has a bug preventing new-build from working + -- in a path that has unicode characters. + it ("can build in " <> shellName) $ inTmpObInit' "test" $ \_ -> inShell $ + T.pack cabalPath <> " --version; " <> T.pack cabalPath <> " new-build --" <> T.pack compiler <> " all" it "has idempotent thunk update" $ inTmpObInitWithImplCopy $ \_ -> do _ <- pack From 0aaf0d34cb016ea8e8bc88af33bd73a831407113 Mon Sep 17 00:00:00 2001 From: Elliot Cameron Date: Fri, 10 Jan 2020 17:13:45 -0500 Subject: [PATCH 4/7] Mention reflex-platform-func in ChangeLog --- ChangeLog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog.md b/ChangeLog.md index b32ba019a..7df2619d2 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -11,6 +11,7 @@ This project's release branch is `master`. This log is written from the perspect * Improve error messaging when a dependency doesn't have the expected `.cabal` or `package.yaml` file. ([#597](https://github.com/obsidiansystems/obelisk/pull/597)) * Improve the skeleton in small ways. ([#593](https://github.com/obsidiansystems/obelisk/pull/593), [#589](https://github.com/obsidiansystems/obelisk/pull/589)) * Fix `ob` commands to again support running from any subdirectory of an obelisk project ([#591](https://github.com/obsidiansystems/obelisk/pull/591)) +* 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)) ## v0.3.0.0 - 2019-12-20 From 8d0c330137fe7b03fc511a5c85de592285086b85 Mon Sep 17 00:00:00 2001 From: Elliot Cameron Date: Fri, 10 Jan 2020 17:15:02 -0500 Subject: [PATCH 5/7] Version 0.4 --- lib/command/obelisk-command.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/command/obelisk-command.cabal b/lib/command/obelisk-command.cabal index 3f60f3ebf..dacf320a1 100644 --- a/lib/command/obelisk-command.cabal +++ b/lib/command/obelisk-command.cabal @@ -1,5 +1,5 @@ name: obelisk-command -version: 0.3 +version: 0.4 cabal-version: >= 1.8 build-type: Simple From e708bf0cffcb07a80746dc4924005c156fa78368 Mon Sep 17 00:00:00 2001 From: Elliot Cameron Date: Fri, 10 Jan 2020 17:17:02 -0500 Subject: [PATCH 6/7] Update ChangeLog for version 0.4 --- ChangeLog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index 7df2619d2..45fcee877 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -2,7 +2,7 @@ This 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. -## Unreleased +## v0.4.0.0 - 2020-01-10 * Bump reflex-platform which, notably, bumps nixpkgs to 19.09. ([#585](https://github.com/obsidiansystems/obelisk/pull/585)) * 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)) From 1483b2b0068f76e612afaa6187d26188e9704750 Mon Sep 17 00:00:00 2001 From: Elliot Cameron Date: Fri, 10 Jan 2020 17:34:31 -0500 Subject: [PATCH 7/7] Add metaCache back to release.nix --- release.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/release.nix b/release.nix index 4300c5199..f04c6669c 100644 --- a/release.nix +++ b/release.nix @@ -1,8 +1,10 @@ { supportedSystems ? [ "x86_64-linux" "x86_64-darwin" ] }: -{ +rec { recurseForDerivations = true; build = import ./all-builds.nix { inherit supportedSystems; }; test = import ./all-tests.nix { inherit supportedSystems; }; + + inherit (build) metaCache; }