[PATCH setup 0/2] Add option to choose symlink type

Jon Turney jon.turney@dronecode.org.uk
Sun May 23 18:27:35 GMT 2021

This is an initial attempt at adding an option to setup to choose the
symlink type used. The default behaviour is left as creating magic-type
symlinks, as setup currently does.

The idea being that since Cygwin (since 3.1.5) creates WSL symlinks, if
possible, and there's presumably some value over magic symlinks in doing
that, setup should be consistent.

This could be extended to shortcut and native symlinks (which are the kind
which would actually be useful, if they didn't have the all the problems
they do).

This doesn't propagate the chosen setting into post-install scripts using
'CYGWIN=winsymlinks:<something>', because equivalent values of <something>
don't exist (currently), so you still don't get consistent behaviour.

Ideally, we'd have the default option be 'do the same thing as Cygwin does'
(but that's quite complex [as Cygwin embeds some knowledge about what's best
for some filesystem types] and is possibly a moving target), but 'try to
make WSL symlink and fallback to magic if that fails' is probably a better
default choice than insisting on one type.

(Orthogonally, there's still the (long-standing) issue that setup only
considers the mount table, and completely ignores Cygwin symlinks when
creating files (e.g. if you have /usr/share symlinked to
/cygdrive/d/somewhere/, and install a package with some files under
/usr/share, it's just going to ignore that and try to create files using the
Windows path it thinks is right.)

Jon Turney (2):
  Add support for creating WSL symlinks
  Add a command line option to choose symlink type used

 inilintmain.cc |   7 +++
 main.cc        |  29 +++++++++++
 mklink2.cc     | 139 +++++++++++++++++++++++++++++++++++++++++++++++--
 mklink2.h      |  10 ++++
 4 files changed, 182 insertions(+), 3 deletions(-)


More information about the Cygwin-apps mailing list