From 11a4505acacc21dc2e12d483437441247a968c00 Mon Sep 17 00:00:00 2001 From: David Baynard Date: Sat, 9 Mar 2019 18:29:51 +0000 Subject: [PATCH] Indicate where git-annex will lead to pantry error --- doc/pantry.md | 20 ++++++++++++++++++++ subs/pantry/src/Pantry/Archive.hs | 4 +++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/doc/pantry.md b/doc/pantry.md index e4912e4126..517865ecde 100644 --- a/doc/pantry.md +++ b/doc/pantry.md @@ -214,6 +214,26 @@ extra-deps: commit: 2f8a8e1b771829f4a8a77c0111352ce45a14c30f ``` +#### Limited [git-annex](https://git-annex.branchable.com) support + +Pantry does not support [git-annex](https://git-annex.branchable.com). This is +because `git archive` does not handle symbolic links outside the work tree. It +is still possible to use repositories which use git-annex but do not require the +annex files for the package to be built. + +To do so, ensure that any files or directories stored by git-annex are marked +[export-ignore](https://git-scm.com/docs/git-archive#Documentation/git-archive.txt-export-ignore) +in the `.gitattributes` file in the repository. See +[#4579](https://github.com/commercialhaskell/stack/issues/4579) for more +information. + +For example, if the directory `fonts/` is controlled by git-annex, use the +following line. + +```gitattributes +fonts export-ignore +``` + ### Archives (HTTP(S) or local filepath) You can use HTTP and HTTPS URLs and local filepaths referring to diff --git a/subs/pantry/src/Pantry/Archive.hs b/subs/pantry/src/Pantry/Archive.hs index f847c75ce2..4549445792 100644 --- a/subs/pantry/src/Pantry/Archive.hs +++ b/subs/pantry/src/Pantry/Archive.hs @@ -394,7 +394,9 @@ parseArchive rpli archive fp = do ] Right x -> Right x case Map.lookup dest files of - Nothing -> Left $ "Symbolic link dest not found from " ++ mePath me ++ " to " ++ relDest ++ ", looking for " ++ dest + Nothing -> Left $ "Symbolic link dest not found from " ++ mePath me ++ " to " ++ relDest ++ ", looking for " ++ dest ++ ".\n" + ++ "This may indicate that the source is a git archive which uses git-annex.\n" + ++ "See https://github.com/commercialhaskell/stack/issues/4579 for further information." Just me' -> case meType me' of METNormal -> Right $ SimpleEntry dest FTNormal