Bug in Cabal?
Dominic Steinitz
dominic.steinitz at blueyonder.co.uk
Sun Feb 1 08:47:59 EST 2009
Duncan Coutts wrote:
> Hia Dominic,
>
> I've looked into this a bit. I think I may now be less confused. :-)
>
> On Wed, 2009-01-21 at 18:01 +0000, Dominic Steinitz wrote:
>
>>> ls -ltr haskell_packages\doc\zlib-0.5.0.0
>> total 2
>> -r--r--r-- 1 user group 1327 Jan 21 11:37 LICENSE
>
> Ah! Is that the only file that is read-only? That makes sense since it's
> an original source file from your read-only source control system. The
> System.Directory.copyFile function does not copy permissions (though it
> does try to) but it does (unhelpfully) copy the read-only attribute.
It may not be but a lot of packages only have a LICENSE file. I'll have
a look tomorrow.
>
>> When I rebuild the package *without* having cleaned out haskell_packages then I
>> get the access error. I think this is because cabal (copyFile) doesn't want to
>> overwrite a read only file even though the directory permissions should allow
>> it to do so.
>
> Yes. The windows MoveFile function does not let us move a file over a
> file that has the read-only attribute.
>
> It's an annoying interaction between the semantics of old DOS/FAT
> read-only attribute and new windows file permissions (ACLs).
>
> The solution I think, is never to copy the read-only attribute when
> installing files. It's thoroughly unhelpful. I've got a patch to do this
> which I shall push to Cabal HEAD shortly. If you have a moment to help
> me test that it would be much appreciated.
Thanks very much. I'll try it out tomorrow.
More information about the Libraries
mailing list