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

msys2-runtime: expose the "deep-copy" symlink behavior via a new mode #2200

Merged
merged 1 commit into from
Oct 22, 2020

Conversation

dscho
Copy link
Contributor

@dscho dscho commented Oct 22, 2020

This patch synchronizes msys2/MSYS2-packages/msys2-runtime with
msys2/msys2-runtime after merging
msys2/msys2-runtime#16.

Unfortunately, most of the patch is somewhat useless churn: the signature of the patches records the Git version used to generate the patches, and that version changed from v2.27.0 to v2.28.0.

This patch synchronizes msys2/MSYS2-packages/msys2-runtime with
msys2/msys2-runtime after merging
msys2/msys2-runtime#16.

We specifically override Cygwin's symlink() behavior to make deep copies
instead of creating a special-crafted system file that Cygwin (MSYS2,
and only those two) will recognize as symbolic link.

The patch to override this behavior is incomplete, though: it hacks up
the WSYM_sysfile code path, which causes all kinds of problems:

- Contrary to the documentation, MSYS=winsymlinks:native won't fall back
  to creating Cygwin-style symbolic links. Instead, it (quite
  surprisingly) creates deep copies instead.

- There is no way to opt into the original Cygwin behavior because that
  code path is now dead code.

- The fact that the WSYM_sysfile code path is modified to do something
  very different from what it is intended to do means that all changes
  that Cygwin makes to that code path have to be inspected, and
  occasionally even more hacks have to be put on top, such as 44bb133,
  where we specifically had to disable Cygwin's code to try creating WSL
  symlinks before falling back to creating system files instead).

Let's fix this by introducing a proper new mode:
MSYS=winsymlinks:deepcopy. This mode is made the default so
that users should be unaffected by this PR.

Users wishing to let the MSYS2 runtime create Cygwin-style
symbolic links can ask for that by setting
MSYS=winsymlinks:sysfile.

By fixing this issue, we can now stop disabling Cygwin's WSL
symlink behavior, too: it is in the sysfile code path and
won't affect the default behavior of the MSYS2 runtime.

While at it, the indentation of the original patch is fixed,
too.

Signed-off-by: Johannes Schindelin <[email protected]>
@dscho
Copy link
Contributor Author

dscho commented Oct 22, 2020

Oh, I should also mention that all I did was running ./update-patches.sh, then incrementing the pkgrel and then transmogrifying the PR description into the commit message.

@elieux elieux merged commit b1c8e2f into msys2:master Oct 22, 2020
@dscho dscho deleted the msys2-runtime-deepcopy branch October 23, 2020 14:05
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

Successfully merging this pull request may close these issues.

2 participants