Skip to content

Commit

Permalink
Upgrade to LTS 22.18
Browse files Browse the repository at this point in the history
This required updated the Aeson package to use their new KeyMap
conventions.
  • Loading branch information
arendsee committed Apr 28, 2024
1 parent 139eeb1 commit c8277b0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
14 changes: 7 additions & 7 deletions library/Morloc/Config.hs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ module Morloc.Config
import Morloc.Data.Doc
import Morloc.Namespace
import qualified Morloc.Language as ML
import qualified Data.HashMap.Strict as H
import qualified Data.Yaml.Config as YC
import qualified Morloc.Data.Text as MT
import qualified Morloc.System as MS
import qualified Data.Aeson.KeyMap as K


getDefaultConfigFilepath :: IO Path
Expand All @@ -35,10 +35,10 @@ loadDefaultMorlocConfig = do
defaults <- defaultFields
return $
Config
(MT.unpack $ defaults H.! "home")
(MT.unpack $ defaults H.! "source")
(MT.unpack $ defaults H.! "plane")
(MT.unpack $ defaults H.! "tmpdir")
(MT.unpack . fromJust $ defaults K.!? "home")
(MT.unpack . fromJust $ defaults K.!? "source")
(MT.unpack . fromJust $ defaults K.!? "plane")
(MT.unpack . fromJust $ defaults K.!? "tmpdir")
"python3" -- lang_python3
"Rscript" -- lang_R
"perl" -- lang_perl
Expand Down Expand Up @@ -86,12 +86,12 @@ buildPoolCallBase c (Just Python3Lang) i =
buildPoolCallBase _ _ _ = Nothing -- FIXME: add error handling

-- A key value map
defaultFields :: IO (H.HashMap MT.Text MT.Text)
defaultFields :: IO (K.KeyMap MT.Text)
defaultFields = do
home <- MT.pack <$> getDefaultMorlocHome
lib <- MT.pack <$> getDefaultMorlocSource
tmp <- MT.pack <$> getDefaultMorlocTmpDir
return $ H.fromList [("home", home), ("source", lib), ("plane", "morloclib"), ("tmpdir", tmp)]
return $ K.fromList [("home", home), ("source", lib), ("plane", "morloclib"), ("tmpdir", tmp)]

-- | Get the Morloc home directory (absolute path)
getDefaultMorlocHome :: IO Path
Expand Down
3 changes: 3 additions & 0 deletions package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ extra-source-files:
- README.md
- ChangeLog.md

default-extensions:
- TypeOperators

dependencies:
- base
- aeson
Expand Down
10 changes: 5 additions & 5 deletions stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# resolver:
# name: custom-snapshot
# location: "./custom-snapshot.yaml"
resolver: lts-18.28
resolver: lts-22.18

# User packages to be built.
# Various formats can be used as shown in the example below.
Expand All @@ -37,10 +37,10 @@ resolver: lts-18.28
# will not be run. This is useful for tweaking upstream packages.
packages:
- .
# Dependency packages to be pulled from upstream that are not in the resolver
# (e.g., acme-missiles-0.3)
extra-deps:
- partial-order-0.2.0.0@sha256:a0d6ddc9ebcfa965a5cbcff1d06d46a79d44ea5a0335c583c2a51bcb41334487,2275
# # Dependency packages to be pulled from upstream that are not in the resolver
# # (e.g., acme-missiles-0.3)
# extra-deps:
# - partial-order-0.2.0.0@sha256:a0d6ddc9ebcfa965a5cbcff1d06d46a79d44ea5a0335c583c2a51bcb41334487,2275

# Override default flag values for local packages and extra-deps
# flags: {}
Expand Down

0 comments on commit c8277b0

Please sign in to comment.