-
Notifications
You must be signed in to change notification settings - Fork 482
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
msys2-runtime: enable pseudo consoles and empty values of env variables
This integrates the patches from msys2/msys2-runtime#102 and from msys2/msys2-runtime#101 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
- Loading branch information
Showing
41 changed files
with
259 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2709,5 +2709,5 @@ index eb2a870..3bf9d9f 100755 | |
lt_cv_dlopen_libs= | ||
;; | ||
-- | ||
2.37.2 | ||
2.37.3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1094,5 +1094,5 @@ index e3a65f8..1aeec8d 100644 | |
{ | ||
for (int i = calloced; i < argc; i++) | ||
-- | ||
2.37.2 | ||
2.37.3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -397,5 +397,5 @@ index 6aae33c..5736ffb 100644 | |
free (gecos); | ||
if (home) | ||
-- | ||
2.37.2 | ||
2.37.3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -233,5 +233,5 @@ index a430d98..17646a8 100644 | |
buf = tp.t_get (); | ||
cp = stpcpy (buf, SYMLINK_COOKIE); | ||
-- | ||
2.37.2 | ||
2.37.3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,5 +29,5 @@ index 283041a..49cd941 100644 | |
{ | ||
set_errno (E2BIG); | ||
-- | ||
2.37.2 | ||
2.37.3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,5 +54,5 @@ index 17646a8..77480aa 100644 | |
} | ||
|
||
-- | ||
2.37.2 | ||
2.37.3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,5 +76,5 @@ index ee75d3b..d652b32 100644 | |
|
||
/* Convert argv[0] to posix rules if it's currently blatantly | ||
-- | ||
2.37.2 | ||
2.37.3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,5 +68,5 @@ index de4abc4..3dbce3b 100644 | |
NULL, /* Security */ | ||
NULL, /* thread */ | ||
-- | ||
2.37.2 | ||
2.37.3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,5 +21,5 @@ index f75ba5f..4dc8be8 100644 | |
while (*cmd) | ||
{ | ||
-- | ||
2.37.2 | ||
2.37.3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,5 +21,5 @@ index 8359f12..4f28335 100644 | |
|
||
if (buf.isdir ()) | ||
-- | ||
2.37.2 | ||
2.37.3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,5 +22,5 @@ index e254397..2a03ac1 100644 | |
LoadDLLfunc (VirtualAlloc2, 28, KernelBase) | ||
|
||
-- | ||
2.37.2 | ||
2.37.3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,5 +50,5 @@ index 1b8d8e2..29ca896 100644 | |
bool NO_COPY in_forkee; | ||
|
||
-- | ||
2.37.2 | ||
2.37.3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,5 +30,5 @@ index 0890390..f6ffb1c 100644 | |
|
||
/* Reinstate the close-on-exec state */ | ||
-- | ||
2.37.2 | ||
2.37.3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,5 +51,5 @@ index 0000000..4e1d498 | |
+ name: install | ||
+ path: _dest/ | ||
-- | ||
2.37.2 | ||
2.37.3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,5 +52,5 @@ index 649084d..28056e6 100644 | |
|
||
<listitem> | ||
-- | ||
2.37.2 | ||
2.37.3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,5 +31,5 @@ index f9a9a7a..4b541a8 100644 | |
jobs: | ||
fedora-build: | ||
-- | ||
2.37.2 | ||
2.37.3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -381,5 +381,5 @@ index 0000000..25814c7 | |
+ return 0; | ||
+} | ||
-- | ||
2.37.2 | ||
2.37.3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -505,5 +505,5 @@ index 0000000..0486a0c | |
+ | ||
+#endif | ||
-- | ||
2.37.2 | ||
2.37.3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,5 +50,5 @@ index d0fb547..ad718c3 100644 | |
} | ||
|
||
-- | ||
2.37.2 | ||
2.37.3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,5 +51,5 @@ index 9edd949..9a3ad7a 100644 | |
PWCHAR fpbuf = tp.w_get (); | ||
DWORD ret; | ||
-- | ||
2.37.2 | ||
2.37.3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,5 +45,5 @@ index 534d674..d448ede 100644 | |
uninstall-extra-man: | ||
for i in *.1 ; do \ | ||
-- | ||
2.37.2 | ||
2.37.3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,5 +47,5 @@ index 5c197a6..5afac8d 100644 | |
/* P Q R S T U V W */ | ||
WC, 0, 0, WC, WC, 0, 0, 0, | ||
-- | ||
2.37.2 | ||
2.37.3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
msys2-runtime/0037-fixup-Revert-Default-to-disable_pcon.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
From f5d37650e7077d214ec5895b0175918863172086 Mon Sep 17 00:00:00 2001 | ||
From: Christoph Reiter <reiter.christoph@gmail.com> | ||
Date: Tue, 13 Sep 2022 09:36:38 +0200 | ||
Subject: [PATCH 37/N] fixup! Revert "Default to `disable_pcon`" | ||
|
||
This reverts commit 8e89fffcfb0884da1398dd55f0d0cc57294549ec. | ||
|
||
We want to try enabling it by default again, see #98 | ||
--- | ||
winsup/cygwin/globals.cc | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
||
diff --git a/winsup/cygwin/globals.cc b/winsup/cygwin/globals.cc | ||
index 6c15138..6a65dd6 100644 | ||
--- a/winsup/cygwin/globals.cc | ||
+++ b/winsup/cygwin/globals.cc | ||
@@ -74,7 +74,7 @@ bool pipe_byte; | ||
bool reset_com; | ||
bool wincmdln = true; | ||
winsym_t allow_winsymlinks = WSYM_deepcopy; | ||
-bool disable_pcon = true; | ||
+bool disable_pcon; | ||
bool winjitdebug = false; | ||
bool nativeinnerlinks = true; | ||
|
||
-- | ||
2.37.3 | ||
|
48 changes: 48 additions & 0 deletions
48
msys2-runtime/0038-Pass-environment-variables-with-empty-values.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
From 5812c2fb3534a9203cc110cc052fdae730920a3e Mon Sep 17 00:00:00 2001 | ||
From: Johannes Schindelin <johannes.schindelin@gmx.de> | ||
Date: Wed, 18 Feb 2015 12:32:17 +0000 | ||
Subject: [PATCH 38/N] Pass environment variables with empty values | ||
|
||
There is a difference between an empty value and an unset environment | ||
variable. We should not confuse both; If the user wants to unset an | ||
environment variable, they can certainly do so (unsetenv(3), or in the | ||
shell: 'unset ABC'). | ||
|
||
This fixes Git's t3301-notes.sh, which overrides environment variables | ||
with empty values. | ||
|
||
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> | ||
--- | ||
winsup/cygwin/environ.cc | 6 +++--- | ||
1 file changed, 3 insertions(+), 3 deletions(-) | ||
|
||
diff --git a/winsup/cygwin/environ.cc b/winsup/cygwin/environ.cc | ||
index 5afac8d..522d7d5 100644 | ||
--- a/winsup/cygwin/environ.cc | ||
+++ b/winsup/cygwin/environ.cc | ||
@@ -1339,11 +1339,11 @@ build_env (const char * const *envp, PWCHAR &envblock, int &envc, | ||
Note that this doesn't stop invalid strings without '=' in it | ||
etc., but we're opting for speed here for now. Adding complete | ||
checking would be pretty expensive. */ | ||
- if (len == 1 || !*rest) | ||
+ if (len == 1) | ||
continue; | ||
|
||
/* See if this entry requires posix->win32 conversion. */ | ||
- conv = getwinenv (*srcp, rest, &temp); | ||
+ conv = !*rest ? NULL : getwinenv (*srcp, rest, &temp); | ||
if (conv) | ||
{ | ||
p = conv->native; /* Use win32 path */ | ||
@@ -1357,7 +1357,7 @@ build_env (const char * const *envp, PWCHAR &envblock, int &envc, | ||
} | ||
} | ||
#ifdef __MSYS__ | ||
- else if (!keep_posix) { | ||
+ else if (!keep_posix && *rest) { | ||
char *win_arg = arg_heuristic_with_exclusions | ||
(*srcp, msys2_env_conv_excl_env, msys2_env_conv_excl_count); | ||
debug_printf("WIN32_PATH is %s", win_arg); | ||
-- | ||
2.37.3 | ||
|
60 changes: 60 additions & 0 deletions
60
msys2-runtime/0039-Optionally-disallow-empty-environment-values-again.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
From 96283acb9d8fe69bb921ee84c584bc79b1eb262f Mon Sep 17 00:00:00 2001 | ||
From: Johannes Schindelin <johannes.schindelin@gmx.de> | ||
Date: Tue, 6 Sep 2022 10:40:58 +0200 | ||
Subject: [PATCH 39/N] Optionally disallow empty environment values again | ||
|
||
We just disabled the code that skips environment variables whose values | ||
are empty. | ||
|
||
However, this code was introduced a long time ago into Cygwin in | ||
d6b1ac7faa (* environ.cc (build_env): Don't put an empty environment | ||
variable into the environment. Optimize use of "len". * errno.cc | ||
(ERROR_MORE_DATA): Translate to EMSGSIZE rather than EAGAIN., | ||
2006-09-07), seemingly without any complaints. | ||
|
||
Meaning: There might very well be use cases out there where it makes | ||
sense to skip empty-valued environment variables. | ||
|
||
Therefore, it seems like a good idea to have a "knob" to turn it back | ||
on. With this commit, we introduce such a knob: by setting | ||
`noemptyenvvalues` the `MSYS` variable (or appending it if that variable | ||
is already set), users can tell the MSYS2 runtime to behave just like in | ||
the olden times. | ||
|
||
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> | ||
--- | ||
winsup/cygwin/environ.cc | 4 +++- | ||
1 file changed, 3 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/winsup/cygwin/environ.cc b/winsup/cygwin/environ.cc | ||
index 522d7d5..128f34d 100644 | ||
--- a/winsup/cygwin/environ.cc | ||
+++ b/winsup/cygwin/environ.cc | ||
@@ -36,6 +36,7 @@ static char **lastenviron; | ||
/* Parse CYGWIN options */ | ||
|
||
static NO_COPY bool export_settings = false; | ||
+static bool emptyenvvalues = true; | ||
|
||
enum settings | ||
{ | ||
@@ -130,6 +131,7 @@ static struct parse_thing | ||
{"enable_pcon", {&disable_pcon}, setnegbool, NULL, {{true}, {false}}}, | ||
{"winjitdebug", {&winjitdebug}, setbool, NULL, {{false}, {true}}}, | ||
{"nativeinnerlinks", {&nativeinnerlinks}, setbool, NULL, {{false}, {true}}}, | ||
+ {"emptyenvvalues", {&emptyenvvalues}, setbool, NULL, {{false}, {true}}}, | ||
{NULL, {0}, setdword, 0, {{0}, {0}}} | ||
}; | ||
|
||
@@ -1339,7 +1341,7 @@ build_env (const char * const *envp, PWCHAR &envblock, int &envc, | ||
Note that this doesn't stop invalid strings without '=' in it | ||
etc., but we're opting for speed here for now. Adding complete | ||
checking would be pretty expensive. */ | ||
- if (len == 1) | ||
+ if (len == 1 || (!emptyenvvalues && !*rest)) | ||
continue; | ||
|
||
/* See if this entry requires posix->win32 conversion. */ | ||
-- | ||
2.37.3 | ||
|
Oops, something went wrong.