Skip to content

Commit

Permalink
Support lockfiles, take 2 (#1138)
Browse files Browse the repository at this point in the history
Add lockfile support for all builds, no opt-out
  • Loading branch information
f-f authored Dec 20, 2023
1 parent ffd9265 commit ebde68c
Show file tree
Hide file tree
Showing 68 changed files with 3,619 additions and 842 deletions.
5 changes: 4 additions & 1 deletion bin/spago.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ package:
publish:
version: 0.93.19
license: BSD-3-Clause
build:
censor_project_warnings:
- WildcardInferredType
dependencies:
- aff
- optparse
- arrays
- codec-argonaut
- console
Expand All @@ -14,6 +16,7 @@ package:
- node-fs
- node-path
- node-process
- optparse
- ordered-collections
- record
- refs
Expand Down
7 changes: 7 additions & 0 deletions bin/src/Flags.purs
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,13 @@ transitive =
<> O.help "Include transitive dependencies"
)

pure :: Parser Boolean
pure =
O.switch
( O.long "pure"
<> O.help "Use the package information from the current lockfile, even if it is out of date"
)

pedanticPackages :: Parser Boolean
pedanticPackages =
O.switch
Expand Down
171 changes: 61 additions & 110 deletions bin/src/Main.purs

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions core/src/Config.purs
Original file line number Diff line number Diff line change
Expand Up @@ -288,12 +288,10 @@ type WorkspaceConfig =
, extra_packages :: Maybe (Map PackageName ExtraPackage)
, backend :: Maybe BackendConfig
, build_opts :: Maybe WorkspaceBuildOptionsInput
, lock :: Maybe Boolean
}

workspaceConfigCodec :: JsonCodec WorkspaceConfig
workspaceConfigCodec = CA.object "WorkspaceConfig"
$ CA.recordPropOptional (Proxy :: _ "lock") CA.boolean
$ CA.recordPropOptional (Proxy :: _ "package_set") setAddressCodec
$ CA.recordPropOptional (Proxy :: _ "backend") backendConfigCodec
$ CA.recordPropOptional (Proxy :: _ "build_opts") buildOptionsCodec
Expand Down
5 changes: 3 additions & 2 deletions core/src/Prelude.purs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import Prelude

import Control.Alt ((<|>)) as Extra
import Control.Monad.Error.Class (class MonadError, class MonadThrow, try, catchError) as Extra
import Control.Monad.Reader (ask, asks) as Extra
import Control.Monad.Reader (class MonadAsk, ReaderT, runReaderT)
import Control.Monad.Reader (ask, asks, local) as Extra
import Control.Monad.Reader (class MonadAsk, class MonadReader, ReaderT, runReaderT)
import Control.Monad.State (StateT) as Extra
import Data.Array ((..)) as Extra
import Data.Array.NonEmpty (NonEmptyArray) as Extra
Expand Down Expand Up @@ -65,6 +65,7 @@ derive newtype instance Extra.MonadAff (Spago env)
derive newtype instance Extra.MonadThrow Extra.Error (Spago env)
derive newtype instance Extra.MonadError Extra.Error (Spago env)
derive newtype instance MonadAsk env (Spago env)
derive newtype instance MonadReader env (Spago env)

runSpago' :: forall a env. env -> Spago env a -> Extra.Aff a
runSpago' env (Spago m) = runReaderT m env
Expand Down
35 changes: 26 additions & 9 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ebde68c

Please sign in to comment.