[darcs-users] Re: darcs - Problem with MacOS X HFS+ File System

Markus Hanauska hanauska at equinux.net
Thu Mar 3 11:04:12 UTC 2005


And some more input from me :)
Sorry, but we need this bug fixed ASAP.

I found a very interesting page:

http://www.wsanchez.net/papers/USENIX_2000/

The interesting part is the following:

******
HFS+ lacks support in the volume format for hard links, a standard 
feature of UFS. Initially, the attempted creation of a link to a file 
would yield a "not supported" error. We had discussed some "80%" 
solutions, such as creating symbolic links instead, but the semantics 
of symbolic links are significantly different. For troubleshooting 
reasons it is preferable to fail at link creation time than at some 
later time due to problems related to these semantic differences. The 
problem is that there is a significant amount of software which breaks 
if hard link creation fails, and some of that software needs to be 
redesigned if hard links cannot be used. In order to accommodate this 
software, we now emulate hard links by creating a "kernel-level" 
symbolic link which is visible only to and interpreted by the HFS+ file 
system. This was necessary due to the lack of support in the volume 
format. The resulting behavior is very similar to that of hard links 
when viewed from above the kernel, though they are relatively 
inefficient in comparison.
******


So maybe the implementation is pretty broken.
This leaves the question why darcs creates hard links in the first 
place, in case it does?




On 03. Mrz 2005, at 11:15 Uhr, Markus Hanauska wrote:

>
> Maybe I was wrong, maybe it is link related.
>
> Try this:
>
> touch file1.c
> ln file1.c file2.c
> rm file2.c
>
> Try to edit file1.c with XCode, Subethaedit or Smultron. It won't 
> work with any of these editors. You can open and edit, but you can't 
> save your changes.
>
> Also nice, try this one:
>
> touch file1.c
> ln file1.c file2.c
> rm file1.c
>
> Now try to edit file2.c. You can't even open it with XCode!
>
>
> I'd like to create a darcs version, that does for sure not create any 
> links, but I already fail to compile tho unmodified version from 
> source, it complains about missing symbols when linking. Aside from 
> this I don't understand more of Haskell than some basic semantics, 
> making changes to the source code a bit problematic.
>
>
> On 03. Mrz 2005, at 10:56 Uhr, Markus Hanauska wrote:
>
>>
>> On 02. Mrz 2005, at 22:27 Uhr, David Roundy wrote:
>>
>>> Sounds sort of like a problem which was reported regarding having 
>>> multiple
>>> links to the same file.  As I recall, that bug report wasn't ever 
>>> really
>>> clarified, at least not to my satisfaction (meaning that we never 
>>> quite
>>> figured out what the reporter had done).
>>
>> Hi Dave,
>>
>> You are right, we found that bug as well, ten minutes after I sent 
>> the mail. Sorry for that. Meanwhile I'm subscribed to the developer 
>> mailing list, so we could take the discussion there as well.
>>
>>> It could be that it was a
>>> misdiagnosis (on the user's part--we [the developers] were never 
>>> able to
>>> figure out when darcs would create multiple links to a given file).
>>
>> It is always reproducible for us on any machine. We just use 'get' 
>> and the files are not writeable.
>>
>> darcs get ...
>>
>> No matter if we check out via SSH or HTTP.
>>
>> The link theory does not convince me, as a link means the file has 
>> to be present twice, which is not the case if I check out from a 
>> HTTP source.
>>
>>> I have an iMac (running 10.3), but haven't used a gui editor, so I 
>>> haven't
>>> seen any of this.  If you can give me a method to reproduce the 
>>> problem,
>>> I'll probably be able to fix it.
>>
>> We reproduce it daily, with every check out. Even if we create a 
>> local repos and then use get to get it into another directory, we 
>> have the same problem. And we have also verified it in Tiger and in 
>> Panther. So far we have not tested Jaguar.
>>
>>> I've got the apple developer tools
>>> installed, if that would be helpful (in terms of an example GUI 
>>> tool with
>>> which I could fail to open a file).
>>
>>
>> No, you won't fail to open it, just to save it. Okay, here you go 
>> (you are in ~):
>>
>> mkdir test
>> cd test
>> touch file.c
>> darcs initialize
>> darcs add file.c
>> darcs record
>>
>> Now the check out:
>>
>> cd ..
>> mkdir test2
>> cd test2
>> darcs get ../test
>> cd test
>>
>> Now open File with Xcode, change something and try to save it.
>> It won't work. Open the original file.c in ~/test and it will work.
>>
>> However, this has nothing to do with links, as the files are no 
>> links: changing one won't change the other one. And where else 
>> should be a link?
>>
>>> You could also post this on darcs-users, since there are definitely 
>>> people
>>> there with more expertise on the mac than I have.
>>
>> Okay, we could also use this to user, but I think it is rather a 
>> development problem. I send the mail there, assuming you don't mind.
>

-- 
Best Regards,
     Markus Hanauska





More information about the darcs-users mailing list