Skip to content

Commit b1c8e2f

Browse files
dschoelieux
authored andcommitted
msys2-runtime: expose the "deep-copy" symlink behavior via a new mode
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]>
1 parent 1323da5 commit b1c8e2f

File tree

32 files changed

+355
-61
lines changed

32 files changed

+355
-61
lines changed

msys2-runtime/0001-Add-MSYS2-triplet.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -2817,5 +2817,5 @@ index ff12dc2..cb45983 100644
28172817
install_host="install_host"
28182818
;;
28192819
--
2820-
2.27.0
2820+
2.28.0
28212821

msys2-runtime/0002-Rename-dll-from-cygwin-to-msys.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -1525,5 +1525,5 @@ index b96ad40..8ba5b9e 100644
15251525
}
15261526
if (cygwin_internal (CW_STRACE_TOGGLE, child_pid))
15271527
--
1528-
2.27.0
1528+
2.28.0
15291529

msys2-runtime/0003-Add-functionality-for-converting-UNIX-paths-in-argum.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -1102,5 +1102,5 @@ index e3a65f8..1aeec8d 100644
11021102
{
11031103
for (int i = calloced; i < argc; i++)
11041104
--
1105-
2.27.0
1105+
2.28.0
11061106

msys2-runtime/0004-Add-functionality-for-changing-OS-name-via-MSYSTEM-e.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -187,5 +187,5 @@ index 3502166..28bcd63 100644
187187
/* Add a hint to the sysname, that we're running under WOW64. This might
188188
give an early clue if somebody encounters problems. */
189189
--
190-
2.27.0
190+
2.28.0
191191

msys2-runtime/0005-Move-root-to-usr.-Change-sorting-mount-points.-By-de.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -397,5 +397,5 @@ index c0a0f61..4c94d83 100644
397397
free (gecos);
398398
if (home)
399399
--
400-
2.27.0
400+
2.28.0
401401

msys2-runtime/0006-Do-not-create-cygwin-symlinks.-Instead-use-deep-copy.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -175,5 +175,5 @@ index 7ffb5bc..9b908ea 100644
175175
buf = tp.t_get ();
176176
cp = stpcpy (buf, SYMLINK_COOKIE);
177177
--
178-
2.27.0
178+
2.28.0
179179

msys2-runtime/0007-Automatically-rewrite-TERM-msys-to-TERM-cygwin-With-.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,5 @@ index 87650cc..adc8884 100644
3535
else if (*newp == 'M' && strncmp (newp, "MSYS=", 5) == 0)
3636
parse_options (newp + 5);
3737
--
38-
2.27.0
38+
2.28.0
3939

msys2-runtime/0008-Do-not-convert-environment-for-strace.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ index e7a0810..426af44 100644
2929
{
3030
set_errno (E2BIG);
3131
--
32-
2.27.0
32+
2.28.0
3333

msys2-runtime/0009-Special-case-for-converting-root-directory-to-have-t.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,5 @@ index 9b908ea..f592cb8 100644
5454
}
5555

5656
--
57-
2.27.0
57+
2.28.0
5858

msys2-runtime/0010-dcrt0.cc-Untangle-allow_glob-from-winshell.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,5 @@ index b851727..c2da0cb 100644
7676

7777
/* Convert argv[0] to posix rules if it's currently blatantly
7878
--
79-
2.27.0
79+
2.28.0
8080

msys2-runtime/0011-dcrt0.cc-globify-Don-t-quote-literal-strings-differe.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,5 @@ index c2da0cb..7ac8bf0 100644
5656
size_t cnt = isascii (*s) ? 1 : mbtowc (NULL, s, MB_CUR_MAX);
5757
if (cnt <= 1 || cnt == (size_t)-1)
5858
--
59-
2.27.0
59+
2.28.0
6060

msys2-runtime/0012-strace.cc-Don-t-set-MSYS-noglob.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,5 @@ index 8ba5b9e..e7ac668 100644
6868
NULL, /* Security */
6969
NULL, /* thread */
7070
--
71-
2.27.0
71+
2.28.0
7272

msys2-runtime/0013-Add-debugging-for-build_argv.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ index 7ac8bf0..4683972 100644
2121
while (*cmd)
2222
{
2323
--
24-
2.27.0
24+
2.28.0
2525

msys2-runtime/0014-Add-debugging-for-strace-make_command_line.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ index e7ac668..2fe3cac 100644
2020
SetConsoleCtrlHandler (NULL, 0);
2121
/* Commit message for this code was:
2222
--
23-
2.27.0
23+
2.28.0
2424

msys2-runtime/0015-environ.cc-New-facility-environment-variable-MSYS2_E.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -172,5 +172,5 @@ index 426af44..d8fc19c 100644
172172

173173
/* Check if we have been called from exec{lv}p or spawn{lv}p and mask
174174
--
175-
2.27.0
175+
2.28.0
176176

msys2-runtime/0016-Fix-native-symbolic-link-spawn-passing-wrong-arg0.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ index d8fc19c..0daac24 100644
2121

2222
if (buf.isdir ())
2323
--
24-
2.27.0
24+
2.28.0
2525

msys2-runtime/0017-QueryUnbiasedInterruptTime-must-be-load-from-kernel3.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ index 613a019..61c2808 100644
2222
LoadDLLfunc (VirtualAlloc2, 28, kernelbase)
2323

2424
--
25-
2.27.0
25+
2.28.0
2626

msys2-runtime/0018-fixup-Do-not-create-cygwin-symlinks.-Instead-use-dee.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ index 573a9b7..927efd8 100644
2424
while (--pos >= 0)
2525
if (isdirsep (newpath[pos]))
2626
--
27-
2.27.0
27+
2.28.0
2828

msys2-runtime/0019-strace-quiet-be-really-quiet.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@ index 2fe3cac..25f8f6b 100644
3636
SetConsoleCtrlHandler (NULL, 0);
3737
/* Commit message for this code was:
3838
--
39-
2.27.0
39+
2.28.0
4040

msys2-runtime/0020-Default-to-disable_pcon.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,5 @@ index 942bd1c..da82320 100644
5050
bool NO_COPY in_forkee;
5151

5252
--
53-
2.27.0
53+
2.28.0
5454

msys2-runtime/0021-Introduce-the-enable_pcon-value-for-MSYS.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,5 @@ index 4b03836..3d57e34 100644
5353
*k->setting.x &= ~k->values[istrue].i;
5454
if (istrue || (eq && strtol (eq, NULL, 0)))
5555
--
56-
2.27.0
56+
2.28.0
5757

msys2-runtime/0022-Don-t-create-WSL-symlinks-for-MSYS2.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,5 @@ index 927efd8..2dfe0ef 100644
4444
default:
4545
break;
4646
--
47-
2.27.0
47+
2.28.0
4848

msys2-runtime/0023-popen-call-usr-bin-sh-instead-of-bin-sh.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ index 186eeec..fdb49f3 100644
3030

3131
/* Reinstate the close-on-exec state */
3232
--
33-
2.27.0
33+
2.28.0
3434

msys2-runtime/0024-CI-add-a-GHA-for-doing-a-basic-build-test.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,5 @@ index 0000000..c7ed476
4040
+ make -j8
4141
\ No newline at end of file
4242
--
43-
2.27.0
43+
2.28.0
4444

msys2-runtime/0025-Set-up-a-GitHub-Action-to-keep-in-sync-with-Cygwin.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ index 0000000..defcdf8
3939
+ run: |
4040
+ git push https://$GITHUB_ACTOR:[email protected]/$GITHUB_REPOSITORY refs/heads/cygwin/master 'refs/tags/*:refs/tags/*'
4141
--
42-
2.27.0
42+
2.28.0
4343

msys2-runtime/0026-recursiveCopy-Always-close-the-used-handle-with-Find.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@ index 2dfe0ef..aa70113 100644
3333
}
3434

3535
--
36-
2.27.0
36+
2.28.0
3737

msys2-runtime/0027-fixup-Add-functionality-for-converting-UNIX-paths-in.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,5 @@ index 0daac24..c77d629 100644
4343

4444

4545
--
46-
2.27.0
46+
2.28.0
4747

msys2-runtime/0028-Expose-full-command-lines-to-other-Win32-processes-b.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,5 @@ index a52b6ac..de05270 100644
5252

5353
<listitem>
5454
--
55-
2.27.0
55+
2.28.0
5656

msys2-runtime/0029-Cygwin-pty-Prevent-garbled-output-when-pseudo-consol.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ index 43eebc1..b9cb45b 100644
2828

2929
void
3030
--
31-
2.27.0
31+
2.28.0
3232

0 commit comments

Comments
 (0)