-
Notifications
You must be signed in to change notification settings - Fork 49
Update hackage-security to GHC 8.8 #234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -94,7 +94,10 @@ data HasUpdates = HasUpdates | NoUpdates | |
-- You should pass @Nothing@ for the UTCTime _only_ under exceptional | ||
-- circumstances (such as when the main server is down for longer than the | ||
-- expiry dates used in the timestamp files on mirrors). | ||
checkForUpdates :: (Throws VerificationError, Throws SomeRemoteError) | ||
checkForUpdates :: ( MonadFail ReadJSON_Keys_Layout | ||
, Throws VerificationError | ||
, Throws SomeRemoteError | ||
) | ||
=> Repository down | ||
-> Maybe UTCTime -- ^ To check expiry times against (if using) | ||
-> IO HasUpdates | ||
|
@@ -335,6 +338,8 @@ cachedVersion CachedInfo{..} remoteFile = | |
getCachedInfo :: | ||
#if __GLASGOW_HASKELL__ < 800 | ||
(Applicative m, MonadIO m) | ||
#elif __GLASGOW_HASKELL__ >= 807 | ||
(MonadFail ReadJSON_Keys_Layout, MonadIO m) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indeed this seems rather odd. I haven't looked at the surrounding code but it does seem suspicious that you would need to add a constraint of this form. Are you sure this is necessary? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not clear how Should I try to replace There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My @edsko I see you wrote the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. THe cloest I have gotten is Security/Client.hs:211:18: warning:
• Couldn't match type ‘IOException’ with ‘DeserializationError’
arising from a functional dependency between:
constraint ‘MonadError DeserializationError IO’
arising from the type signature for:
checkForUpdates :: forall (down :: * -> *).
(MonadError DeserializationError IO,
Throws VerificationError, Throws SomeRemoteError) =>
Repository down -> Maybe UTCTime -> IO HasUpdates
instance ‘MonadError IOException IO’ at <no location info>
Inaccessible code in
a pattern with constructor: FGz :: Format FormatGz,
in a case alternative
• In the pattern: FGz
In the pattern: Some FGz
In a case alternative:
Some FGz -> verifyFileInfo' (Just newInfoTarGz) targetPath tempPath |
||
#else | ||
MonadIO m | ||
#endif | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,6 +68,7 @@ instance MonadReader RepoLayout m => ToJSON m Snapshot where | |
|
||
instance ( MonadReader RepoLayout m | ||
, MonadError DeserializationError m | ||
, MonadFail m | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In this case I would probably try to use the let lookupFile path =
withExceptT DeserializationErrorSchema
$ liftEither $ FileMap.lookupM snapshotMeta path and use this in place of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was not able to make this work ( lookupErr :: MonadError e m => (String -> e) -> FileMap -> TargetPath -> m FileInfo |
||
, ReportSchemaErrors m | ||
) => FromJSON m Snapshot where | ||
fromJSON enc = do | ||
|
@@ -82,7 +83,10 @@ instance ( MonadReader RepoLayout m | |
let snapshotInfoTar = FileMap.lookup (pathIndexTar repoLayout) snapshotMeta | ||
return Snapshot{..} | ||
|
||
instance (MonadKeys m, MonadReader RepoLayout m) => FromJSON m (Signed Snapshot) where | ||
instance ( MonadFail m | ||
, MonadKeys m | ||
, MonadReader RepoLayout m | ||
) => FromJSON m (Signed Snapshot) where | ||
fromJSON = signedFromJSON | ||
|
||
{------------------------------------------------------------------------------- | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line here makes me suspect this is against some fairly ancient state of the master branch