Commit graph

283 commits

Author SHA1 Message Date
Joey Hess
dcb9dead6f Merge branch 'master' into android-rebuild 2013-09-22 22:45:51 -04:00
Joey Hess
7390f08ef9 Use cryptohash rather than SHA for hashing.
This is a massive win on OSX, which doesn't have a sha256sum normally.

Only use external hash commands when the file is > 1 mb,
since cryptohash is quite close to them in speed.

SHA is still used to calculate HMACs. I don't quite understand
cryptohash's API for those.

Used the following benchmark to arrive at the 1 mb number.

1 mb file:

benchmarking sha256/internal
mean: 13.86696 ms, lb 13.83010 ms, ub 13.93453 ms, ci 0.950
std dev: 249.3235 us, lb 162.0448 us, ub 458.1744 us, ci 0.950
found 5 outliers among 100 samples (5.0%)
  4 (4.0%) high mild
  1 (1.0%) high severe
variance introduced by outliers: 10.415%
variance is moderately inflated by outliers

benchmarking sha256/external
mean: 14.20670 ms, lb 14.17237 ms, ub 14.27004 ms, ci 0.950
std dev: 230.5448 us, lb 150.7310 us, ub 427.6068 us, ci 0.950
found 3 outliers among 100 samples (3.0%)
  2 (2.0%) high mild
  1 (1.0%) high severe

2 mb file:

benchmarking sha256/internal
mean: 26.44270 ms, lb 26.23701 ms, ub 26.63414 ms, ci 0.950
std dev: 1.012303 ms, lb 925.8921 us, ub 1.122267 ms, ci 0.950
variance introduced by outliers: 35.540%
variance is moderately inflated by outliers

benchmarking sha256/external
mean: 26.84521 ms, lb 26.77644 ms, ub 26.91433 ms, ci 0.950
std dev: 347.7867 us, lb 210.6283 us, ub 571.3351 us, ci 0.950
found 6 outliers among 100 samples (6.0%)

import Crypto.Hash
import Data.ByteString.Lazy as L
import Criterion.Main
import Common

testfile :: FilePath
testfile = "/run/shm/data" -- on ram disk

main = defaultMain
        [ bgroup "sha256"
                [ bench "internal" $ whnfIO internal
                , bench "external" $ whnfIO external
                ]
        ]

sha256 :: L.ByteString -> Digest SHA256
sha256 = hashlazy

internal :: IO String
internal = show . sha256 <$> L.readFile testfile

external :: IO String
external = do
	s <- readProcess "sha256sum" [testfile]
        return $ fst $ separate (== ' ') s
2013-09-22 20:06:02 -04:00
Joey Hess
00a12afffe successfully builds (except XMPP) 2013-09-22 19:13:31 +01:00
Joey Hess
70f205717c release 2013-09-20 10:43:08 -04:00
Joey Hess
e5d4f4fb0c prep release 2013-09-11 13:02:22 -04:00
Joey Hess
b64f5baf2d sync: support gcrypt 2013-09-09 10:02:15 -04:00
Joey Hess
ecbb326e9d Allow building without quvi support. 2013-09-09 02:16:22 -04:00
Joey Hess
a8d74d39c1 prep release 2013-08-27 13:31:41 -04:00
Joey Hess
46b6d75274 Youtube support! (And 53 other video hosts)
When quvi is installed, git-annex addurl automatically uses it to detect
when an page is a video, and downloads the video file.

web special remote: Also support using quvi, for getting files,
or checking if files exist in the web.

This commit was sponsored by Mark Hepburn. Thanks!
2013-08-22 18:50:43 -04:00
Joey Hess
572d6fde14 releasing version 4.20130815 2013-08-15 10:46:33 +02:00
Joey Hess
7fdf9ea5dd releasing version 4.20130802 2013-08-02 13:38:18 -04:00
Joey Hess
7e66d260ea importfeed: git-annex becomes a podcatcher in 150 LOC 2013-07-28 16:55:42 -04:00
Joey Hess
fc1a79835b Always build with -threaded, to avoid a deadlock when communicating with gpg. 2013-07-25 13:57:53 -04:00
Joey Hess
ba4e0b4878 releasing version 4.20130723 2013-07-23 11:41:16 -04:00
Joey Hess
6402f2081e Revert "avoid pulling in unneeded dependencies when the assistant is disabled"
Cabal does not seem to have a way to check if flag A is set and then, if
flag B is set, add a dep. Instead, it makes flag B get unset if the
dep is not available.
2013-07-16 11:29:43 -04:00
Joey Hess
4b9fa37b72 avoid pulling in unneeded dependencies when the assistant is disabled 2013-07-12 15:45:34 -04:00
Joey Hess
a2269eef9e releasing version 4.20130709 2013-07-09 15:58:01 -04:00
Joey Hess
6e9e0c3238 temporarily remove cabal os(gnu) until I find the real right name for the hurd
Or until hackage stops rejecting os(gnu), if it is indeed the right name..
2013-06-30 13:17:10 -04:00
Joey Hess
0292e82eb1 releasing version 4.20130627 2013-06-27 14:58:40 -04:00
Joey Hess
b44c978e2c webapp: Fix bug that caused the webapp to hang when built with yesod 1.2. 2013-06-27 00:01:31 -04:00
Joey Hess
b717823402 Temporarily revert back to building with yesod before 1.2. Version 1.2 of yesod, or the new version of warp seem to have a bug that causes the webapp to hang. 2013-06-26 17:52:39 -04:00
Joey Hess
2f9b0ba351 simpler ifdef for linux 2013-06-21 13:09:09 -04:00
Joey Hess
0c759f3852 colin tells me it's os(gnu) for the hurd 2013-06-21 11:45:48 -04:00
Joey Hess
679cfcede7 don't try to build assistant on hurd 2013-06-21 01:44:57 -04:00
Joey Hess
6e309b63f8 assistant: On Linux, the expensive transfer scan is run niced.
This is a compromise. I would like to nice every thread except for the
webapp thread, but it's not practical to do so. That would need every
thread to run as a bound thread, which could add significant overhead.
And any forkIO would escape the nice level.
2013-06-20 22:25:41 -04:00
Peter Simons
df04dc578f git-annex.cabal: declare GPL3+ license 2013-06-04 14:30:43 -04:00
Joey Hess
1198b5444d now builds with both yesod 1.2 and 1.1 2013-06-03 18:14:22 -04:00
Joey Hess
79fd677805 WIP yesod 1.2 2013-06-03 11:25:23 -04:00
Joey Hess
2465c2abd1 releasing version 4.20130601 2013-06-01 20:58:32 -04:00
Joey Hess
e5b3739bea further restrict yesod versions, for people who have newer stuff installed 2013-05-24 10:25:39 -04:00
Joey Hess
372a7f727f version dep on yesod-default, otherwise cabal explodes
Will be re-releasing the last version to hackage with a .1 with this fix.
2013-05-23 11:07:11 -04:00
Joey Hess
b3a521db70 releasing version 4.20130521 2013-05-21 14:23:27 -04:00
Joey Hess
9fa063a00f debian architecture build fun 2013-05-19 21:44:33 -04:00
Joey Hess
345ee4f37c Switch to MonadCatchIO-transformers for better handling of state while catching exceptions.
As seen in this bug report, the lifted exception handling using the StateT
monad throws away state changes when an action throws an exception.
http://git-annex.branchable.com/bugs/git_annex_fork_bombs_on_gpg_file/
  .. Which can result in cached values being redundantly calculated, or other
     possibly worse bugs when the annex state gets out of sync with reality.

This switches from a StateT AnnexState to a ReaderT (MVar AnnexState).
All changes to the state go via the MVar. So when an Annex action is
running inside an exception handler, and it makes some changes, they
immediately go into affect in the MVar. If it then throws an exception
(or even crashes its thread!), the state changes are still in effect.

The MonadCatchIO-transformers change is actually only incidental.
I could have kept on using lifted-base for the exception handling.
However, I'd have needed to write a new instance of MonadBaseControl
for the new monad.. and I didn't write the old instance.. I begged Bas
and he kindly sent it to me. Happily, MonadCatchIO-transformers is
able to derive a MonadCatchIO instance for my monad.

This is a deep level change. It passes the test suite! What could it break?

Well.. The most likely breakage would be to code that runs an Annex action
in an exception handler, and *wants* state changes to be thrown away.
Perhaps the state changes leaves the state inconsistent, or wrong. Since
there are relatively few places in git-annex that catch exceptions in the
Annex monad, and the AnnexState is generally just used to cache calculated
data, this is unlikely to be a problem.

Oh yeah, this change also makes Assistant.Types.ThreadedMonad a bit
redundant. It's now entirely possible to run concurrent Annex actions in
different threads, all sharing access to the same state! The ThreadedMonad
just adds some extra work on top of that, with its own MVar, and avoids
such actions possibly stepping on one-another's toes. I have not gotten
rid of it, but might try that later. Being able to run concurrent Annex
actions would simplify parts of the Assistant code.
2013-05-19 14:16:36 -04:00
Joey Hess
eb8344c598 releasing version 4.20130516 2013-05-16 11:35:52 -04:00
Joey Hess
3a7eb68c1a use unix-compat, removed a lot of stubs in Utility.FileMode 2013-05-11 11:16:47 -05:00
Joey Hess
e5f1ca7b4b avoid build depending on unix in windows 2013-05-10 15:37:38 -05:00
Joey Hess
a05b4619bb stub out posix stuff for Windows
This is enough to let the configure program build.
2013-05-10 15:08:53 -05:00
Joey Hess
2d51434341 Avoid depending on regex-tdfa on mips, mipsel, and s390, where it fails to build. 2013-05-06 09:44:55 -04:00
Joey Hess
8860cff556 Disable building with the haskell threaded runtime when the assistant is not built. This may fix builds on s390x and sparc, which are failing to link -lHSrts_thr 2013-05-06 09:35:43 -04:00
Joey Hess
c96ff106d0 avoid crashing on Android when file mode of .git/annex/url cannot be set
Presumably, if the filesystem doesn't support file permissions, it's not
much of a multiuser system.
2013-05-03 00:56:01 -04:00
Joey Hess
8df0611e00 Temporarily add an upper bound to the version of yesod that can be built with, since yesod 1.2 has a great many changes that will require extensive work on the webapp. 2013-05-02 23:12:47 -04:00
Joey Hess
f7d2523adc work around strange endianness bug in port number on Android 2013-05-02 22:38:45 -04:00
Joey Hess
b61740e6d3 releasing version 4.20130501 2013-05-01 13:19:29 -04:00
Joey Hess
25aabf4ffe add TList, built on DList 2013-04-24 16:01:01 -04:00
Joey Hess
3233e0fb60 revert addition of Includes: sys/event.h in cabal file
That is very dodgy; it makes *every* C file compiled have that header added
to it. Apparently sys/event.h needs some other header files to be included
on some OS's, and so this leads to compile failures in completely unrelated
places to the code that actually uses sys/event.h

This reverts commit c993d8e710, which added
this with no rationalle and I must have missed in amoung the other patches
when merging.

Also, Utility/kqueue.c already includes sys/event.h
2013-04-24 10:35:09 -04:00
Joey Hess
9f4017003f enable webdav on android 2013-04-19 17:30:05 -04:00
Joey Hess
67eadf3fa2 releasing version 4.20130417 2013-04-17 11:16:44 -04:00
Joey Hess
6490418a4e Fall back to internal url downloader when built without curl. 2013-04-16 15:42:51 -04:00
Joey Hess
13a65d028d use Extensions instead of -X 2013-04-14 12:49:09 -04:00