Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

winsymlinks which defaults to native and falls back to deepcopy? #113

Open
lazka opened this issue Nov 6, 2022 · 3 comments
Open

winsymlinks which defaults to native and falls back to deepcopy? #113

lazka opened this issue Nov 6, 2022 · 3 comments

Comments

@lazka
Copy link
Member

lazka commented Nov 6, 2022

I was wondering if we should have a new winsymlinks mode which tries to use native symlinks and falls back to deepcopy if that fails. This way we can tell users to enable developer mode to get proper symlinks.

(disclaimer, I have symlinks disabled here to dogfood the defaults, so I haven't used the native stuff really)

edit:

  • as pointed out in chat, we should make sure pacman packages don't end up with symlinks still, or figure out how to move symlinks last in the tarball to make the deepcopy fallback work
  • what happens with symlinks once dev mode is disabled again?
  • what happens on win8.1?
dscho added a commit to dscho/Cygwin-msys2-fork that referenced this issue Nov 7, 2022
…llback

When native symlinks are available, it is a shame to create deep copies
by default.

However, since there are many scenarios where symlinks are not available
(e.g. when running on FAT, or on older Windows versions, or when
Developer Mode is not enabled), we've got to have a fallback.

In the regular Cygwin world, it is legitimate to fall back to WSL
symlinks and/or to the system file emulation (where a file is created
that is marked with the "system" attribute and with content that adheres
to a specific, magic form that is recognized specifically by the Cygwin
runtime).

However, in the world of MSYS2, the assumption is that the result of the
operation should be as interoperable with regular Win32 programs as
possible. Hence the default to "deepcopy".

As a "best of both worlds" mode, let's implement one that tries to
create native symlinks by default, and if that fails, uses the
"deepcopy" method as a fallback.

This addresses msys2#113.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho
Copy link
Collaborator

dscho commented Nov 7, 2022

@lazka I implemented this in #114 but did not really have time to validate that it does what it is supposed to do.

@lazka
Copy link
Member Author

lazka commented Nov 7, 2022

oh, cool, I gather you think this is a good idea then?

@dscho
Copy link
Collaborator

dscho commented Nov 7, 2022

oh, cool, I gather you think this is a good idea then?

Yes ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants