Cygwin symlinks

"Bastian Eicher" <[email protected]> Fri, 2 Oct 2015 15:50:11 +0200
Newsgroups gmane.comp.file-systems.zero-install.devel
Message-ID <[email protected]>
I recently tried to update the Msysgit/Git for Windows feed [1] but ran into
a little roadblock: Upon first launch newer versions of Git for Windows
execute a set of post-install scripts that create a couple of hardlinks and
Cygwin symlinks [2]. Since Zero Install implementations cannot be modified
once they have been added to cache these scripts failed.

Cygwin symlinks [2] are regular files that are marked with the "System" file
system attribute and begin with a "magic string" identifying them as a
symlink followed by the target path. Any application compiled with Cygwin or
Mingw (such as Git for Windows) will treat these files like "real" symlinks.

The obvious solution was to simply create an archive of the Git installation
after the scripts had run. Two issues with that:
* Most archiving tools on Windows do not detect hardlinks so a number of
files would be added to the archive twice.
* Most archiving tools and Zero Install itself know nothing about Cygwin
symlinks.

So far Zero Install for Windows extracts symlinks in ZIP or TAR archives as
regular files containing the target path and lists them in a special
.symlink file. I have decided to change this behavior in the next release to
create Cygwin symlinks instead.

Additionally I have added classes to the backend library for creating ZIP
and TAR archives while preserving hardlinks and Cygwin symlinks. I haven't
quite decided how to expose this in the frontend yet. I was thinking
something like this:
0install store export DIGEST OUTPUT-ARCHIVE [MIME-TYPE]
0install archive INPUT-DIRECTORY OUTPUT-ARCHIVE [MIME-TYPE]

Any feedback/suggestions?

[1] http://0install.de/feeds/Msysgit.xml
[2] http://cygwin.com/cygwin-ug-net/using.html#pathnames-symlinks


------------------------------------------------------------------------------