Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into ci-profiled
Browse files Browse the repository at this point in the history
  • Loading branch information
Ericson2314 committed Jan 10, 2020
2 parents cbff16a + 5c29c50 commit 254a08c
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 21 deletions.
3 changes: 2 additions & 1 deletion ChangeLog.md
Expand Up @@ -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))
Expand All @@ -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

Expand Down
7 changes: 6 additions & 1 deletion default.nix
Expand Up @@ -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) {};
})
Expand Down
6 changes: 3 additions & 3 deletions dep/reflex-platform/github.json
@@ -1,7 +1,7 @@
{
"owner": "reflex-frp",
"repo": "reflex-platform",
"branch": "master",
"rev": "76c27da89f624407717239a813128fd899dd2f4c",
"sha256": "0b09nq86kb7vv4jm14mc3d8gz361hhm0i48hicrsfr5g3a1dwgrn"
"branch": "develop",
"rev": "90351bdb2c99d416ea95fd5b8b474e8f9fab2942",
"sha256": "0bbzz4ckdx0ilhhpd3drfbsc0zdb2rnhw2m3nls9villbs3lz3lh"
}
2 changes: 1 addition & 1 deletion 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

Expand Down
37 changes: 23 additions & 14 deletions lib/selftest/src/Obelisk/SelfTest.hs
Expand Up @@ -12,7 +12,7 @@ import Control.Monad
import Control.Monad.IO.Class
import Data.Bool (bool)
import Data.Function (fix)
import Data.Semigroup (Semigroup, (<>))
import Data.Semigroup ((<>))
import qualified Data.Set as Set
import Data.String
import Data.Text (Text)
Expand Down Expand Up @@ -49,13 +49,14 @@ 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"]

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"
Expand Down Expand Up @@ -113,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 ->
Expand Down Expand Up @@ -200,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
Expand Down Expand Up @@ -308,7 +317,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
Expand Down
4 changes: 3 additions & 1 deletion 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;
}

0 comments on commit 254a08c

Please sign in to comment.