Bump aws build dependency to 0.24.1
authorJoey Hess <joeyh@joeyh.name>
Wed, 13 Aug 2025 19:30:47 +0000 (15:30 -0400)
committerJoey Hess <joeyh@joeyh.name>
Wed, 13 Aug 2025 19:32:39 +0000 (15:32 -0400)
That's the version in Debian stable now. And this removes a lot of ifdefs.

Also I'm pretty sure a recent commit broke building with older versions of
aws, although that could be fixed with sufficent testing.

CHANGELOG
Remote/S3.hs
doc/special_remotes/S3.mdwn
git-annex.cabal

index 6fb6f99d6b4b8c5ea5bda86b9cc4757e1701b58d..2d046bf671169d2ebd0714d21dde90c2a1285d1c 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -4,7 +4,6 @@ git-annex (10.20250722) UNRELEASED; urgency=medium
     provided by external commands git-annex-p2p-<netname>
   * Added git-remote-p2p-annex, which allows git pull and push to
     P2P networks provided by commands git-annex-p2p-<netname>
-  * stack.yaml: Update to lts-24.2.
   * S3: Default to signature=v4 when using an AWS endpoint, since some
     AWS regions need v4 and all support it. When host= is used to specify
     a different S3 host, the default remains signature=v2.
@@ -13,6 +12,8 @@ git-annex (10.20250722) UNRELEASED; urgency=medium
   * S3: When initremote is given the name of a bucket that already exists,
     automatically set datacenter to the right value, rather than needing it
     to be explicitly set. (This needs aws-0.23)
+  * Bump aws build dependency to 0.24.1.
+  * stack.yaml: Update to lts-24.2.
 
  -- Joey Hess <id@joeyh.name>  Wed, 30 Jul 2025 13:45:42 -0400
 
index 4da5ff3f36caead5d2afa78ce6083b67068bd8d9..cc8c6d7c8349865eec8d43016874390b108155fe 100644 (file)
@@ -438,7 +438,6 @@ retrieve hv r rs c info = fileRetriever' $ \f k p iv -> withS3Handle hv $ \case
                                giveup "cannot download content"
                        Right us -> unlessM (withUrlOptions Nothing $ downloadUrl False k p iv us f) $
                                giveup "failed to download content"
-       Left S3HandleAnonymousOldAws -> giveupS3HandleProblem S3HandleAnonymousOldAws (uuid r)
 
 retrieveHelper :: S3Info -> S3Handle -> (Either S3.Object S3VersionID) -> OsPath -> MeterUpdate -> Maybe IncrementalVerifier -> Annex ()
 retrieveHelper info h loc f p iv = retrieveHelper' h f p iv $
@@ -487,7 +486,6 @@ checkKey hv r rs c info k = withS3Handle hv $ \case
                                let check u = withUrlOptions Nothing $ 
                                        Url.checkBoth u (fromKey keySize k)
                                anyM check us
-       Left S3HandleAnonymousOldAws -> giveupS3HandleProblem S3HandleAnonymousOldAws (uuid r)
 
 checkKeyHelper :: S3Info -> S3Handle -> (Either S3.Object S3VersionID) -> Annex Bool
 checkKeyHelper info h loc = checkKeyHelper' info h o limit
@@ -528,7 +526,6 @@ retrieveExportS3 hv r info k loc f p = verifyKeyContentIncrementally AlwaysVerif
                                withUrlOptions Nothing
                                        (Url.download' p iv (geturl exportloc) f)
                        Nothing -> giveup $ needS3Creds (uuid r)
-               Left S3HandleAnonymousOldAws -> giveupS3HandleProblem S3HandleAnonymousOldAws (uuid r)
   where
        exportloc = bucketExportLocation info loc
 
@@ -549,7 +546,6 @@ checkPresentExportS3 hv r info k loc = withS3Handle hv $ \case
                Just geturl -> withUrlOptions Nothing $
                        Url.checkBoth (geturl $ bucketExportLocation info loc) (fromKey keySize k)
                Nothing -> giveupS3HandleProblem S3HandleNeedCreds (uuid r)
-       Left S3HandleAnonymousOldAws -> giveupS3HandleProblem S3HandleAnonymousOldAws (uuid r)
 
 -- S3 has no move primitive; copy and delete.
 renameExportS3 :: S3HandleVar -> Remote -> RemoteStateHandle -> S3Info -> Key -> ExportLocation -> ExportLocation -> Annex (Maybe ())
@@ -787,7 +783,6 @@ checkPresentExportWithContentIdentifierS3 hv r info _k loc knowncids =
 
 getBucketLocation :: ParsedRemoteConfig -> RemoteGitConfig -> UUID -> Annex (Maybe S3.LocationConstraint)
 getBucketLocation c gc u = do
-#if MIN_VERSION_aws(0,23,0)
        info <- extractS3Info c
        let info' = info { region = Nothing, host = Nothing }
        -- Force anonymous access, because this API call does not work
@@ -797,9 +792,6 @@ getBucketLocation c gc u = do
                r <- liftIO $ tryNonAsync $ runResourceT $
                        sendS3Handle h (S3.getBucketLocation $ bucket info')
                return $ either (const Nothing) (Just . S3.gblrLocationConstraint) r
-#else
-       return Nothing
-#endif
 
 {- Generate the bucket if it does not already exist, including creating the
  - UUID file within the bucket.
@@ -909,28 +901,19 @@ sendS3Handle h r = AWS.pureAws (hawscfg h) (hs3cfg h) (hmanager h) r
 
 type S3HandleVar = TVar (Either (Annex (Either S3HandleProblem S3Handle)) (Either S3HandleProblem S3Handle))
 
-data S3HandleProblem
-       = S3HandleNeedCreds
-       | S3HandleAnonymousOldAws
+data S3HandleProblem = S3HandleNeedCreds
 
 giveupS3HandleProblem :: S3HandleProblem -> UUID -> Annex a
 giveupS3HandleProblem S3HandleNeedCreds u = do
        warning $ UnquotedString $ needS3Creds u
        giveup "No S3 credentials configured"
-giveupS3HandleProblem S3HandleAnonymousOldAws _ =
-       giveup "This S3 special remote is configured with signature=anonymous, but git-annex is built with too old a version of the aws library to support that."
 
 {- Prepares a S3Handle for later use. Does not connect to S3 or do anything
  - else expensive. -}
 mkS3HandleVar :: Bool -> ParsedRemoteConfig -> RemoteGitConfig -> UUID -> Annex S3HandleVar
 mkS3HandleVar forceanonymous c gc u = liftIO $ newTVarIO $ Left $
        if forceanonymous || isAnonymous c
-               then 
-#if MIN_VERSION_aws(0,23,0)
-                       go =<< liftIO AWS.anonymousCredentials
-#else
-                       return (Left S3HandleAnonymousOldAws)
-#endif
+               then go =<< liftIO AWS.anonymousCredentials
                else do
                        mcreds <- getRemoteCredPair c gc (AWS.creds u)
                        case mcreds of
@@ -1011,11 +994,8 @@ s3Configuration _ua c = cfg
                        | otherwise -> AWS.HTTP
        cfg = if usev4 $ getRemoteConfigValue signatureField c
                then (S3.s3v4 proto endpoint False S3.SignWithEffort)
-#if MIN_VERSION_aws(0,24,0)
                        { S3.s3Region = r }
-#endif
                else (S3.s3 proto endpoint False)
-#if MIN_VERSION_aws(0,24,0)
                        { S3.s3Region = r }
        
        -- Use signature v4 for all AWS hosts by default, but don't use it by
@@ -1029,7 +1009,6 @@ s3Configuration _ua c = cfg
        usev4 Nothing = False
 
        r = encodeBS <$> getRemoteConfigValue regionField c
-#endif
 
 data S3Info = S3Info
        { bucket :: S3.Bucket
@@ -1209,11 +1188,9 @@ s3Info :: ParsedRemoteConfig -> S3Info -> [(String, String)]
 s3Info c info = catMaybes
        [ Just ("bucket", fromMaybe "unknown" (getBucketName c))
        , Just ("endpoint", decodeBS (S3.s3Endpoint s3c))
-#if MIN_VERSION_aws(0,24,0)
        , case S3.s3Region s3c of
                Nothing -> Nothing
                Just r -> Just ("region", decodeBS r)
-#endif
        , Just ("port", show (S3.s3Port s3c))
        , Just ("protocol", map toLower (show (S3.s3Protocol s3c)))
        , Just ("storage class", showstorageclass (getStorageClass c))
index 935839a815e5d13cca2d546bc855cc5afd9e4641..36c3b101a3584a48ac8a8015a679e3d1bcc80437 100644 (file)
@@ -47,7 +47,7 @@ the S3 remote.
   When using Amazon S3,
   if the remote will be used for backup or archival,
   and so its files are Infrequently Accessed, `STANDARD_IA` is a
-  good choice to save money (requires a git-annex built with aws-0.13.0).
+  good choice to save money.
   If you have configured git-annex to preserve
   multiple [[copies]], also consider setting this to `ONEZONE_IA`
   to save even more money.
@@ -56,7 +56,7 @@ the S3 remote.
   use the [[glacier]] special remote, rather than this one.
 
   When using Google Cloud Storage, to make a nearline bucket, set this to
-  `NEARLINE`. (Requires a git-annex built with aws-0.13.0)
+  `NEARLINE`.
 
   Note that changing the storage class of an existing S3 remote will
   affect new objects sent to the remote, but not objects already
@@ -67,7 +67,6 @@ the S3 remote.
 
 * `region` - Specify the region to use. Only makes sense to use when
   you also set `host`.
-  (Requires a git-annex built with aws-0.24.)
 
 * `protocol` - Either "http" (the default) or "https". Setting
   protocol=https implies port=443. 
index 0da9a568452f6f5b1bf27af8f9c53761f2f08fd9..bd678f1a5cc0bc27c4af847075d9620b815d27be 100644 (file)
@@ -278,7 +278,7 @@ Executable git-annex
    tasty-quickcheck,
    tasty-rerun,
    ansi-terminal >= 0.9,
-   aws (>= 0.22.1),
+   aws (>= 0.24.1),
    DAV (>= 1.0),
    network (>= 3.0.0.0),
    network-bsd,