public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
From: Jon Turney <jon.turney@dronecode.org.uk>
To: cygwin-apps@cygwin.com
Cc: Jon Turney <jon.turney@dronecode.org.uk>
Subject: [PATCH setup 0/2] Add option to choose symlink type
Date: Sun, 23 May 2021 19:27:35 +0100	[thread overview]
Message-ID: <20210523182738.14292-1-jon.turney@dronecode.org.uk> (raw)

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(-)

-- 
2.31.1


             reply	other threads:[~2021-05-23 18:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-23 18:27 Jon Turney [this message]
2021-05-23 18:27 ` [PATCH setup 1/2] Add support for creating WSL symlinks Jon Turney
2021-05-23 18:27 ` [PATCH setup 2/2] Add a command line option to choose symlink type used Jon Turney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210523182738.14292-1-jon.turney@dronecode.org.uk \
    --to=jon.turney@dronecode.org.uk \
    --cc=cygwin-apps@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).