summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornclarke <>2018-06-19 13:12:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2018-06-19 13:12:00 (GMT)
commit1f39d7f795db9c5c259526053806cb0d6e0cbfad (patch)
tree31007fb59833b1505f7bceb8e353731a34ecf916
parent4aade684e6d16c8fcb22b0364de3d79cf9731f45 (diff)
version 1.0.11.0.1
-rw-r--r--funflow.cabal312
-rw-r--r--src/Control/Funflow/ContentHashable.hs13
2 files changed, 166 insertions, 159 deletions
diff --git a/funflow.cabal b/funflow.cabal
index 8091276..d489107 100644
--- a/funflow.cabal
+++ b/funflow.cabal
@@ -1,164 +1,158 @@
-cabal-version: >=1.10
-name: funflow
-version: 1.0.0
-license: MIT
-license-file: LICENSE
-maintainer: nicholas.clarke@tweag.io
-author: Tom Nielsen, Nicholas Clarke, Andreas Herrmann
-tested-with: ghc ==7.8.4 ghc ==7.10.2 ghc ==7.10.3 ghc ==8.0.1
-homepage: https://github.com/tweag/funflow
-bug-reports: https://github.com/tweag/funflow
-synopsis: Workflows with arrows
-description:
- An arrow with resumable computations and logging
-category: Control
-build-type: Simple
+Name: funflow
+Version: 1.0.1
+Synopsis: Workflows with arrows
+Description:
+ An arrow with resumable computations and logging
+
+License: MIT
+License-file: LICENSE
+Author: Tom Nielsen, Nicholas Clarke, Andreas Herrmann
+Maintainer: nicholas.clarke@tweag.io
+build-type: Simple
+Cabal-Version: >= 1.10
+homepage: https://github.com/tweag/funflow
+bug-reports: https://github.com/tweag/funflow
+category: Control
+Tested-With: GHC == 7.8.4, GHC == 7.10.2, GHC == 7.10.3, GHC == 8.0.1
+
extra-source-files:
- changelog.md
+ changelog.md
+
+Library
+ ghc-options: -Wall -fno-warn-type-defaults
+ hs-source-dirs: src
+ default-language: Haskell2010
+
+ Exposed-modules:
+ Control.Arrow.Async
+ , Control.Arrow.Free
+ , Control.Funflow
+ , Control.Funflow.Cache.TH
+ , Control.Funflow.ContentHashable
+ , Control.Funflow.ContentStore
+ , Control.Funflow.Diagram
+ , Control.Funflow.External
+ , Control.Funflow.External.Docker
+ , Control.Funflow.External.Executor
+ , Control.Funflow.External.Coordinator
+ , Control.Funflow.External.Coordinator.Memory
+ , Control.Funflow.External.Coordinator.Redis
+ , Control.Funflow.External.Coordinator.SQLite
+ , Control.Funflow.Lock
+ , Control.Funflow.Orphans
+ , Control.Funflow.Steps
+ , Control.Funflow.Pretty
+ , Control.Funflow.Exec.Simple
+ Other-modules:
+ Control.Funflow.Base
+ , Control.Funflow.Class
+ , Control.Funflow.ContentStore.Notify
+ Build-depends:
+ base >= 4.6 && <5
+ , aeson >= 1.2.3.0
+ , async
+ , bytestring
+ , clock
+ , constraints
+ , containers
+ , contravariant
+ , cryptonite
+ , data-default
+ , directory
+ , exceptions
+ , filepath
+ , ghc-prim
+ , hashable
+ , hedis
+ , hostname
+ , integer-gmp
+ , katip >= 0.5.0.1
+ , lens
+ , lifted-async
+ , memory
+ , monad-control
+ , mtl
+ , path > 0.6.0
+ , path-io
+ , pretty
+ , process
+ , random
+ , safe-exceptions
+ , scientific
+ , sqlite-simple
+ , stm
+ , store
+ , template-haskell >= 2.11
+ , text
+ , time
+ , transformers
+ , unix
+ , unordered-containers
+ , vector
+ , yaml
+ if os(linux)
+ CPP-options: -DOS_Linux
+ Other-modules: Control.Funflow.ContentStore.Notify.Linux
+ Build-depends: hinotify == 0.3.9
+ else
+ if os(darwin) || os(freebsd)
+ CPP-options: -DOS_BSD
+ Other-modules: Control.Funflow.ContentStore.Notify.BSD
+ Build-depends: kqueue
-library
- exposed-modules:
- Control.Arrow.Async
- Control.Arrow.Free
- Control.Funflow
- Control.Funflow.Cache.TH
- Control.Funflow.ContentHashable
- Control.Funflow.ContentStore
- Control.Funflow.Diagram
- Control.Funflow.External
- Control.Funflow.External.Docker
- Control.Funflow.External.Executor
- Control.Funflow.External.Coordinator
- Control.Funflow.External.Coordinator.Memory
- Control.Funflow.External.Coordinator.Redis
- Control.Funflow.External.Coordinator.SQLite
- Control.Funflow.Lock
- Control.Funflow.Orphans
- Control.Funflow.Steps
- Control.Funflow.Pretty
- Control.Funflow.Exec.Simple
- hs-source-dirs: src
- other-modules:
- Control.Funflow.Base
- Control.Funflow.Class
- Control.Funflow.ContentStore.Notify
- default-language: Haskell2010
- ghc-options: -Wall -fno-warn-type-defaults
- build-depends:
- base >=4.6 && <5,
- aeson >=1.2.3.0,
- async >=2.1.1.1,
- bytestring >=0.10.8.2,
- clock >=0.7.2,
- constraints >=0.9.1,
- containers >=0.5.10.2,
- contravariant >=1.4,
- cryptonite >=0.24,
- data-default >=0.7.1.1,
- directory >=1.3.0.2,
- exceptions >=0.8.3,
- filepath >=1.4.1.2,
- ghc-prim >=0.5.1.1,
- hashable >=1.2.6.1,
- hedis >=0.9.12,
- hostname >=1.0,
- integer-gmp >=1.0.1.0,
- katip >=0.5.0.1,
- lens >=4.15.4,
- lifted-async >=0.9.3.2,
- memory >=0.14.11,
- monad-control >=1.0.2.2,
- mtl >=2.2.1,
- path >0.6.0,
- path-io >=1.3.3,
- pretty >=1.1.3.3,
- process >=1.6.1.0,
- random >=1.1,
- safe-exceptions >=0.1.6.0,
- scientific >=0.3.5.2,
- sqlite-simple >=0.4.14.0,
- stm >=2.4.4.1,
- store >=0.4.3.2,
- template-haskell >=2.11,
- text >=1.2.2.2,
- time >=1.8.0.2,
- transformers >=0.5.2.0,
- unix >=2.7.2.2,
- unordered-containers >=0.2.8.0,
- vector >=0.12.0.1,
- yaml >=0.8.25.1
-
- if os(linux)
- cpp-options: -DOS_Linux
- other-modules:
- Control.Funflow.ContentStore.Notify.Linux
- build-depends:
- hinotify >=0.3.9
- else
-
- if (os(osx) || os(freebsd))
- cpp-options: -DOS_BSD
- other-modules:
- Control.Funflow.ContentStore.Notify.BSD
- build-depends:
- kqueue -any
+Executable ffexecutord
+ default-language: Haskell2010
+ main-is: app/FFExecutorD.hs
+ build-depends: base >=4.6 && <5
+ , bytestring
+ , clock
+ , funflow
+ , hedis
+ , path
+ , text
+ , unix
+ , safe-exceptions
+ , optparse-applicative
-executable ffexecutord
- main-is: app/FFExecutorD.hs
- default-language: Haskell2010
- build-depends:
- base >=4.6 && <5,
- bytestring >=0.10.8.2,
- clock >=0.7.2,
- funflow -any,
- hedis >=0.9.12,
- path >=0.6.1,
- text >=1.2.2.2,
- unix >=2.7.2.2,
- safe-exceptions >=0.1.6.0,
- optparse-applicative >=0.14.0.0
+Test-suite test-funflow
+ type: exitcode-stdio-1.0
+ default-language: Haskell2010
-test-suite test-funflow
- type: exitcode-stdio-1.0
- main-is: TestFunflow.hs
- default-language: Haskell2010
- ghc-options: -Wall -threaded
- build-depends:
- base >=4.6 && <5,
- funflow -any,
- filepath >=1.4.1.2,
- hedis >=0.9.12,
- path >=0.6.1,
- path-io >=1.3.3,
- text >=1.2.2.2,
- safe-exceptions >=0.1.6.0,
- unix >=2.7.2.2
+ main-is: TestFunflow.hs
+ ghc-options: -Wall -threaded
+ build-depends: base >=4.6 && <5
+ , funflow
+ , filepath
+ , hedis
+ , path
+ , path-io
+ , text
+ , safe-exceptions
+ , unix
-test-suite unit-tests
- type: exitcode-stdio-1.0
- main-is: Test.hs
- hs-source-dirs: test
- other-modules:
- Funflow.ContentStore
- Funflow.SQLiteCoordinator
- Funflow.TestFlows
- Control.Arrow.Async.Tests
- default-language: Haskell2010
- ghc-options: -Wall -threaded
- build-depends:
- base >=4.10.1.0,
- async >=2.1.1.1,
- containers >=0.5.10.2,
- data-default >=0.7,
- directory >=1.3.0.2,
- filepath >=1.4.1.2,
- funflow -any,
- path >=0.6.1,
- path-io >=1.3.3,
- process >=1.6.1.0,
- random >=1.1,
- safe-exceptions >=0.1.6.0,
- tasty >=0.11.3,
- tasty-hunit >=0.9.2,
- temporary >=1.2.1.1,
- unix >=2.7.2.2
+Test-suite unit-tests
+ type: exitcode-stdio-1.0
+ default-language: Haskell2010
+ hs-source-dirs: test
+ main-is: Test.hs
+ other-modules: Funflow.ContentStore
+ Funflow.SQLiteCoordinator
+ Funflow.TestFlows
+ Control.Arrow.Async.Tests
+ ghc-options: -Wall -threaded
+ build-depends: base
+ , async
+ , containers
+ , data-default >= 0.7
+ , directory
+ , filepath
+ , funflow
+ , path
+ , path-io
+ , process
+ , random
+ , safe-exceptions
+ , tasty
+ , tasty-hunit
+ , temporary
+ , unix
diff --git a/src/Control/Funflow/ContentHashable.hs b/src/Control/Funflow/ContentHashable.hs
index 44df30a..6fb41fa 100644
--- a/src/Control/Funflow/ContentHashable.hs
+++ b/src/Control/Funflow/ContentHashable.hs
@@ -49,6 +49,7 @@ module Control.Funflow.ContentHashable
) where
+import Control.Exception.Safe (catchJust)
import Control.Funflow.Orphans ()
import Control.Monad (foldM, mzero, (>=>))
import Crypto.Hash (Context, Digest, SHA256,
@@ -109,6 +110,7 @@ import qualified Path.Internal
import qualified Path.IO
import System.IO (IOMode (ReadMode),
withBinaryFile)
+import System.IO.Error (isPermissionError)
import System.IO.Unsafe (unsafePerformIO)
import System.Posix.Files (fileSize, getFileStatus)
@@ -515,6 +517,13 @@ instance ContentHashable IO ExternallyAssuredFile where
-- those as we would externally assured files, rather than just relying on the
-- directory path. Doing this traversal is pretty cheap, and it's quite likely
-- for directory contents to be modified without modifying the contents.
+--
+-- If an item in the directory cannot be read due to lacking permissions,
+-- then it will be ignored and not included in the hash. If the flow does not
+-- have permissions to access the contents of a subdirectory, then these
+-- contents cannot influence the outcome of a task and it is okay to exclude
+-- them from the hash. In that case we only hash the name, as that could
+-- influence the outcome of a task.
newtype ExternallyAssuredDirectory = ExternallyAssuredDirectory (Path.Path Path.Abs Path.Dir)
deriving (Generic, Show)
@@ -532,4 +541,8 @@ instance ContentHashable IO ExternallyAssuredDirectory where
foldM hashDir ctx' (sort dirs)
where
hashFile ctx fp = contentHashUpdate ctx (ExternallyAssuredFile fp)
+ `catchPermissionError` \_ -> contentHashUpdate ctx fp
hashDir ctx dir = contentHashUpdate ctx (ExternallyAssuredDirectory dir)
+ `catchPermissionError` \_ -> contentHashUpdate ctx dir
+ catchPermissionError = catchJust $ \e ->
+ if isPermissionError e then Just e else Nothing