From 3dad03537cbf09e11ac85e6e33e4ece56f757339 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Tue, 20 Sep 2022 21:24:43 +0200 Subject: [PATCH] msys2-runtime: enable pseudo consoles and empty values of env variables This integrates the patches from https://github.com/msys2/msys2-runtime/pull/102 and from https://github.com/msys2/msys2-runtime/pull/101 Signed-off-by: Johannes Schindelin --- msys2-runtime/0001-Add-MSYS2-triplet.patch | 2 +- ...sys-library-name-in-import-libraries.patch | 2 +- .../0003-Rename-dll-from-cygwin-to-msys.patch | 2 +- ...y-for-converting-UNIX-paths-in-argum.patch | 2 +- ...y-for-changing-OS-name-via-MSYSTEM-e.patch | 2 +- ....-Change-sorting-mount-points.-By-de.patch | 2 +- ...ing-Cygwin-symlinks-use-deep-copy-by.patch | 2 +- ...write-TERM-msys-to-TERM-cygwin-With-.patch | 2 +- ...o-not-convert-environment-for-strace.patch | 2 +- ...-converting-root-directory-to-have-t.patch | 2 +- ...cc-Untangle-allow_glob-from-winshell.patch | 2 +- ...-Don-t-quote-literal-strings-differe.patch | 2 +- ...0013-strace.cc-Don-t-set-MSYS-noglob.patch | 2 +- .../0014-Add-debugging-for-build_argv.patch | 2 +- ...bugging-for-strace-make_command_line.patch | 2 +- ...acility-environment-variable-MSYS2_E.patch | 2 +- ...mbolic-link-spawn-passing-wrong-arg0.patch | 2 +- ...erruptTime-must-be-load-from-kernel3.patch | 2 +- .../0019-strace-quiet-be-really-quiet.patch | 2 +- .../0020-Default-to-disable_pcon.patch | 2 +- ...oduce-the-enable_pcon-value-for-MSYS.patch | 2 +- ...en-call-usr-bin-sh-instead-of-bin-sh.patch | 2 +- ...d-a-GHA-for-doing-a-basic-build-test.patch | 2 +- ...b-Action-to-keep-in-sync-with-Cygwin.patch | 2 +- ...and-lines-to-other-Win32-processes-b.patch | 2 +- ...6-Disable-the-cygwin-GitHub-workflow.patch | 2 +- ...Do-not-show-Error-dialogs-by-default.patch | 2 +- ...obtain-a-function-s-address-in-kerne.patch | 2 +- ...GenerateConsoleCtrlEvent-upon-Ctrl-C.patch | 2 +- ...ill-kill-Win32-processes-more-gently.patch | 2 +- ...ption-for-native-inner-link-handling.patch | 2 +- ...-skip-building-texinfo-and-PDF-files.patch | 2 +- ...-install-libs-depend-on-the-toollibs.patch | 2 +- .../0034-POSIX-ify-the-SHELL-variable.patch | 2 +- ...-Handle-ORIGINAL_PATH-just-like-PATH.patch | 2 +- ...ow-setting-the-system-name-to-CYGWIN.patch | 2 +- ...fixup-Revert-Default-to-disable_pcon.patch | 28 ++++++ ...ironment-variables-with-empty-values.patch | 48 ++++++++++ ...allow-empty-environment-values-again.patch | 60 +++++++++++++ ...espect-the-MSYS-environment-variable.patch | 37 ++++++++ msys2-runtime/PKGBUILD | 88 +++++++++++-------- 41 files changed, 259 insertions(+), 74 deletions(-) create mode 100644 msys2-runtime/0037-fixup-Revert-Default-to-disable_pcon.patch create mode 100644 msys2-runtime/0038-Pass-environment-variables-with-empty-values.patch create mode 100644 msys2-runtime/0039-Optionally-disallow-empty-environment-values-again.patch create mode 100644 msys2-runtime/0040-build_env-respect-the-MSYS-environment-variable.patch diff --git a/msys2-runtime/0001-Add-MSYS2-triplet.patch b/msys2-runtime/0001-Add-MSYS2-triplet.patch index c31843b4..95b97c0e 100644 --- a/msys2-runtime/0001-Add-MSYS2-triplet.patch +++ b/msys2-runtime/0001-Add-MSYS2-triplet.patch @@ -2709,5 +2709,5 @@ index eb2a870..3bf9d9f 100755 lt_cv_dlopen_libs= ;; -- -2.37.2 +2.37.3 diff --git a/msys2-runtime/0002-Fix-msys-library-name-in-import-libraries.patch b/msys2-runtime/0002-Fix-msys-library-name-in-import-libraries.patch index b414cf73..38b62622 100644 --- a/msys2-runtime/0002-Fix-msys-library-name-in-import-libraries.patch +++ b/msys2-runtime/0002-Fix-msys-library-name-in-import-libraries.patch @@ -25,5 +25,5 @@ index b900960..617a9c2 100755 my ($file, $member, $symbol) = m%^([^:]*):([^:]*(?=:))?.* T (.*)%o; next if !defined($symbol) || $symbol =~ $exclude_regex; -- -2.37.2 +2.37.3 diff --git a/msys2-runtime/0003-Rename-dll-from-cygwin-to-msys.patch b/msys2-runtime/0003-Rename-dll-from-cygwin-to-msys.patch index e0459849..d79063ae 100644 --- a/msys2-runtime/0003-Rename-dll-from-cygwin-to-msys.patch +++ b/msys2-runtime/0003-Rename-dll-from-cygwin-to-msys.patch @@ -1442,5 +1442,5 @@ index 4c98eef..ad35d23 100644 "The \"-b\" means 'skip the help pages'. You can omit this until you're\n" "familiar with the report layout. The gprof documentation explains\n" -- -2.37.2 +2.37.3 diff --git a/msys2-runtime/0004-Add-functionality-for-converting-UNIX-paths-in-argum.patch b/msys2-runtime/0004-Add-functionality-for-converting-UNIX-paths-in-argum.patch index f8e07cb9..40fb580b 100644 --- a/msys2-runtime/0004-Add-functionality-for-converting-UNIX-paths-in-argum.patch +++ b/msys2-runtime/0004-Add-functionality-for-converting-UNIX-paths-in-argum.patch @@ -1094,5 +1094,5 @@ index e3a65f8..1aeec8d 100644 { for (int i = calloced; i < argc; i++) -- -2.37.2 +2.37.3 diff --git a/msys2-runtime/0005-Add-functionality-for-changing-OS-name-via-MSYSTEM-e.patch b/msys2-runtime/0005-Add-functionality-for-changing-OS-name-via-MSYSTEM-e.patch index 22c55b90..62c20fa5 100644 --- a/msys2-runtime/0005-Add-functionality-for-changing-OS-name-via-MSYSTEM-e.patch +++ b/msys2-runtime/0005-Add-functionality-for-changing-OS-name-via-MSYSTEM-e.patch @@ -191,5 +191,5 @@ index 3502166..daed73f 100644 /* Add a hint to the sysname, that we're running under WOW64. This might give an early clue if somebody encounters problems. */ -- -2.37.2 +2.37.3 diff --git a/msys2-runtime/0006-Move-root-to-usr.-Change-sorting-mount-points.-By-de.patch b/msys2-runtime/0006-Move-root-to-usr.-Change-sorting-mount-points.-By-de.patch index 13e43e14..8a7773ca 100644 --- a/msys2-runtime/0006-Move-root-to-usr.-Change-sorting-mount-points.-By-de.patch +++ b/msys2-runtime/0006-Move-root-to-usr.-Change-sorting-mount-points.-By-de.patch @@ -397,5 +397,5 @@ index 6aae33c..5736ffb 100644 free (gecos); if (home) -- -2.37.2 +2.37.3 diff --git a/msys2-runtime/0007-Instead-of-creating-Cygwin-symlinks-use-deep-copy-by.patch b/msys2-runtime/0007-Instead-of-creating-Cygwin-symlinks-use-deep-copy-by.patch index accfafc5..b716ea15 100644 --- a/msys2-runtime/0007-Instead-of-creating-Cygwin-symlinks-use-deep-copy-by.patch +++ b/msys2-runtime/0007-Instead-of-creating-Cygwin-symlinks-use-deep-copy-by.patch @@ -233,5 +233,5 @@ index a430d98..17646a8 100644 buf = tp.t_get (); cp = stpcpy (buf, SYMLINK_COOKIE); -- -2.37.2 +2.37.3 diff --git a/msys2-runtime/0008-Automatically-rewrite-TERM-msys-to-TERM-cygwin-With-.patch b/msys2-runtime/0008-Automatically-rewrite-TERM-msys-to-TERM-cygwin-With-.patch index 451e0831..9bebb7d5 100644 --- a/msys2-runtime/0008-Automatically-rewrite-TERM-msys-to-TERM-cygwin-With-.patch +++ b/msys2-runtime/0008-Automatically-rewrite-TERM-msys-to-TERM-cygwin-With-.patch @@ -35,5 +35,5 @@ index 296c890..2e290a8 100644 else if (*newp == 'M' && strncmp (newp, "MSYS=", 5) == 0) parse_options (newp + 5); -- -2.37.2 +2.37.3 diff --git a/msys2-runtime/0009-Do-not-convert-environment-for-strace.patch b/msys2-runtime/0009-Do-not-convert-environment-for-strace.patch index 7ece882d..9e9cc871 100644 --- a/msys2-runtime/0009-Do-not-convert-environment-for-strace.patch +++ b/msys2-runtime/0009-Do-not-convert-environment-for-strace.patch @@ -29,5 +29,5 @@ index 283041a..49cd941 100644 { set_errno (E2BIG); -- -2.37.2 +2.37.3 diff --git a/msys2-runtime/0010-Special-case-for-converting-root-directory-to-have-t.patch b/msys2-runtime/0010-Special-case-for-converting-root-directory-to-have-t.patch index fc91fd90..b83ece84 100644 --- a/msys2-runtime/0010-Special-case-for-converting-root-directory-to-have-t.patch +++ b/msys2-runtime/0010-Special-case-for-converting-root-directory-to-have-t.patch @@ -54,5 +54,5 @@ index 17646a8..77480aa 100644 } -- -2.37.2 +2.37.3 diff --git a/msys2-runtime/0011-dcrt0.cc-Untangle-allow_glob-from-winshell.patch b/msys2-runtime/0011-dcrt0.cc-Untangle-allow_glob-from-winshell.patch index d10f517b..4090424e 100644 --- a/msys2-runtime/0011-dcrt0.cc-Untangle-allow_glob-from-winshell.patch +++ b/msys2-runtime/0011-dcrt0.cc-Untangle-allow_glob-from-winshell.patch @@ -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 diff --git a/msys2-runtime/0012-dcrt0.cc-globify-Don-t-quote-literal-strings-differe.patch b/msys2-runtime/0012-dcrt0.cc-globify-Don-t-quote-literal-strings-differe.patch index 837885bf..e594ea65 100644 --- a/msys2-runtime/0012-dcrt0.cc-globify-Don-t-quote-literal-strings-differe.patch +++ b/msys2-runtime/0012-dcrt0.cc-globify-Don-t-quote-literal-strings-differe.patch @@ -56,5 +56,5 @@ index d652b32..f75ba5f 100644 size_t cnt = isascii (*s) ? 1 : mbtowc (NULL, s, MB_CUR_MAX); if (cnt <= 1 || cnt == (size_t)-1) -- -2.37.2 +2.37.3 diff --git a/msys2-runtime/0013-strace.cc-Don-t-set-MSYS-noglob.patch b/msys2-runtime/0013-strace.cc-Don-t-set-MSYS-noglob.patch index 797f90f4..b1de376b 100644 --- a/msys2-runtime/0013-strace.cc-Don-t-set-MSYS-noglob.patch +++ b/msys2-runtime/0013-strace.cc-Don-t-set-MSYS-noglob.patch @@ -68,5 +68,5 @@ index de4abc4..3dbce3b 100644 NULL, /* Security */ NULL, /* thread */ -- -2.37.2 +2.37.3 diff --git a/msys2-runtime/0014-Add-debugging-for-build_argv.patch b/msys2-runtime/0014-Add-debugging-for-build_argv.patch index 63b6a519..cb0e0a6f 100644 --- a/msys2-runtime/0014-Add-debugging-for-build_argv.patch +++ b/msys2-runtime/0014-Add-debugging-for-build_argv.patch @@ -21,5 +21,5 @@ index f75ba5f..4dc8be8 100644 while (*cmd) { -- -2.37.2 +2.37.3 diff --git a/msys2-runtime/0015-Add-debugging-for-strace-make_command_line.patch b/msys2-runtime/0015-Add-debugging-for-strace-make_command_line.patch index cfd1818f..a06f29cb 100644 --- a/msys2-runtime/0015-Add-debugging-for-strace-make_command_line.patch +++ b/msys2-runtime/0015-Add-debugging-for-strace-make_command_line.patch @@ -20,5 +20,5 @@ index 3dbce3b..4e5d24c 100644 SetConsoleCtrlHandler (NULL, 0); /* Commit message for this code was: -- -2.37.2 +2.37.3 diff --git a/msys2-runtime/0016-environ.cc-New-facility-environment-variable-MSYS2_E.patch b/msys2-runtime/0016-environ.cc-New-facility-environment-variable-MSYS2_E.patch index 56519969..3043158c 100644 --- a/msys2-runtime/0016-environ.cc-New-facility-environment-variable-MSYS2_E.patch +++ b/msys2-runtime/0016-environ.cc-New-facility-environment-variable-MSYS2_E.patch @@ -172,5 +172,5 @@ index 49cd941..8359f12 100644 /* Check if we have been called from exec{lv}p or spawn{lv}p and mask -- -2.37.2 +2.37.3 diff --git a/msys2-runtime/0017-Fix-native-symbolic-link-spawn-passing-wrong-arg0.patch b/msys2-runtime/0017-Fix-native-symbolic-link-spawn-passing-wrong-arg0.patch index 6258abf3..4ccd6ff2 100644 --- a/msys2-runtime/0017-Fix-native-symbolic-link-spawn-passing-wrong-arg0.patch +++ b/msys2-runtime/0017-Fix-native-symbolic-link-spawn-passing-wrong-arg0.patch @@ -21,5 +21,5 @@ index 8359f12..4f28335 100644 if (buf.isdir ()) -- -2.37.2 +2.37.3 diff --git a/msys2-runtime/0018-QueryUnbiasedInterruptTime-must-be-load-from-kernel3.patch b/msys2-runtime/0018-QueryUnbiasedInterruptTime-must-be-load-from-kernel3.patch index b42c35a9..0e7d86d0 100644 --- a/msys2-runtime/0018-QueryUnbiasedInterruptTime-must-be-load-from-kernel3.patch +++ b/msys2-runtime/0018-QueryUnbiasedInterruptTime-must-be-load-from-kernel3.patch @@ -22,5 +22,5 @@ index e254397..2a03ac1 100644 LoadDLLfunc (VirtualAlloc2, 28, KernelBase) -- -2.37.2 +2.37.3 diff --git a/msys2-runtime/0019-strace-quiet-be-really-quiet.patch b/msys2-runtime/0019-strace-quiet-be-really-quiet.patch index 28aeac2b..787a8a55 100644 --- a/msys2-runtime/0019-strace-quiet-be-really-quiet.patch +++ b/msys2-runtime/0019-strace-quiet-be-really-quiet.patch @@ -36,5 +36,5 @@ index 4e5d24c..a4713a2 100644 SetConsoleCtrlHandler (NULL, 0); /* Commit message for this code was: -- -2.37.2 +2.37.3 diff --git a/msys2-runtime/0020-Default-to-disable_pcon.patch b/msys2-runtime/0020-Default-to-disable_pcon.patch index 62521578..449955a2 100644 --- a/msys2-runtime/0020-Default-to-disable_pcon.patch +++ b/msys2-runtime/0020-Default-to-disable_pcon.patch @@ -50,5 +50,5 @@ index 1b8d8e2..29ca896 100644 bool NO_COPY in_forkee; -- -2.37.2 +2.37.3 diff --git a/msys2-runtime/0021-Introduce-the-enable_pcon-value-for-MSYS.patch b/msys2-runtime/0021-Introduce-the-enable_pcon-value-for-MSYS.patch index f95b9337..f88a5138 100644 --- a/msys2-runtime/0021-Introduce-the-enable_pcon-value-for-MSYS.patch +++ b/msys2-runtime/0021-Introduce-the-enable_pcon-value-for-MSYS.patch @@ -53,5 +53,5 @@ index 49631d6..daaa1ec 100644 *k->setting.x &= ~k->values[istrue].i; if (istrue || (eq && strtol (eq, NULL, 0))) -- -2.37.2 +2.37.3 diff --git a/msys2-runtime/0022-popen-call-usr-bin-sh-instead-of-bin-sh.patch b/msys2-runtime/0022-popen-call-usr-bin-sh-instead-of-bin-sh.patch index fae131af..2393bf95 100644 --- a/msys2-runtime/0022-popen-call-usr-bin-sh-instead-of-bin-sh.patch +++ b/msys2-runtime/0022-popen-call-usr-bin-sh-instead-of-bin-sh.patch @@ -30,5 +30,5 @@ index 0890390..f6ffb1c 100644 /* Reinstate the close-on-exec state */ -- -2.37.2 +2.37.3 diff --git a/msys2-runtime/0023-CI-add-a-GHA-for-doing-a-basic-build-test.patch b/msys2-runtime/0023-CI-add-a-GHA-for-doing-a-basic-build-test.patch index 0b7411f7..0e221da6 100644 --- a/msys2-runtime/0023-CI-add-a-GHA-for-doing-a-basic-build-test.patch +++ b/msys2-runtime/0023-CI-add-a-GHA-for-doing-a-basic-build-test.patch @@ -51,5 +51,5 @@ index 0000000..4e1d498 + name: install + path: _dest/ -- -2.37.2 +2.37.3 diff --git a/msys2-runtime/0024-Set-up-a-GitHub-Action-to-keep-in-sync-with-Cygwin.patch b/msys2-runtime/0024-Set-up-a-GitHub-Action-to-keep-in-sync-with-Cygwin.patch index 9e29d728..5feb0d4b 100644 --- a/msys2-runtime/0024-Set-up-a-GitHub-Action-to-keep-in-sync-with-Cygwin.patch +++ b/msys2-runtime/0024-Set-up-a-GitHub-Action-to-keep-in-sync-with-Cygwin.patch @@ -42,5 +42,5 @@ index 0000000..57bd30e + run: | + git push https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY refs/heads/cygwin/master 'refs/tags/*:refs/tags/*' -- -2.37.2 +2.37.3 diff --git a/msys2-runtime/0025-Expose-full-command-lines-to-other-Win32-processes-b.patch b/msys2-runtime/0025-Expose-full-command-lines-to-other-Win32-processes-b.patch index ae91f718..3e513cda 100644 --- a/msys2-runtime/0025-Expose-full-command-lines-to-other-Win32-processes-b.patch +++ b/msys2-runtime/0025-Expose-full-command-lines-to-other-Win32-processes-b.patch @@ -52,5 +52,5 @@ index 649084d..28056e6 100644 -- -2.37.2 +2.37.3 diff --git a/msys2-runtime/0026-Disable-the-cygwin-GitHub-workflow.patch b/msys2-runtime/0026-Disable-the-cygwin-GitHub-workflow.patch index b6a28dd5..fe5a1fa0 100644 --- a/msys2-runtime/0026-Disable-the-cygwin-GitHub-workflow.patch +++ b/msys2-runtime/0026-Disable-the-cygwin-GitHub-workflow.patch @@ -31,5 +31,5 @@ index f9a9a7a..4b541a8 100644 jobs: fedora-build: -- -2.37.2 +2.37.3 diff --git a/msys2-runtime/0027-Do-not-show-Error-dialogs-by-default.patch b/msys2-runtime/0027-Do-not-show-Error-dialogs-by-default.patch index 8621c517..076b2961 100644 --- a/msys2-runtime/0027-Do-not-show-Error-dialogs-by-default.patch +++ b/msys2-runtime/0027-Do-not-show-Error-dialogs-by-default.patch @@ -64,5 +64,5 @@ index 4f28335..bc9dc5a 100644 /* We're adding the CREATE_BREAKAWAY_FROM_JOB flag here to workaround -- -2.37.2 +2.37.3 diff --git a/msys2-runtime/0028-Add-a-helper-to-obtain-a-function-s-address-in-kerne.patch b/msys2-runtime/0028-Add-a-helper-to-obtain-a-function-s-address-in-kerne.patch index 9cd22b7d..0bdfedf3 100644 --- a/msys2-runtime/0028-Add-a-helper-to-obtain-a-function-s-address-in-kerne.patch +++ b/msys2-runtime/0028-Add-a-helper-to-obtain-a-function-s-address-in-kerne.patch @@ -381,5 +381,5 @@ index 0000000..25814c7 + return 0; +} -- -2.37.2 +2.37.3 diff --git a/msys2-runtime/0029-Emulate-GenerateConsoleCtrlEvent-upon-Ctrl-C.patch b/msys2-runtime/0029-Emulate-GenerateConsoleCtrlEvent-upon-Ctrl-C.patch index 13e3dbe4..75518e7e 100644 --- a/msys2-runtime/0029-Emulate-GenerateConsoleCtrlEvent-upon-Ctrl-C.patch +++ b/msys2-runtime/0029-Emulate-GenerateConsoleCtrlEvent-upon-Ctrl-C.patch @@ -505,5 +505,5 @@ index 0000000..0486a0c + +#endif -- -2.37.2 +2.37.3 diff --git a/msys2-runtime/0030-kill-kill-Win32-processes-more-gently.patch b/msys2-runtime/0030-kill-kill-Win32-processes-more-gently.patch index 25d7a25e..d7d604c5 100644 --- a/msys2-runtime/0030-kill-kill-Win32-processes-more-gently.patch +++ b/msys2-runtime/0030-kill-kill-Win32-processes-more-gently.patch @@ -50,5 +50,5 @@ index d0fb547..ad718c3 100644 } -- -2.37.2 +2.37.3 diff --git a/msys2-runtime/0031-Cygwin-make-option-for-native-inner-link-handling.patch b/msys2-runtime/0031-Cygwin-make-option-for-native-inner-link-handling.patch index d954d1ac..4413dce9 100644 --- a/msys2-runtime/0031-Cygwin-make-option-for-native-inner-link-handling.patch +++ b/msys2-runtime/0031-Cygwin-make-option-for-native-inner-link-handling.patch @@ -51,5 +51,5 @@ index 9edd949..9a3ad7a 100644 PWCHAR fpbuf = tp.w_get (); DWORD ret; -- -2.37.2 +2.37.3 diff --git a/msys2-runtime/0032-docs-skip-building-texinfo-and-PDF-files.patch b/msys2-runtime/0032-docs-skip-building-texinfo-and-PDF-files.patch index acb24f7a..113bd959 100644 --- a/msys2-runtime/0032-docs-skip-building-texinfo-and-PDF-files.patch +++ b/msys2-runtime/0032-docs-skip-building-texinfo-and-PDF-files.patch @@ -45,5 +45,5 @@ index 534d674..d448ede 100644 uninstall-extra-man: for i in *.1 ; do \ -- -2.37.2 +2.37.3 diff --git a/msys2-runtime/0033-install-libs-depend-on-the-toollibs.patch b/msys2-runtime/0033-install-libs-depend-on-the-toollibs.patch index 9af8c09a..1ac109ef 100644 --- a/msys2-runtime/0033-install-libs-depend-on-the-toollibs.patch +++ b/msys2-runtime/0033-install-libs-depend-on-the-toollibs.patch @@ -27,5 +27,5 @@ index 23a3c23..f1fe01d 100644 $(INSTALL_PROGRAM) $(TEST_DLL_NAME) $(DESTDIR)$(bindir)/$(DLL_NAME) @$(MKDIR_P) $(DESTDIR)$(toollibdir) -- -2.37.2 +2.37.3 diff --git a/msys2-runtime/0034-POSIX-ify-the-SHELL-variable.patch b/msys2-runtime/0034-POSIX-ify-the-SHELL-variable.patch index 5ae828f2..b555fd0a 100644 --- a/msys2-runtime/0034-POSIX-ify-the-SHELL-variable.patch +++ b/msys2-runtime/0034-POSIX-ify-the-SHELL-variable.patch @@ -107,5 +107,5 @@ index 71c3f22..f33740d 100644 const char * get_native () const {return native ? native + namelen : NULL;} const char * get_posix () const {return posix ? posix : NULL;} -- -2.37.2 +2.37.3 diff --git a/msys2-runtime/0035-Handle-ORIGINAL_PATH-just-like-PATH.patch b/msys2-runtime/0035-Handle-ORIGINAL_PATH-just-like-PATH.patch index a36f1307..75e63209 100644 --- a/msys2-runtime/0035-Handle-ORIGINAL_PATH-just-like-PATH.patch +++ b/msys2-runtime/0035-Handle-ORIGINAL_PATH-just-like-PATH.patch @@ -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 diff --git a/msys2-runtime/0036-uname-allow-setting-the-system-name-to-CYGWIN.patch b/msys2-runtime/0036-uname-allow-setting-the-system-name-to-CYGWIN.patch index 5f6cb52e..bbdc98a2 100644 --- a/msys2-runtime/0036-uname-allow-setting-the-system-name-to-CYGWIN.patch +++ b/msys2-runtime/0036-uname-allow-setting-the-system-name-to-CYGWIN.patch @@ -81,5 +81,5 @@ index daed73f..f6a5f88 100644 /* Add a hint to the sysname, that we're running under WOW64. This might give an early clue if somebody encounters problems. */ -- -2.37.2 +2.37.3 diff --git a/msys2-runtime/0037-fixup-Revert-Default-to-disable_pcon.patch b/msys2-runtime/0037-fixup-Revert-Default-to-disable_pcon.patch new file mode 100644 index 00000000..7df11ea2 --- /dev/null +++ b/msys2-runtime/0037-fixup-Revert-Default-to-disable_pcon.patch @@ -0,0 +1,28 @@ +From f5d37650e7077d214ec5895b0175918863172086 Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +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 + diff --git a/msys2-runtime/0038-Pass-environment-variables-with-empty-values.patch b/msys2-runtime/0038-Pass-environment-variables-with-empty-values.patch new file mode 100644 index 00000000..b1a93cf5 --- /dev/null +++ b/msys2-runtime/0038-Pass-environment-variables-with-empty-values.patch @@ -0,0 +1,48 @@ +From 5812c2fb3534a9203cc110cc052fdae730920a3e Mon Sep 17 00:00:00 2001 +From: Johannes Schindelin +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 +--- + 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 + diff --git a/msys2-runtime/0039-Optionally-disallow-empty-environment-values-again.patch b/msys2-runtime/0039-Optionally-disallow-empty-environment-values-again.patch new file mode 100644 index 00000000..668743d1 --- /dev/null +++ b/msys2-runtime/0039-Optionally-disallow-empty-environment-values-again.patch @@ -0,0 +1,60 @@ +From 96283acb9d8fe69bb921ee84c584bc79b1eb262f Mon Sep 17 00:00:00 2001 +From: Johannes Schindelin +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 +--- + 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 + diff --git a/msys2-runtime/0040-build_env-respect-the-MSYS-environment-variable.patch b/msys2-runtime/0040-build_env-respect-the-MSYS-environment-variable.patch new file mode 100644 index 00000000..800012f5 --- /dev/null +++ b/msys2-runtime/0040-build_env-respect-the-MSYS-environment-variable.patch @@ -0,0 +1,37 @@ +From 97c2d7fa8bb424012aad77b8d86f3262a35fab0a Mon Sep 17 00:00:00 2001 +From: Johannes Schindelin +Date: Tue, 6 Sep 2022 12:18:18 +0200 +Subject: [PATCH 40/N] build_env(): respect the `MSYS` environment variable + +With this commit, you can call + + MSYS=noemptyenvvalues my-command + +and it does what is expected: to pass no empty-valued environment +variables to `my-command`. + +Signed-off-by: Johannes Schindelin +--- + winsup/cygwin/environ.cc | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/winsup/cygwin/environ.cc b/winsup/cygwin/environ.cc +index 128f34d..b431d3c 100644 +--- a/winsup/cygwin/environ.cc ++++ b/winsup/cygwin/environ.cc +@@ -1217,7 +1217,11 @@ build_env (const char * const *envp, PWCHAR &envblock, int &envc, + { + bool calc_tl = !no_envblock; + #ifdef __MSYS__ +- if (!keep_posix) ++ if (ascii_strncasematch(*srcp, "MSYS=", 5)) ++ { ++ parse_options (*srcp + 5); ++ } ++ else if (!keep_posix) + { + /* Don't pass timezone environment to non-msys applications */ + if (ascii_strncasematch(*srcp, "TZ=", 3)) +-- +2.37.3 + diff --git a/msys2-runtime/PKGBUILD b/msys2-runtime/PKGBUILD index e57a6a21..25ff8af5 100644 --- a/msys2-runtime/PKGBUILD +++ b/msys2-runtime/PKGBUILD @@ -60,44 +60,52 @@ source=('msys2-runtime'::git://sourceware.org/git/newlib-cygwin.git#tag=cygwin-$ 0033-install-libs-depend-on-the-toollibs.patch 0034-POSIX-ify-the-SHELL-variable.patch 0035-Handle-ORIGINAL_PATH-just-like-PATH.patch - 0036-uname-allow-setting-the-system-name-to-CYGWIN.patch) + 0036-uname-allow-setting-the-system-name-to-CYGWIN.patch + 0037-fixup-Revert-Default-to-disable_pcon.patch + 0038-Pass-environment-variables-with-empty-values.patch + 0039-Optionally-disallow-empty-environment-values-again.patch + 0040-build_env-respect-the-MSYS-environment-variable.patch) sha256sums=('SKIP' - 'b14865a15e636777f42d8dbb15f53958e0ce107c173a93ded0a6179129c88593' - 'ff1fd15319481bd30aa02d649a48ac85bc38336521651310d3844b28ae7a11a2' - 'bd824e732658781e8c6e13d9fefd29d8c7a8b3a86c51674345319873fee00669' - 'fe00bb630da51379dd8c1616daa3bc31ef2dd17c6163aa6ac850bceb17589206' - '81d2ac6e31f3f7864adbeb40a6f2a8328e185258718888c7adc4e83589881dcf' - '4a8da1952202dd03ea487e81c23731c7eb889ba1c66d776b85f1d81d81017f8d' - '567c3cb2ff35b50836623ac1f60b5b3357d6664f58dc7a95f6ee84a8d7d7e5bc' - '649685260b22d2b812653887bde1e38b3a61a1b3f04e362e79784d03c073b250' - '64dd11dfb6be339fff473b7b9695b9655862e15f0d77ff61a50f64d96ba8e7c7' - '3fc02c70e8610743fef7256bc851b2c095f123a957c54b93d37f944810fa69c4' - 'b98b183a1685c17b07f78b37ae210305b1bf845be7bb8876735df7664f5121a4' - '3d19fd6c37f56ac7399734d77091a64af3ef368668c81e449b8d6c4688cb72c2' - '937ccfcd22a4edfcc2c631c29fb2580823b842a3070627a08050b596c044c77a' - 'ff9e16c0d44d40479184b1eb9c39c0b74453a362e05f9f59b493ab2b69882fd6' - '6e4212ff3838ff8d724e51194c7971eaae9d4e80e2d4ee86701e61f4db1d8410' - '596c03df58fc7c34d3a4eab5537f155966a852918fc47301154eef181afd55ef' - '41c99b4a7d7d34902092c1aac842827c8fdce13113b6acd07660bf99fd93e94c' - 'cae6a52b79ad8d38c267b75d0f050178c76e4ca1ec203f4eb61eacc74c6bc5bd' - 'ecbd43e0d3c23a5d13eb93368a53366de935742c274f313a3a9b52bf6554e9f5' - '7c9a68e32cc9576598b12868b5a0b7d02799bc154a4d210d48df0793528e6dde' - '66eb6e750a6257207801712256d94e92cda003d8f1a01d04b7aa0bee29657b83' - '536f2cb2b60cd405c15fe3a5fb1f637d4b041f912c29980248b6b0b872afff39' - '4b3e8e44e2c0367708cc00982ed81483b6e4ec0d83344d6131052612a46b47c1' - '2fc51a29bac814b93d5f430e57167366027f6d44bc586932e0c0c9b59403c21f' - 'b8d11bda24bea40ec2f0acacb55257799972a66ad2250e534662acb0648e0707' - '2cf096a37d247fefbc08201b36c824d643d6bd17062296d40650813406c15d26' - '91cc47baebd02d9d580c786e64efe763dd4da8e396e544c0dc5c23582050d59d' - '78e8acd88eb23ca09aed27ad08009bca8472735471c8d3144804484e6dba379b' - 'f41f87dc7df81655877cfa4928f6988ee65093c73e6a9dced9074b691083d590' - 'a57c21fcd6dd5f53f2989f936c69970ddf72d09a56018b5e610a8dda1c09741b' - '2056e328fee4be7768f6e0b9a42f138d2246c6484aab8c97c4a5a4e082df9ca2' - '10cf07b133c48e13fe44adaab56727f4dd7baf4872408cbf563dcb4ecc917396' - 'da9c76dac9b67db9ceaa9d6e44ab2d0c3046a355755ea1b010e8f36c3369b909' - '4c81116196554f8d57ff34cdb3ebf9acc28b3ba7007d28722e8a5b5cd41db584' - '85108c25aba80456ae160e946cbe495d650e706373c7a80b0c318096fb13a6a3' - 'acc88ef9eea5e8e0d818adf2ad440c6aa5f3862e8cd35ea3b98b0a51b7840d3e') + '8e26c673b763366a085eada2250bfcaf182d1f357eb23a62c57a20fe8a0346f3' + 'c4cc134ab6fa1c17b5ee428c8604861f1a4580ac14aef25740da8597de84800e' + 'f30d275031db52430c7ddef7ed1e54eb8d934251b11c812725d32d1ba380a3e9' + '09effb95abc166cde9c3a3d7f9aa1bd53c1161c3706c6c5e85c29802dfe7fe63' + '7208bf2dffe1c27f9a8ff63e24ee3b4f9e7448aef8a5bd6f014b50b63bb49bae' + 'c0c833ee0f038fcb29d56a49df62278d0e489ca85e6e4ca8b7ae6600c7bc69a3' + '99e2e82848a9c4e56f75bec6d016f8d38869373f9c809029ed2179eef5efe033' + 'bd6174a58ebe88c29421f23ccfaee157e4fa18a4b497e2d391875b2507875a63' + '2d36efb8c2355c8d6eb4652cea2abcf7b5cec1e8931dc33d90dc7ee0ca69e1df' + '92e8553378e380b8db643d7ca3604b84b13a0dba38263d6aca33169bcf62214c' + 'a6cd762892edd38bf8c62b513fe3be1c8bdcfdabe5596814185dbf37c40cdec3' + '1b0bd86c9d9d489d00396ab259f0a5fd6489aef24c47ba51c1ba85b0d23e0765' + '337674665b7bfd58a80766d5d7d91390796ac2f4426db9cc071e00e3914e29d5' + '779949b0f9143b68733ec7fe0f01f2eaea8e589df5fd1dd2fe4fc9046ff73b18' + '15236a2889c68d6f97dde91059fb725c855c3085f89ca8735d82a5727c8e05c1' + '1bf0f0f554c57e3d75fd936eb6e1a0dbffe192e91164ffe16ba0e95da6298326' + 'd0d704e9c8163c8bd731aab8785396d64262a16580e219426052895f63929187' + '35948eb27c4eec64f986eea4689963af547dba4c8722d2c97607a2164a9bb78c' + '324e313839c4d78e1a2bb8e37eee143f9ba3bf8f8e6c97c09f20fc945503734b' + 'ddcb985482a8409227252e95e790ce3de3c256d18af29fa8bb3e1887fbeee585' + '535dbc7eae11e9cc5307b7023e967824ce187ab981e31663af289107cfc9757e' + 'a35032b628032deadad31fde7c7dd04c3a28f15095fb10a31f26e0f489f35d69' + '3f43a8ae895f0100399b198ad66897ae59d74da7c2e8ceba0fc6d82582d4ba34' + '5680983a9ac7943800aec6b1504cd0c7300d9590d3e0321a9fd2091005595aa7' + 'd33334697d2b345e9cd54e8a879aef497d5f699ed194072123fed7268a7155a7' + 'a0b5a0d39b7585885b52d8df3522ab7bf9a4b831f7e64a4ce4842135b363124b' + '52e924fe006400dbe2def51ac04a09173a6e0fabaa6417b43f5114bc35e28ca1' + 'fc0605ba52e4091081063a98f7757110d2f353027d2e146960531299d2c3b3bc' + '3dc45ac3b3bf2b32bb7e17639e3dd8ed599bad636c9883aa0fa77dfa79471432' + '4c340f2b767833a11b0b57d33780f6150bba231946f2cece334dbb46475499a6' + '835ac7031ff00e4a70bb2b7e5a4e4c75dc8c449b4d8095fc59dada42068fb380' + 'd19dee1e9255789387a4d79d1f6f469adb8d0cb3424c6469049c917df589b0a6' + '4631a6186534f7b9abbd5685f858cffc40634df540cb7db5f3102bf7e6f6dfc6' + 'ba34f8b5bc39e273a5e594ba3f893367359fb72ed5fe8f9ed80d03a7702041c9' + '8ebe2924fd3bfcc5fe51e731ddb29b800f0f49c7776ce2af084300888cb966c2' + '90f482551aa593215c0eb574863f5d6f492b0cca63469a8c80eaae72b82dee74' + 'f4641a5c4c9571362ef7dc855d3340cb9bf7fe512a2042e92e6b8e3f93a5293f' + '57d4380abbd5536dacb9efea24749756af31c6926473f78a62681d65b431b3a9' + 'c4d5ad6a5960b735ddd900445dc2c3428c1d1cea1454150a8b8b77ff09c42dc9' + 'd12ae4e081ef49e5f00579baf45d9c3e245ed1c3542ea988f81ac38b5f00c71d') # Helper macros to help make tasks easier # apply_patch_with_msg() { @@ -170,7 +178,11 @@ prepare() { 0033-install-libs-depend-on-the-toollibs.patch \ 0034-POSIX-ify-the-SHELL-variable.patch \ 0035-Handle-ORIGINAL_PATH-just-like-PATH.patch \ - 0036-uname-allow-setting-the-system-name-to-CYGWIN.patch + 0036-uname-allow-setting-the-system-name-to-CYGWIN.patch \ + 0037-fixup-Revert-Default-to-disable_pcon.patch \ + 0038-Pass-environment-variables-with-empty-values.patch \ + 0039-Optionally-disallow-empty-environment-values-again.patch \ + 0040-build_env-respect-the-MSYS-environment-variable.patch } build() {