Skip to content

Commit

Permalink
Fix build with ghc 9.0.1
Browse files Browse the repository at this point in the history
Continuing along the same lines as commit
2739adc, it seems that
while Remote -> Retriever expands to the same data type this changes
it to, ghc 9.0.1 refuses to consider them equiviant. I guess it has
something to do with the forall?

The rest of the build all succeeds, although the stack build then crashes:
Linking .stack-work/dist/x86_64-linux-tinfo6/Cabal-3.4.0.0/build/git-annex/git-annex ...
Completed 233 action(s).
Prelude.chr: bad argument: 2214592520
This issue seems likely to be about it:
commercialhaskell/stack#5508
I'm building with stack from debian, version 2.3.3, so a newer stack
probably avoids that. Anyway, despite that stack problem,
the git-annex binary is built, and works.

The stack.yaml I used for this build was patched as follows:

diff --git a/stack.yaml b/stack.yaml
index 8dac87c15..62c4b5b9d 100644
--- a/stack.yaml
+++ b/stack.yaml
@@ -1,6 +1,6 @@
 flags:
   git-annex:
-    production: true
+    production: false
     assistant: true
     pairing: true
     torrentparser: true
@@ -14,7 +14,7 @@ flags:
     httpclientrestricted: true
 packages:
 - '.'
-resolver: lts-18.13
+resolver: nightly-2021-09-07
 extra-deps:
 - IfElse-0.85
 - aws-0.22

Sponsored-by: Graham Spencer on Patreon
  • Loading branch information
joeyh committed Dec 8, 2021
1 parent 0139b4f commit 4b19626
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ git-annex (8.20211124) UNRELEASED; urgency=medium
already exported.
* Fix locking problems when annex.pidlock is set and concurrency is
enabled eg with -J.
* Fix build with ghc 9.0.1

-- Joey Hess <[email protected]> Tue, 23 Nov 2021 15:58:27 -0400

Expand Down
3 changes: 2 additions & 1 deletion Remote/Glacier.hs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import Utility.Metered
import Annex.UUID
import Utility.Env
import Types.ProposedAccepted
import Utility.Hash (IncrementalVerifier)

type Vault = String
type Archive = FilePath
Expand Down Expand Up @@ -175,7 +176,7 @@ store' r k b p = go =<< glacierEnv c gc u
forceSuccessProcess cmd pid
go' _ _ _ _ _ = error "internal"

retrieve :: Remote -> Retriever
retrieve :: forall a. Remote -> Key -> MeterUpdate -> Maybe IncrementalVerifier -> (ContentSource -> Annex a) -> Annex a
retrieve = byteRetriever . retrieve'

retrieve' :: forall a. Remote -> Key -> (L.ByteString -> Annex a) -> Annex a
Expand Down
1 change: 1 addition & 0 deletions doc/bugs/Remote__47__Glacier.hs_build_error_GHC_9.0.1.mdwn
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,4 @@ make: *** [Makefile:58: git-annex] Error 1
### Have you had any luck using git-annex before? (Sometimes we get tired of reading bug reports all day and a lil' positive end note does wonders)
Oh absolutely. This version compiles fine under alpine 5.14, which uses GHC 8.8.4. I've been using this software for many years without major issues, and it's a linchpin of my backup infrastructure. Thanks for the all the good work!

> [[fixed|done]] --[[Joey]]

0 comments on commit 4b19626

Please sign in to comment.