From 0050215ed1eb8b7b6ca68f46c77f12a24dd07958 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 14 Aug 2015 17:38:54 -0400 Subject: [PATCH] enable parallel build for fast mode and explicitly disable for production Currently, ghc has issues getting reproducible builds with parallel building. https://ghc.haskell.org/trac/ghc/ticket/4012 --- debian/changelog | 3 +++ .../external_special_remote_protocol.mdwn | 20 +++++++++++++++++++ git-annex.cabal | 7 ++++++- 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index d545480476..41e959ac05 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,9 @@ git-annex (5.20150813) UNRELEASED; urgency=medium * sync: Support --jobs * sync --content: Avoid unnecessary second pull from remotes when no file transfers are made. + * External special remotes can now be built that can be used in readonly + mode, where git-annex downloads content from the remote using regular + http. -- Joey Hess Wed, 12 Aug 2015 14:31:01 -0400 diff --git a/doc/design/external_special_remote_protocol.mdwn b/doc/design/external_special_remote_protocol.mdwn index 98d8b3dda4..76e57bc69f 100644 --- a/doc/design/external_special_remote_protocol.mdwn +++ b/doc/design/external_special_remote_protocol.mdwn @@ -343,6 +343,26 @@ quite a long time, especially when the git-annex assistant is using it. The assistant will detect when the system connects to a network, and will start a new process the next time it needs to use a remote. +## readonly mode + +Some storage services allow downloading the content of a file using a +regular http connection, with no authentication. An external special remote +for such a storage service can support a readonly mode of operation. + +It works like this: + +* When a key's content is stored on the remote, use SETURLPRESENT to + tell git-annex the public url from which it can be downloaded. +* When a key's content is removed from the remote, use SETURLMISSING. +* Document that this external special remote can be used in readonly mode. + + The user doesn't even need to install your external special remote + program to use such a remote! All they need to do is run: + `git annex enableremote $remotename readonly=true` + +* The readonly=true parameter makes git-annex download content from the + urls recorded earlier by SETURLPRESENT. + ## TODO * When storing encrypted files stream the file up/down the pipe, rather diff --git a/git-annex.cabal b/git-annex.cabal index 5431d6ddc2..8903839bb8 100644 --- a/git-annex.cabal +++ b/git-annex.cabal @@ -152,8 +152,13 @@ Executable git-annex else Build-Depends: cryptohash (>= 0.11.0) + -- Fully optimize for production. + -- Parallel builds only when not building for production, + -- because ghc is known to not yield reproducible builds this way. if flag(Production) - GHC-Options: -O2 + GHC-Options: -O2 -j1 + else + GHC-Options: -j if (os(windows)) Build-Depends: Win32, Win32-extras, unix-compat (>= 0.4.1.3), setenv