Followed the instructions over here: http://git-annex.branchable.com/forum/git-annex_on_OSX/

and had to install the following extra packages to be able to get make to start:

[realizes pcre-light is needed but pcre not installed on my mac]
sudo port install pcre
sudo cabal install pcre-light

Ah right, that is a new dependency. I've updated the forum page with this info. --Joey

But then I got the following error:

ghc -O2 -Wall --make git-annex  
[ 7 of 52] Compiling BackendTypes     ( BackendTypes.hs, BackendTypes.o   

BackendTypes.hs:71:17:  
    No instance for (Arbitrary Char)  
      arising from a use of `arbitrary' at BackendTypes.hs:71:17-25  
    Possible fix: add an instance declaration for (Arbitrary Char)  
    In a stmt of a 'do' expression: backendname <- arbitrary  
    In the expression:  
        do backendname <- arbitrary  
           keyname <- arbitrary  
             return $ Key (backendname, keyname)  
    In the definition of `arbitrary':  
        arbitrary = do backendname <- arbitrary  
                       keyname <- arbitrary  
                         return $ Key (backendname, keyname)  
make: *** [git-annex] Error 1  

My knowledge of Haskell (had to lookup the spelling...) is more than rudimentary so any help would be appreciated.

Hmm, it seems you may be missing part of the quickcheck haskell library, or have a different version than me.

The easy fix is probably to just edit BackendTypes.hs and delete the entire end of the file from line 68, "for quickcheck" down. This code is only used by the test suite (so "make test" will fail), but it should get it to build. --Joey


Closing this bug because the above problem now has a solution documented on the install page, and the below test suite failure problems should all be resolved on OSX. done --Joey

Thanks to your feedback, I got it going.

Maybe those two should be added to the 'OSX how-to' in the forum

[realizes pcre-light is needed but pcre not installed on my mac]
sudo port install pcre
sudo cabal install pcre-light

[tests are failing, need haskell's quickcheck]
sudo cabal install quickcheck

Comment by Antoine Sun Feb 6 02:02:57 2011
Yes, I've moved it to OSX page where anyone can update it in this wiki, and added your improvements.
Comment by joey Sun Feb 6 13:39:52 2011

I'm running ghc 6.12.3 with the corresponding haskell-platform package from the HP site which I installed in preference to the macports version of haskell-platform (it's quite old). it seems when you install quickcheck, the version that is installed is of version 2.4.0.1 and not 1.2.0 which git-annex depends on for its tests.

jtang@x00:~ $ cabal install quickcheck --reinstall               
Resolving dependencies...
Configuring QuickCheck-2.4.0.1...
Preprocessing library QuickCheck-2.4.0.1...

..
and so on..
..

it fails with this

[54 of 54] Compiling Main             ( test.hs, test.o )

test.hs:56:3:
    No instance for (QuickCheck-1.2.0.1:Test.QuickCheck.Arbitrary Char)
      arising from a use of `qctest' at test.hs:56:3-64
    Possible fix:
      add an instance declaration for
      (QuickCheck-1.2.0.1:Test.QuickCheck.Arbitrary Char)
    In the expression:
        qctest "prop_idempotent_deencode" Git.prop_idempotent_deencode
    In the first argument of `TestList', namely
        `[qctest "prop_idempotent_deencode" Git.prop_idempotent_deencode,
          qctest "prop_idempotent_fileKey" Locations.prop_idempotent_fileKey,
          qctest
            "prop_idempotent_key_read_show"
            BackendTypes.prop_idempotent_key_read_show,
          qctest
            "prop_idempotent_shellEscape" Utility.prop_idempotent_shellEscape,
          ....]'
    In the second argument of `($)', namely
        `TestList
           [qctest "prop_idempotent_deencode" Git.prop_idempotent_deencode,
            qctest "prop_idempotent_fileKey" Locations.prop_idempotent_fileKey,
            qctest
              "prop_idempotent_key_read_show"
              BackendTypes.prop_idempotent_key_read_show,
            qctest
              "prop_idempotent_shellEscape" Utility.prop_idempotent_shellEscape,
            ....]'

I'd imagine if I could downgrade, it would compile and pass the tests (I hope)

Comment by Jimmy Mon Feb 7 08:43:43 2011

I doubt that git-annex can be used with QuickCheck 1.2.0. The QuickCheck I've tested it with is 2.1.0.3 actually.

I suspect you have an old version of the TestPack haskell library on your system, that is linked against QuickCheck 1.2.0. Git-annex has been tested with TestPack 2.0.0, which uses QuickCheck 2.x.

In any case, you don't have to run 'make test' to build git-annex, and my comments above should make the main program compile, I expect.

Comment by joey Tue Feb 8 15:00:14 2011

Ah, that gave me a good clue, my system just got pretty confused with a mixture of quickcheck and testpack installs. Would it be possible to put up a list of versions of the software you are using on your development environment? (at least the minimum tested version)

I guess it shouldn't matter to most users who are going to rely on packagers to sort these dependancy issues, but it's nice to know.

Anyway, the tests build now, and they seem to fail on my (rather messy) install of haskell platform + ghc 6.12 on osx 10.6.6.

< output that passed some tests >
Testing 1:blackbox:0:git-annex init
Testing 1:blackbox:1:git-annex add:0
Testing 1:blackbox:1:git-annex add:1
Cases: 30  Tried: 9  Errors: 0  Failures: 0test: sha1sum: executeFile: does not exist (No such file or directory)
  git-annex: : hGetLine: end of file
### Failure in: 1:blackbox:1:git-annex add:1
add with SHA1 failed
Testing 1:blackbox:2:git-annex setkey/fromkey
Cases: 30  Tried: 10  Errors: 0  Failures: 1(checksum...) test: sha1sum: executeFile: does not exist (No such file or directory)
### Error in:   1:blackbox:2:git-annex setkey/fromkey
: hGetLine: end of file
Testing 1:blackbox:3:git-annex unannex:0:no content
Cases: 30  Tried: 11  Errors: 1  Failures: 1chmod: -R: No such file or directory
chmod: -R: No such file or directory
Testing 1:blackbox:3:git-annex unannex:1:with content
### Failure in: 1:blackbox:3:git-annex unannex:1:with content
foo is not a symlink
Testing 1:blackbox:4:git-annex drop:0:no remotes
Cases: 30  Tried: 13  Errors: 1  Failures: 2chmod: -R: No such file or directory
### Error in:   1:blackbox:4:git-annex drop:0:no remotes
.t/tmprepo/.git/annex/objects/WORM:1297194705:20:foo/WORM:1297194705:20:foo: removeLink: permission denied (Permission denied)
Testing 1:blackbox:4:git-annex drop:1:with remote
Cases: 30  Tried: 14  Errors: 2  Failures: 2chmod: -R: No such file or directory
### Error in:   1:blackbox:4:git-annex drop:1:with remote
.t/tmprepo/.git/annex/objects/WORM:1297194705:20:foo/WORM:1297194705:20:foo: removeLink: permission denied (Permission denied)
Testing 1:blackbox:4:git-annex drop:2:untrusted remote
Cases: 30  Tried: 15  Errors: 3  Failures: 2chmod: -R: No such file or directory
### Error in:   1:blackbox:4:git-annex drop:2:untrusted remote
.t/tmprepo/.git/annex/objects/WORM:1297194705:20:foo/WORM:1297194705:20:foo: removeLink: permission denied (Permission denied)
Testing 1:blackbox:5:git-annex get
Cases: 30  Tried: 16  Errors: 4  Failures: 2chmod: -R: No such file or directory
### Error in:   1:blackbox:5:git-annex get
.t/tmprepo/.git/annex/objects/WORM:1297194705:20:foo/WORM:1297194705:20:foo: removeLink: permission denied (Permission denied)
Testing 1:blackbox:6:git-annex move
Cases: 30  Tried: 17  Errors: 5  Failures: 2chmod: -R: No such file or directory
### Error in:   1:blackbox:6:git-annex move
.t/tmprepo/.git/annex/objects/WORM:1297194705:20:foo/WORM:1297194705:20:foo: removeLink: permission denied (Permission denied)
Testing 1:blackbox:7:git-annex copy
Cases: 30  Tried: 18  Errors: 6  Failures: 2chmod: -R: No such file or directory
### Error in:   1:blackbox:7:git-annex copy
.t/tmprepo/.git/annex/objects/WORM:1297194705:20:foo/WORM:1297194705:20:foo: removeLink: permission denied (Permission denied)
Testing 1:blackbox:8:git-annex unlock/lock
Cases: 30  Tried: 19  Errors: 7  Failures: 2chmod: -R: No such file or directory
### Error in:   1:blackbox:8:git-annex unlock/lock
.t/tmprepo/.git/annex/objects/WORM:1297194705:20:foo/WORM:1297194705:20:foo: removeLink: permission denied (Permission denied)
Testing 1:blackbox:9:git-annex edit/commit:0
Cases: 30  Tried: 20  Errors: 8  Failures: 2chmod: -R: No such file or directory
### Error in:   1:blackbox:9:git-annex edit/commit:0
.t/tmprepo/.git/annex/objects/WORM:1297194705:20:foo/WORM:1297194705:20:foo: removeLink: permission denied (Permission denied)
Testing 1:blackbox:9:git-annex edit/commit:1
Cases: 30  Tried: 21  Errors: 9  Failures: 2chmod: -R: No such file or directory
### Error in:   1:blackbox:9:git-annex edit/commit:1
.t/tmprepo/.git/annex/objects/WORM:1297194705:20:foo/WORM:1297194705:20:foo: removeLink: permission denied (Permission denied)
Testing 1:blackbox:10:git-annex fix
Cases: 30  Tried: 22  Errors: 10  Failures: 2chmod: -R: No such file or directory
### Error in:   1:blackbox:10:git-annex fix
.t/tmprepo/.git/annex/objects/WORM:1297194705:20:foo/WORM:1297194705:20:foo: removeLink: permission denied (Permission denied)
Testing 1:blackbox:11:git-annex trust/untrust/semitrust
Cases: 30  Tried: 23  Errors: 11  Failures: 2chmod: -R: No such file or directory
### Error in:   1:blackbox:11:git-annex trust/untrust/semitrust
.t/tmprepo/.git/annex/objects/WORM:1297194705:20:foo/WORM:1297194705:20:foo: removeLink: permission denied (Permission denied)
Testing 1:blackbox:12:git-annex fsck:0
Cases: 30  Tried: 24  Errors: 12  Failures: 2chmod: -R: No such file or directory
### Error in:   1:blackbox:12:git-annex fsck:0
.t/tmprepo/.git/annex/objects/WORM:1297194705:20:foo/WORM:1297194705:20:foo: removeLink: permission denied (Permission denied)
Testing 1:blackbox:12:git-annex fsck:1
Cases: 30  Tried: 25  Errors: 13  Failures: 2chmod: -R: No such file or directory
### Error in:   1:blackbox:12:git-annex fsck:1
.t/tmprepo/.git/annex/objects/WORM:1297194705:20:foo/WORM:1297194705:20:foo: removeLink: permission denied (Permission denied)
Testing 1:blackbox:12:git-annex fsck:2
Cases: 30  Tried: 26  Errors: 14  Failures: 2chmod: -R: No such file or directory
### Error in:   1:blackbox:12:git-annex fsck:2
.t/tmprepo/.git/annex/objects/WORM:1297194705:20:foo/WORM:1297194705:20:foo: removeLink: permission denied (Permission denied)
Testing 1:blackbox:13:git-annex migrate:0
Cases: 30  Tried: 27  Errors: 15  Failures: 2chmod: -R: No such file or directory
### Error in:   1:blackbox:13:git-annex migrate:0
.t/tmprepo/.git/annex/objects/WORM:1297194705:20:foo/WORM:1297194705:20:foo: removeLink: permission denied (Permission denied)
Testing 1:blackbox:13:git-annex migrate:1
Cases: 30  Tried: 28  Errors: 16  Failures: 2chmod: -R: No such file or directory
### Error in:   1:blackbox:13:git-annex migrate:1
.t/tmprepo/.git/annex/objects/WORM:1297194705:20:foo/WORM:1297194705:20:foo: removeLink: permission denied (Permission denied)
Testing 1:blackbox:14:git-annex unused/dropunused
Cases: 30  Tried: 29  Errors: 17  Failures: 2chmod: -R: No such file or directory
### Error in:   1:blackbox:14:git-annex unused/dropunused
.t/tmprepo/.git/annex/objects/WORM:1297194705:20:foo/WORM:1297194705:20:foo: removeLink: permission denied (Permission denied)
Cases: 30  Tried: 30  Errors: 18  Failures: 2
chmod: -R: No such file or directory
test: .t/repo/.git/annex/objects/WORM:1297194705:20:foo/WORM:1297194705:20:foo: removeLink: permission denied (Permission denied)
make: *** [test] Error 1

I assumed that since the tests built, then running them shouldn't be a problem. It looks like some argument isn't being passed about for the location of the .t directory that gets created. I will check the dependancies on my system again.

Comment by Jimmy Tue Feb 8 15:56:55 2011

You're missing the sha1sum command, everything else is a followon error from that. Added a hint about this to install, and in the next version configure will check for sha1sum.

Comment by joey Tue Feb 8 19:20:08 2011

That's odd, I have the md5sha1sum package installed and it still fails with pretty much the same error

Testing 1:blackbox:0:git-annex init
Cases: 30  Tried: 7  Errors: 0  Failures: 0chmod: -R: No such file or directory
### Error in:   1:blackbox:0:git-annex init
.t/repo/.git/annex/objects/SHA1:ee80d2cec57a3810db83b80e1b320df3a3721ffa/SHA1:ee80d2cec57a3810db83b80e1b320df3a3721ffa: removeLink: permission denied (Permission denied)
Testing 1:blackbox:1:git-annex add:0
### Error in:   1:blackbox:1:git-annex add:0
foo: openFile: permission denied (Permission denied)

< and so on >

the configure script finds sha1sum, builds and starts to run.

Comment by Jimmy Tue Feb 8 20:45:31 2011
The chmod errors are because your chmod does not understand the -R argument. Only the test suite uses chmod -R. I've fixed it to modify modes manually.
Comment by joey Wed Feb 9 00:10:27 2011

a0826293 fixed the last problem, there is coreutils available in macports, if they are installed you get the gnu equivalents but they are prefixed with a g (e.g. gchmod instead of chmod), I guess not everyone will have these install or prefer these on OSX

Some more tests fail now...

Testing 1:blackbox:3:git-annex unannex:1:with content
### Failure in: 1:blackbox:3:git-annex unannex:1:with content
foo is not a symlink
Testing 1:blackbox:4:git-annex drop:0:no remotes
### Failure in: 1:blackbox:4:git-annex drop:0:no remotes
drop wrongly succeeded with no known copy of file
Testing 1:blackbox:4:git-annex drop:1:with remote
Testing 1:blackbox:4:git-annex drop:2:untrusted remote
Testing 1:blackbox:5:git-annex get
Testing 1:blackbox:6:git-annex move
Testing 1:blackbox:7:git-annex copy
### Failure in: 1:blackbox:7:git-annex copy
move --to of file already there failed
Testing 1:blackbox:8:git-annex unlock/lock
### Error in:   1:blackbox:8:git-annex unlock/lock
forkProcess: resource exhausted (Resource temporarily unavailable)
Testing 1:blackbox:9:git-annex edit/commit:0
### Error in:   1:blackbox:9:git-annex edit/commit:0
forkProcess: resource exhausted (Resource temporarily unavailable)
Testing 1:blackbox:9:git-annex edit/commit:1
### Error in:   1:blackbox:9:git-annex edit/commit:1
forkProcess: resource exhausted (Resource temporarily unavailable)
Testing 1:blackbox:10:git-annex fix
### Error in:   1:blackbox:10:git-annex fix
forkProcess: resource exhausted (Resource temporarily unavailable)
Testing 1:blackbox:11:git-annex trust/untrust/semitrust
### Error in:   1:blackbox:11:git-annex trust/untrust/semitrust
forkProcess: resource exhausted (Resource temporarily unavailable)
Testing 1:blackbox:12:git-annex fsck:0
### Error in:   1:blackbox:12:git-annex fsck:0
forkProcess: resource exhausted (Resource temporarily unavailable)
Testing 1:blackbox:12:git-annex fsck:1
### Error in:   1:blackbox:12:git-annex fsck:1
forkProcess: resource exhausted (Resource temporarily unavailable)
Testing 1:blackbox:12:git-annex fsck:2
### Error in:   1:blackbox:12:git-annex fsck:2
forkProcess: resource exhausted (Resource temporarily unavailable)
Testing 1:blackbox:13:git-annex migrate:0
### Error in:   1:blackbox:13:git-annex migrate:0
forkProcess: resource exhausted (Resource temporarily unavailable)
Testing 1:blackbox:13:git-annex migrate:1
### Error in:   1:blackbox:13:git-annex migrate:1
forkProcess: resource exhausted (Resource temporarily unavailable)
Testing 1:blackbox:14:git-annex unused/dropunused
### Error in:   1:blackbox:14:git-annex unused/dropunused
forkProcess: resource exhausted (Resource temporarily unavailable)
Cases: 30  Tried: 30  Errors: 11  Failures: 3
test: failed
make: *** [test] Error 1

On a side note, I think I found another bug in the testing. I had tested in a virtual machine in archlinux (a very recent updated version) Please see the report here tests fail when there is no global .gitconfig for the user

Comment by Jimmy Wed Feb 9 05:12:52 2011
I don't know what these problems forking could be. Can you strace it?
Comment by joey Wed Feb 9 11:04:50 2011
I got dtruss to give me a trace, the output is quite big to post here (~560kb gzip'd), do you mind if I emailed it or posted it somewhere else for you?
Comment by Jimmy Wed Feb 9 15:35:47 2011
joey@kitenet.net (hope I can make sense of dtruss output)
Comment by joey Wed Feb 9 15:47:30 2011

The dtrace puzzlingly does not have the same errors shown above, but a set of mostly new errors. I don't know what to make of that.

git-annex: git-annex/.t/repo/.git/hooks/pre-commit: fileAccess: permission denied (Operation not permitted)

This seems to be caused by it setting the execute bit on the file. I don't know why that would fail; it's just written the file and renamed it into place so clearly should be able to write to it.

was able to modify annexed file's sha1foo content

This also suggests something breaking with permissions.

Comment by joey Wed Feb 9 17:59:47 2011
I've been trying to dig around the trace and code, and used google to see if the forkProcess issue was a haskell thing or an OSX thing. It seems that http://hackage.haskell.org/trac/ghc/ticket/4493 someone may have ran into a similar issue, though I am not sure if its related.
Comment by Jimmy Sat Feb 12 17:19:24 2011

It may be possible that OSX has some low resource limits, for user processes (266 per user I think) doing a

sudo sysctl -w kern.maxproc=2048
sudo sysctl -w kern.maxprocperuid=1024
sudo echo "limit maxfiles 1024 unlimited" >> /etc/launchd.conf
sudo echo "limit maxproc 1024 2048" >> /etc/launchd.conf

seems to change the behaviour of the tests abit...

Testing 1:blackbox:3:git-annex unannex:1:with content                         
### Failure in: 1:blackbox:3:git-annex unannex:1:with content
foo is not a symlink
Testing 1:blackbox:4:git-annex drop:0:no remotes                              
### Failure in: 1:blackbox:4:git-annex drop:0:no remotes
drop wrongly succeeded with no known copy of file
Testing 1:blackbox:4:git-annex drop:1:with remote                             
Testing 1:blackbox:4:git-annex drop:2:untrusted remote                        
Testing 1:blackbox:5:git-annex get                                            
Testing 1:blackbox:6:git-annex move                                           
Testing 1:blackbox:7:git-annex copy                                           
Testing 1:blackbox:8:git-annex unlock/lock                                    
Testing 1:blackbox:9:git-annex edit/commit:0                                  
Cases: 30  Tried: 20  Errors: 0  Failures: 2add foo ok
ok
Testing 1:blackbox:9:git-annex edit/commit:1                                  
Testing 1:blackbox:10:git-annex fix                                           
Testing 1:blackbox:11:git-annex trust/untrust/semitrust                       
Testing 1:blackbox:12:git-annex fsck:0                                        
Cases: 30  Tried: 24  Errors: 0  Failures: 2  Only 1 of 2 trustworthy copies of foo exist.
  Back it up with git-annex copy.
  Only 1 of 2 trustworthy copies of sha1foo exist.
  Back it up with git-annex copy.
  Bad file size; moved to /Users/jtang/develop/git-annex/.t/tmprepo/.git/annex/bad/WORM:1297565141:20:foo
  Bad file content; moved to /Users/jtang/develop/git-annex/.t/tmprepo/.git/annex/bad/SHA1:ee80d2cec57a3810db83b80e1b320df3a3721ffa
Testing 1:blackbox:12:git-annex fsck:1                                        
### Failure in: 1:blackbox:12:git-annex fsck:1
fsck failed to fail with content only available in untrusted (current) repository
Testing 1:blackbox:12:git-annex fsck:2                                        
Cases: 30  Tried: 26  Errors: 0  Failures: 3  Only 1 of 2 trustworthy copies of foo exist.
  Back it up with git-annex copy.
  The following untrusted locations may also have copies: 
    58e831c2-371b-11e0-bc1f-47d738dc52ee  -- test repo
  Only 1 of 2 trustworthy copies of sha1foo exist.
  Back it up with git-annex copy.
  The following untrusted locations may also have copies: 
    58e831c2-371b-11e0-bc1f-47d738dc52ee  -- test repo
Testing 1:blackbox:13:git-annex migrate:0                                     
Cases: 30  Tried: 27  Errors: 0  Failures: 3  git-annex: user error (Error in fork: forkProcess: resource exhausted (Resource temporarily unavailable))
### Failure in: 1:blackbox:13:git-annex migrate:0
migrate annexedfile failed
Testing 1:blackbox:13:git-annex migrate:1                                     
### Error in:   1:blackbox:13:git-annex migrate:1
forkProcess: resource exhausted (Resource temporarily unavailable)
Testing 1:blackbox:14:git-annex unused/dropunused                             
### Error in:   1:blackbox:14:git-annex unused/dropunused
forkProcess: resource exhausted (Resource temporarily unavailable)
Cases: 30  Tried: 30  Errors: 2  Failures: 4
test: failed

the number of failures vary as I change the values of the maxprocs, I think I have narrowed it down to OSX just being stupid with limits thus causing the tests to fail.

Comment by Jimmy Sat Feb 12 22:45:51 2011
I've fixed the test suite to not accumulate all those zombie processes. Now only 2 or 3 processes should run max. Am curious to see if that clears up all the problems.
Comment by joey Sun Feb 13 00:52:26 2011

Yeap, that did the trick. I just tested a few separate OSX 10.6.6 systems and the tests are better behaved now, only 3 failures now.

So the tests behave better (at least we don't get resource fork errors any more)

  • after the commit c319a3 without modifying the system limits (of 266 procs per user)
  • without the commit c319a3 and when I increase the system process limits to as much as OSX allows

On all the systems I tested on, I'm down to 3 failures now.

### Failure in: 1:blackbox:3:git-annex unannex:1:with content
foo is not a symlink
### Failure in: 1:blackbox:4:git-annex drop:0:no remotes
drop wrongly succeeded with no known copy of file
Cases: 30  Tried: 20  Errors: 0  Failures: 2add foo ok
ok
Cases: 30  Tried: 24  Errors: 0  Failures: 2  Only 1 of 2 trustworthy copies of foo exist.
  Back it up with git-annex copy.
  Only 1 of 2 trustworthy copies of sha1foo exist.
  Back it up with git-annex copy.
  Bad file size; moved to /Users/jtang/develop/git-annex/.t/tmprepo/.git/annex/bad/WORM:1297594011:20:foo
  Bad file content; moved to /Users/jtang/develop/git-annex/.t/tmprepo/.git/annex/bad/SHA1:ee80d2cec57a3810db83b80e1b320df3a3721ffa
### Failure in: 1:blackbox:12:git-annex fsck:1
fsck failed to fail with content only available in untrusted (current) repository
Cases: 30  Tried: 26  Errors: 0  Failures: 3  Only 1 of 2 trustworthy copies of foo exist.
  Back it up with git-annex copy.
  The following untrusted locations may also have copies: 
    90d63906-375e-11e0-8867-abb8a6368269  -- test repo
  Only 1 of 2 trustworthy copies of sha1foo exist.
  Back it up with git-annex copy.
  The following untrusted locations may also have copies: 
    90d63906-375e-11e0-8867-abb8a6368269  -- test repo
Cases: 30  Tried: 30  Errors: 0  Failures: 3

It's the same set of failures across all the OSX systems that I have tested on. Now I just need to figure out why there are still these three failures.

Comment by Jimmy Sun Feb 13 06:46:54 2011

I think I have figured out why

### Failure in: 1:blackbox:3:git-annex unannex:1:with content
foo is not a symlink

It goes back to the this piece of code (in test.hs)

copyrepo :: FilePath -> FilePath -> IO FilePath
copyrepo old new = do
        cleanup new
        ensuretmpdir
        Utility.boolSystem "cp" ["-pr", old, new] @? "cp -pr failed"

It seems that on OSX it does not preserve the symbolic link information, basically cp is not gnu cp on OSX, doing a "cp -a SOURCE DEST" seem's to the right thing on OSX. I tried it out on my archlinux workstation by replacing -pr with just -a and all the tests passed on archlinux.

I'm not sure what the implications would be with changing the test with changing the cp command.

Comment by Jimmy Sun Feb 13 11:12:10 2011

On second thought and after some messing (trying most of the options and combinations of options on OSX for).... I tried replacing cp with gnu cp from coreutils on my OSX install, and all the tests passed. sigh cp -a is preserving some permissions and attributes but not all, its not behaving in the same way as the gnu cp does... the closet thing that I have found on OSX that behaves in the same way as gnu "cp -pr" is to use "ditto".

Just doing a "ditto SOURCE DEST" in the tests passes everything. I'm not sure if its a good idea to use this even though it works. Though this is just the tests, does it affect CopyFile.hs where "cp" is called?

Comment by Jimmy Sun Feb 13 11:55:47 2011

Outside the test suite, git-annex's actual use of cp puts fairly low demands on it. It tries to use cp -a or cp -p if available just to preserve whatever attributes it can preserve, but the worst case if that you have a symlink pointing to a file that doesn't have the original timestamp or whatever. And there's little expectation git preserves that stuff anyway.

I will probably try to make the test suite entirely use git clone rather than cp.

Comment by joey Sun Feb 13 13:54:09 2011
Comments on this page are closed.