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

Rebase to Cygwin v3.5.1 #204

Merged
merged 42 commits into from
Mar 9, 2024
Merged

Conversation

dscho
Copy link
Collaborator

@dscho dscho commented Feb 27, 2024

Range-diff relative to msys2-3.5.0
  • 1: 032b7ea = 1: 466f9bc Add MSYS2 triplet

  • 2: b5b8068 = 2: 29cbc0b Fix msys library name in import libraries

  • 3: a282a19 = 3: d958d21 Rename dll from cygwin to msys

  • 4: fc9b833 = 4: ea53dd6 Add functionality for converting UNIX paths in arguments and environment variables to Windows form for native Win32 applications.

  • 5: a5a0cba = 5: 658607e Add functionality for changing OS name via MSYSTEM environment variables.

  • 6: bc1a633 = 6: a4833b5 - Move root to /usr. - Change sorting mount points. - By default mount without ACLs. - Can read /etc/fstab with short mount point format.

  • 7: 791aadb ! 7: 6881300 Instead of creating Cygwin symlinks, use deep copy by default

    @@ winsup/cygwin/globals.cc: bool ignore_case_with_glob;
     -winsym_t allow_winsymlinks = WSYM_default;
     +winsym_t allow_winsymlinks = WSYM_deepcopy;
      bool disable_pcon;
    + bool winjitdebug = false;
      
    - /* Taken from BSD libc:
     
      ## winsup/cygwin/path.cc ##
     @@ winsup/cygwin/path.cc: conv_path_list (const char *src, char *dst, size_t size,
  • 8: 6424ec5 = 8: 3656007 Automatically rewrite TERM=msys to TERM=cygwin

  • 9: dd68e83 = 9: f6436d4 Do not convert environment for strace

  • 10: df746f8 = 10: 5efcac4 path_conv: special-case root directory to have trailing slash

  • 11: 27a7ee5 = 11: a758d14 dcrt0.cc: Untangle allow_glob from winshell

  • 12: f720850 = 12: 921063a dcrt0.cc (globify): Don't quote literal strings differently when dos_spec

  • 13: cc7f4c3 = 13: 68f682c strace.cc: Don't set MSYS=noglob

  • 14: 6d24e9e = 14: be8f9d0 Add debugging for build_argv

  • 15: d8cb51c = 15: a655c33 Add debugging for strace make_command_line

  • 16: 79cd04c = 16: a2cdd69 environ.cc: New facility/environment variable MSYS2_ENV_CONV_EXCL

  • 17: d1d1fb1 = 17: 759dd9a Fix native symbolic link spawn passing wrong arg0

  • 18: 1add8e7 = 18: 3e03940 strace --quiet: be really quiet

  • 19: b614817 ! 19: 2e9f8f5 Introduce the enable_pcon value for MSYS

    @@ winsup/cygwin/environ.cc: enum settings
        };
      
     @@ winsup/cygwin/environ.cc: static struct parse_thing
    -   {"wincmdln", {&wincmdln}, setbool, NULL, {{false}, {true}}},
    -   {"winsymlinks", {func: set_winsymlinks}, isfunc, NULL, {{0}, {0}}},
    +   } known[] NO_COPY =
    + {
        {"disable_pcon", {&disable_pcon}, setbool, NULL, {{false}, {true}}},
     +  {"enable_pcon", {&disable_pcon}, setnegbool, NULL, {{true}, {false}}},
    -   {NULL, {0}, setdword, 0, {{0}, {0}}}
    - };
    - 
    +   {"error_start", {func: error_start_init}, isfunc, NULL, {{0}, {0}}},
    +   {"export", {&export_settings}, setbool, NULL, {{false}, {true}}},
    +   {"glob", {func: glob_init}, isfunc, NULL, {{0}, {s: "normal"}}},
     @@ winsup/cygwin/environ.cc: parse_options (const char *inbuf)
      		  *k->setting.b = !!strtol (eq, NULL, 0);
      		debug_printf ("%s%s", *k->setting.b ? "" : "no", k->name);
  • 20: ddbc71a = 20: d39ad7c popen: call /usr/bin/sh instead of /bin/sh

  • 21: 8e53ed2 = 21: dee23f4 Disable the 'cygwin' GitHub workflow

  • 22: 52ddcbe = 22: 29fda5b CI: add a GHA for doing a basic build test

  • 23: 192f8a8 = 23: ebc3757 Set up a GitHub Action to keep in sync with Cygwin

  • 24: 38573b5 ! 24: f9f1f42 Expose full command-lines to other Win32 processes by default

    @@ winsup/cygwin/globals.cc: bool allow_glob = true;
     +bool wincmdln = true;
      winsym_t allow_winsymlinks = WSYM_deepcopy;
      bool disable_pcon;
    - 
    + bool winjitdebug = false;
     
      ## winsup/doc/cygwinenv.xml ##
     @@ winsup/doc/cygwinenv.xml: time and when handles are inherited.  Defaults to set.</para>
  • 25: 5d63aaa < -: ---------- Do not show Error dialogs by default

  • 26: cbde0ba = 25: 5b98304 Add a helper to obtain a function's address in kernel32.dll

  • 27: 3671a98 = 26: 35a3691 Emulate GenerateConsoleCtrlEvent() upon Ctrl+C

  • 28: 04ba867 = 27: 27c90ef kill: kill Win32 processes more gently

  • 29: 151bb0b ! 28: 804211f Cygwin: make option for native inner link handling.

    @@ Commit message
     
      ## winsup/cygwin/environ.cc ##
     @@ winsup/cygwin/environ.cc: static struct parse_thing
    -   {"disable_pcon", {&disable_pcon}, setbool, NULL, {{false}, {true}}},
    -   {"enable_pcon", {&disable_pcon}, setnegbool, NULL, {{true}, {false}}},
    -   {"winjitdebug", {&winjitdebug}, setbool, NULL, {{false}, {true}}},
    +   {"error_start", {func: error_start_init}, isfunc, NULL, {{0}, {0}}},
    +   {"export", {&export_settings}, setbool, NULL, {{false}, {true}}},
    +   {"glob", {func: glob_init}, isfunc, NULL, {{0}, {s: "normal"}}},
     +  {"nativeinnerlinks", {&nativeinnerlinks}, setbool, NULL, {{false}, {true}}},
    -   {NULL, {0}, setdword, 0, {{0}, {0}}}
    - };
    - 
    +   {"pipe_byte", {&pipe_byte}, setbool, NULL, {{false}, {true}}},
    +   {"proc_retry", {func: set_proc_retry}, isfunc, NULL, {{0}, {5}}},
    +   {"reset_com", {&reset_com}, setbool, NULL, {{false}, {true}}},
     
      ## winsup/cygwin/globals.cc ##
     @@ winsup/cygwin/globals.cc: bool wincmdln = true;
  • 30: 680d9d7 = 29: 1300003 docs: skip building texinfo and PDF files

  • 31: 745587f = 30: 9884b64 install-libs: depend on the "toollibs"

  • 32: 23dbe3a = 31: c90f0a9 POSIX-ify the SHELL variable

  • 33: 678f413 = 32: 4f0efbc Handle ORIGINAL_PATH just like PATH

  • 34: a7b2f4c = 33: 87bfb45 uname: allow setting the system name to CYGWIN

  • 35: d10a450 = 34: b0fa877 Pass environment variables with empty values

  • 36: 9cdf657 ! 35: 1262844 Optionally disallow empty environment values again

    @@ winsup/cygwin/environ.cc: static char **lastenviron;
      enum settings
        {
     @@ winsup/cygwin/environ.cc: static struct parse_thing
    -   {"enable_pcon", {&disable_pcon}, setnegbool, NULL, {{true}, {false}}},
    -   {"winjitdebug", {&winjitdebug}, setbool, NULL, {{false}, {true}}},
    -   {"nativeinnerlinks", {&nativeinnerlinks}, setbool, NULL, {{false}, {true}}},
    +   } known[] NO_COPY =
    + {
    +   {"disable_pcon", {&disable_pcon}, setbool, NULL, {{false}, {true}}},
     +  {"emptyenvvalues", {&emptyenvvalues}, setbool, NULL, {{false}, {true}}},
    -   {NULL, {0}, setdword, 0, {{0}, {0}}}
    - };
    - 
    +   {"enable_pcon", {&disable_pcon}, setnegbool, NULL, {{true}, {false}}},
    +   {"error_start", {func: error_start_init}, isfunc, NULL, {{0}, {0}}},
    +   {"export", {&export_settings}, setbool, NULL, {{false}, {true}}},
     @@ winsup/cygwin/environ.cc: 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
  • 37: 8f9faea = 36: 4a9db81 build_env(): respect the MSYS environment variable

  • 38: 3bd47a4 = 37: c7908f7 When converting to a Unix path, avoid double trailing slashes

  • 39: e0e8cae = 38: 8b63bbd msys2_path_conv: pass PC_NOFULL to path_conv

  • 40: 2a46fef = 39: 5b4115a Revert "Cygwin: Enable dynamicbase on the Cygwin DLL by default"

  • 41: 06562dd < -: ---------- dumper: avoid linker problem when libbfd depends on libsframe

  • 42: cb63660 = 40: 6ac0ba6 CI: fix the build with gcc 13

  • 43: e75096f = 41: 4762c71 path-conversion: Introduce ability to switch off conversion.

  • 44: 42e2445 = 42: cbe0932 proc: fix error: the address of ΓÇÿiso15924ΓÇÖ will never be NULL

  • 45: 2ba3c86 < -: ---------- Cygwin: console: Fix exit code for non-cygwin process.

  • 46: ef39371 < -: ---------- Work around fragile #include in binutils

  • 47: ec35e8a < -: ---------- Cygwin: console: Avoid slipping past disable_master_thread check.

  • 48: c73fabb < -: ---------- Cygwin: pty: Fix handle leak in master process.

  • 49: 41499b1 < -: ---------- Cygwin: pty: Fix potential handle leak regarding CallNamedPipe().

  • 50: 51aae37 < -: ---------- Cygwin: console: Make VMIN and VTIME work.

  • 51: 711907e < -: ---------- Cygwin: console: Fix a problem that minor ID is incorrect in ConEmu.

The "deleted" patches can be explained by quite a couple of backports as well as upstreamed patches or patches that were implemented independently by Cygwin.

"Do not show Error dialogs by default" (upstreamed)

* 1:  5d63aaac8b ! 1:  6d6e1e354d Do not show Error dialogs by default

``````diff
@@ Metadata
 Author: Johannes Schindelin <johannes.schindelin@gmx.de>
 
  ## Commit message ##
-    Do not show Error dialogs by default
+    Cygwin: Do not show Error dialogs by default
+
+    ...in a non-Cygwin child process.  Backported from MSYS2.
+    Downstream commit message follows.
 
     In https://github.com/msys2/msys2-runtime/pull/18, we discussed a change
     that would allow default Windows error handling of spawned processes to
@@ Commit message
     variable `MSYS`) at long last.
 
     Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
+    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
 
  ## winsup/cygwin/environ.cc ##
 @@ winsup/cygwin/environ.cc: static struct parse_thing
+   {"wincmdln", {&wincmdln}, setbool, NULL, {{false}, {true}}},
    {"winsymlinks", {func: set_winsymlinks}, isfunc, NULL, {{0}, {0}}},
    {"disable_pcon", {&disable_pcon}, setbool, NULL, {{false}, {true}}},
-   {"enable_pcon", {&disable_pcon}, setnegbool, NULL, {{true}, {false}}},
 +  {"winjitdebug", {&winjitdebug}, setbool, NULL, {{false}, {true}}},
    {NULL, {0}, setdword, 0, {{0}, {0}}}
  };
@@ winsup/cygwin/environ.cc: static struct parse_thing
 
  ## winsup/cygwin/globals.cc ##
 @@ winsup/cygwin/globals.cc: bool reset_com;
- bool wincmdln = true;
- winsym_t allow_winsymlinks = WSYM_deepcopy;
+ bool wincmdln;
+ winsym_t allow_winsymlinks = WSYM_default;
  bool disable_pcon;
 +bool winjitdebug = false;
  
"dumper: avoid linker problem when `libbfd` depends on `libsframe`" (done _very_ differently)
  • 1: 06562dd ! 1: 1387ea9 dumper: avoid linker problem when libbfd depends on libsframe

    @@
      ## Metadata ##
    -Author: Johannes Schindelin <johannes.schindelin@gmx.de>
    +Author: Jon Turney <jon.turney@dronecode.org.uk>
     
      ## Commit message ##
    -    dumper: avoid linker problem when `libbfd` depends on `libsframe`
    +    Cygwin: dumper: also link with libzstd, as libbfd may require it
     
    -    A recent binutils version introduced `libsframe` and made it a
    -    dependency of `libbfd`. This caused a linker problem in the MSYS2
    -    project, and once Cygwin upgrades to that binutils version it would
    -    cause the same problems there.
    +    Also allow that linkage to be dynamic, as libzstd-devel doesn't
    +    currently provide a static library.
     
    -    Let's preemptively detect the presence of `libsframe` and if detected,
    -    link to it in addition to `libbfd`.
    + ## .appveyor.yml ##
    +@@ .appveyor.yml: patch,\
    + cocom,\
    + gettext-devel,\
    + libiconv-devel,\
    ++libzstd-devel,\
    + zlib-devel,\
    + %PKGARCH%-gcc-core,\
    + %PKGARCH%-gcc-g++,\
     
    -    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    + ## .github/workflows/cygwin.yml ##
    +@@ .github/workflows/cygwin.yml: jobs:
    +           gettext-devel,
    +           libiconv,
    +           libiconv-devel,
    ++          libzstd-devel,
    +           make,
    +           mingw64-${{ matrix.pkgarch }}-gcc-g++,
    +           mingw64-${{ matrix.pkgarch }}-zlib,
     
      ## winsup/configure.ac ##
    -@@ winsup/configure.ac: AC_CHECK_LIB([sframe], [sframe_decode], [BFD_LIBS="${BFD_LIBS} -lsframe"])
    - AC_CHECK_LIB([zstd], [ZSTD_isError], [BFD_LIBS="${BFD_LIBS} -lzstd"])
    - AC_SUBST([BFD_LIBS])
    +@@ winsup/configure.ac: AC_ARG_ENABLE([dumper],
    + 
    + AM_CONDITIONAL(BUILD_DUMPER, [test "x$build_dumper" = "xyes"])
    + 
    +-AC_CHECK_LIB([sframe], [sframe_decode],
    +-	     AC_MSG_NOTICE([Detected libsframe; Assuming that libbfd depends on it]), [true])
    +-
    +-AM_CONDITIONAL(HAVE_LIBSFRAME, [test "x$ac_cv_lib_sframe_sframe_decode" = "xyes"])
    ++# libbfd.a doesn't have a pkgconfig file, so we guess what it's dependencies
    ++# are, based on what's present in the build environment
    ++BFD_LIBS="-lintl -liconv -liberty -lz"
    ++AC_CHECK_LIB([sframe], [sframe_decode], [BFD_LIBS="${BFD_LIBS} -lsframe"])
    ++AC_CHECK_LIB([zstd], [ZSTD_isError], [BFD_LIBS="${BFD_LIBS} -lzstd"])
    ++AC_SUBST([BFD_LIBS])
      
    -+AC_CHECK_LIB([sframe], [sframe_decode],
    -+	     AC_MSG_NOTICE([Detected libsframe; Assuming that libbfd depends on it]), [true])
    -+
    -+AM_CONDITIONAL(HAVE_LIBSFRAME, [test "x$ac_cv_lib_sframe_sframe_decode" = "xyes"])
    -+
      AC_CONFIG_FILES([
          Makefile
    -     cygwin/Makefile
    +
    + ## winsup/doc/faq-programming.xml ##
    +@@ winsup/doc/faq-programming.xml: installed; you at least need <literal>gcc-g++</literal>,
    + 
    + <para>
    + Additionally, building the <code>dumper</code> utility requires
    +-<literal>gettext-devel</literal>, <literal>libiconv-devel</literal>
    ++<literal>gettext-devel</literal>, <literal>libiconv-devel</literal>, <literal>libzstd-devel</literal> and
    + <literal>zlib-devel</literal>.  Building this program can be disabled with the
    + <literal>--disable-dumper</literal> option to <literal>configure</literal>.
    + </para>
     
      ## winsup/utils/Makefile.am ##
    +@@ winsup/utils/Makefile.am: LDADD = -lnetapi32
    + cygpath_CXXFLAGS = -fno-threadsafe-statics $(AM_CXXFLAGS)
    + cygpath_LDADD = $(LDADD) -luserenv -lntdll
    + dumper_CXXFLAGS = -I$(top_srcdir)/../include $(AM_CXXFLAGS)
    +-dumper_LDADD = $(LDADD) -lpsapi -lbfd -lintl -liconv -liberty -lz -lntdll
    ++dumper_LDADD = $(LDADD) -lpsapi -lntdll -lbfd @BFD_LIBS@
    ++dumper_LDFLAGS =
    + ldd_LDADD = $(LDADD) -lpsapi -lntdll
    + mount_CXXFLAGS = -DFSTAB_ONLY $(AM_CXXFLAGS)
    + minidumper_LDADD = $(LDADD) -ldbghelp
     @@ winsup/utils/Makefile.am: profiler_LDADD = $(LDADD) -lntdll
      cygps_LDADD = $(LDADD) -lpsapi -lntdll
      newgrp_LDADD = $(LDADD) -luserenv
      
    -+if HAVE_LIBSFRAME
    -+dumper_LDADD += -lsframe
    -+endif
    -+
    +-if HAVE_LIBSFRAME
    +-dumper_LDADD += -lsframe
    +-endif
    +-
      if CROSS_BOOTSTRAP
      SUBDIRS = mingw
      endif
"Cygwin: console: Fix exit code for non-cygwin process." (was a backport)
  • 1: 2ba3c86 ! 1: aa73e11 Cygwin: console: Fix exit code for non-cygwin process.

    @@ Commit message
         Fixes: 3721a756b0d8 ("Cygwin: console: Make the console accessible from other terminals.")
         Reported-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
         Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
    -    Backported-from: aa73e11524 (Cygwin: console: Fix exit code for non-cygwin process., 2024-02-02)
    -    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
     
      ## winsup/cygwin/fhandler/console.cc ##
     @@ winsup/cygwin/fhandler/console.cc: fhandler_console::need_console_handler ()
"Work around fragile `#include` in binutils" (done independently, and very differently)
  • 1: ef39371 ! 1: a85f1c3 Work around fragile #include in binutils

    @@
      ## Metadata ##
    -Author: Johannes Schindelin <johannes.schindelin@gmx.de>
    +Author: Corinna Vinschen <corinna@vinschen.de>
     
      ## Commit message ##
    -    Work around fragile `#include` in binutils
    +    include/ansidecl.h: import from binutils-gdb
     
    -    The `bfd.h` header file that is included in `binutils` has the line
    -    `#include "ansidecl.h"`, which is fragile because it prefers Cygwin's
    -    `include/ansidecl.h` (as opposed to `#include <ansidecl.h>`, which would
    -    only look in the system include paths).
    +    Import include/ansidecl.h version from 2024-01-04,
    +    binutils-gdb commit fd67aa1129fd.
     
    -    This matters because as of v2.42, `bfd.h` also makes use of the
    -    `ATTRIBUTE_WARN_UNUSED_RESULT` macro.
    -
    -    So let's just copy that macro (and while at it, the other `ATTRIBUTE_*`
    -    macros) from binutils' `ansidecl.h` file, to avoid compile errors while
    -    compiling `dumper.o` that look like this:
    -
    -      /usr/include/bfd.h:2770:1: error: expected initializer before ΓÇÿATTRIBUTE_WARN_UNUSED_RESULTΓÇÖ
    -       2770 | ATTRIBUTE_WARN_UNUSED_RESULT;
    -            | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
    -
    -    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    +    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
    +    (cherry picked from commit 10c8c1cf4f94ed42c59015d7e972269724c451bf)
     
      ## include/ansidecl.h ##
    +@@
    +-/* ANSI and traditional C compatability macros
    +-   Copyright (C) 1991-2015 Free Software Foundation, Inc.
    ++/* Compiler compatibility macros
    ++   Copyright (C) 1991-2024 Free Software Foundation, Inc.
    +    This file is part of the GNU C Library.
    + 
    + This program is free software; you can redistribute it and/or modify
    +@@ include/ansidecl.h: You should have received a copy of the GNU General Public License
    + along with this program; if not, write to the Free Software
    + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
    + 
    +-/* ANSI and traditional C compatibility macros
    +-
    +-   ANSI C is assumed if __STDC__ is #defined.
    +-
    +-   Macro		ANSI C definition	Traditional C definition
    +-   -----		---- - ----------	----------- - ----------
    +-   PTR			`void *'		`char *'
    +-   const		not defined		`'
    +-   volatile		not defined		`'
    +-   signed		not defined		`'
    +-
    +-   For ease of writing code which uses GCC extensions but needs to be
    ++/* For ease of writing code which uses GCC extensions but needs to be
    +    portable to other compilers, we provide the GCC_VERSION macro that
    +    simplifies testing __GNUC__ and __GNUC_MINOR__ together, and various
    +    wrappers around __attribute__.  Also, __extension__ will be #defined
    +@@ include/ansidecl.h: So instead we use the macro below and test it against specific values.  */
    + #define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
    + #endif /* GCC_VERSION */
    + 
    +-#if defined (__STDC__) || defined(__cplusplus) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(_WIN32)
    +-/* All known AIX compilers implement these things (but don't always
    +-   define __STDC__).  The RISC/OS MIPS compiler defines these things
    +-   in SVR4 mode, but does not define __STDC__.  */
    +-/* eraxxon@alumni.rice.edu: The Compaq C++ compiler, unlike many other
    +-   C++ compilers, does not define __STDC__, though it acts as if this
    +-   was so. (Verified versions: 5.7, 6.2, 6.3, 6.5) */
    +-
    +-#define PTR		void *
    +-
    +-#undef const
    +-#undef volatile
    +-#undef signed
    +-
    + /* inline requires special treatment; it's in C99, and GCC >=2.7 supports
    +    it too, but it's not in C89.  */
    + #undef inline
    +-#if __STDC_VERSION__ >= 199901L || defined(__cplusplus) || (defined(__SUNPRO_C) && defined(__C99FEATURES__))
    ++#if (!defined(__cplusplus) && __STDC_VERSION__ >= 199901L) || defined(__cplusplus) || (defined(__SUNPRO_C) && defined(__C99FEATURES__))
    + /* it's a keyword */
    + #else
    + # if GCC_VERSION >= 2007
    +@@ include/ansidecl.h: So instead we use the macro below and test it against specific values.  */
    + # endif
    + #endif
    + 
    +-#else	/* Not ANSI C.  */
    +-
    +-#define PTR		char *
    +-
    +-/* some systems define these in header files for non-ansi mode */
    +-#undef const
    +-#undef volatile
    +-#undef signed
    +-#undef inline
    +-#define const
    +-#define volatile
    +-#define signed
    +-#define inline
    +-
    +-#endif	/* ANSI C.  */
    +-
    + /* Define macros for some gcc attributes.  This permits us to use the
    +    macros freely, and know that they will come into play for the
    +    version of gcc in which they are supported.  */
    +@@ include/ansidecl.h: So instead we use the macro below and test it against specific values.  */
    + # endif /* GNUC >= 3.0 */
    + #endif /* ATTRIBUTE_ALIGNED_ALIGNOF */
    + 
    +-/* Useful for structures whose layout must much some binary specification
    ++/* Useful for structures whose layout must match some binary specification
    +    regardless of the alignment and padding qualities of the compiler.  */
    + #ifndef ATTRIBUTE_PACKED
    + # define ATTRIBUTE_PACKED __attribute__ ((packed))
     @@ include/ansidecl.h: So instead we use the macro below and test it against specific values.  */
      # endif /* GNUC >= 4.9 */
      #endif /* ATTRIBUTE_NO_SANITIZE_UNDEFINED */
    @@ include/ansidecl.h: So instead we use the macro below and test it against specif
      /* We use __extension__ in some places to suppress -pedantic warnings
         about GCC extensions.  This feature didn't work properly before
         gcc 2.8.  */
    +@@ include/ansidecl.h: So instead we use the macro below and test it against specific values.  */
    + #define ENUM_BITFIELD(TYPE) unsigned int
    + #endif
    + 
    +-    /* This is used to mark a class or virtual function as final.  */
    +-#if __cplusplus >= 201103L
    +-#define GCC_FINAL final
    +-#elif GCC_VERSION >= 4007
    +-#define GCC_FINAL __final
    ++#if defined(__cplusplus) && __cpp_constexpr >= 200704
    ++#define CONSTEXPR constexpr
    + #else
    +-#define GCC_FINAL
    ++#define CONSTEXPR
    + #endif
    + 
    ++/* A macro to disable the copy constructor and assignment operator.
    ++   When building with C++11 and above, the methods are explicitly
    ++   deleted, causing a compile-time error if something tries to copy.
    ++   For C++03, this just declares the methods, causing a link-time
    ++   error if the methods end up called (assuming you don't
    ++   define them).  For C++03, for best results, place the macro
    ++   under the private: access specifier, like this,
    ++
    ++   class name_lookup
    ++   {
    ++     private:
    ++       DISABLE_COPY_AND_ASSIGN (name_lookup);
    ++   };
    ++
    ++   so that most attempts at copy are caught at compile-time.  */
    ++
    ++#if defined(__cplusplus) && __cplusplus >= 201103
    ++#define DISABLE_COPY_AND_ASSIGN(TYPE)		\
    ++  TYPE (const TYPE&) = delete;			\
    ++  void operator= (const TYPE &) = delete
    ++  #else
    ++#define DISABLE_COPY_AND_ASSIGN(TYPE)		\
    ++  TYPE (const TYPE&);				\
    ++  void operator= (const TYPE &)
    ++#endif /* __cplusplus >= 201103 */
    ++
    + #ifdef __cplusplus
    + }
    + #endif
"Cygwin: console: Avoid slipping past disable_master_thread check." (was a backport)
  • 1: ec35e8a = 1: 9bcfd06 Cygwin: console: Avoid slipping past disable_master_thread check.
"Cygwin: pty: Fix handle leak in master process." (was a backport)

* 1:  c73fabb33a ! 1:  a6ac7b4138 Cygwin: pty: Fix handle leak in master process.

``````diff
@@ Commit message
     Fixes: 29431fcb5b14 ("Cygwin: pty: Inherit typeahead data between two input pipes.")
     Reported-by: Hakkin Lain
     Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
-    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
 
  ## winsup/cygwin/fhandler/pty.cc ##
 @@ winsup/cygwin/fhandler/pty.cc: fhandler_pty_slave::transfer_input (tty::xfer_dir dir, HANDLE from, tty *ttyp,
@@ winsup/cygwin/fhandler/pty.cc: fhandler_pty_slave::transfer_input (tty::xfer_dir
  
    /* Fix input_available_event which indicates availability in cyg pipe. */
    if (dir == tty::to_nat) /* all data is transfered to nat pipe,
+
+ ## winsup/cygwin/release/3.5.1 ##
+@@ winsup/cygwin/release/3.5.1: Fixes:
+   error mode is now possible by using the new CYGWIN environment variable
+   option "winjitdebug".
+   Addresses: https://cygwin.com/pipermail/cygwin/2024-February/255305.html
++
++- Fix handle leak in pty master which occurs when non-cygwin process
++  is started in pty.
++  Addresses: https://github.com/msys2/msys2-runtime/issues/198
"Cygwin: pty: Fix potential handle leak regarding CallNamedPipe()." (was a backport)
  • 1: 41499b1 ! 1: 73cd80c Cygwin: pty: Fix potential handle leak regarding CallNamedPipe().

    @@ Commit message
         they were not. This causes handle leak potentially.
     
         Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
    -    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
     
      ## winsup/cygwin/fhandler/pty.cc ##
     @@ winsup/cygwin/fhandler/pty.cc: fhandler_pty_slave::open (int flags, mode_t)
"Cygwin: console: Make VMIN and VTIME work." (was a backport)

* 1:  51aae37287 ! 1:  02f7f6543a Cygwin: console: Make VMIN and VTIME work.

``````diff
@@ Commit message
     Previously, VMIN and VTIME did not work at all. This patch fixes that.
 
     Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
-    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
 
  ## winsup/cygwin/fhandler/console.cc ##
 @@ winsup/cygwin/fhandler/console.cc: fhandler_console::read (void *pv, size_t& buflen)
@@ winsup/cygwin/fhandler/console.cc: wait_retry:
  #undef buf
  
    buflen = copied_chars;
+
+ ## winsup/cygwin/release/3.5.1 ##
+@@ winsup/cygwin/release/3.5.1: Fixes:
+ - Fix handle leak in pty master which occurs when non-cygwin process
+   is started in pty.
+   Addresses: https://github.com/msys2/msys2-runtime/issues/198
++
++- Fix the problem that VMIN and VTIME does not work at all in console.
"Cygwin: console: Fix a problem that minor ID is incorrect in ConEmu." (was a backport)
  • 1: 711907e ! 1: 0795afd Cygwin: console: Fix a problem that minor ID is incorrect in ConEmu.

    @@ Commit message
         not enumerated by EnumWindows(). This patch fixes the issue.
     
         Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
    -    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
     
      ## winsup/cygwin/autoload.cc ##
     @@ winsup/cygwin/autoload.cc: LoadDLLfunc (DefWindowProcW, user32)

Alexpux and others added 30 commits February 27, 2024 14:40
Cygwin's speclib doesn't handle dashes or dots. However, we are about to
rename the output file name from `cygwin1.dll` to `msys-2.0.dll`.

Let's preemptively fix up all the import libraries that would link
against `msys_2_0.dll` to correctly link against `msys-2.0.dll` instead.
…ent variables to Windows form for native Win32 applications.
…t without ACLs. - Can read /etc/fstab with short mount point format.
The new `winsymlinks` mode `deepcopy` (which is made the default) lets
calls to `symlink()` create (deep) copies of the source file/directory.

This is necessary because unlike Cygwin, MSYS2 does not try to be its
own little ecosystem that lives its life separate from regular Win32
programs: the latter have _no idea_ about Cygwin-emulated symbolic links
(i.e. system files whose contents start with `!<symlink>\xff\xfe` and
the remainder consists of the NUL-terminated, UTF-16LE-encoded symlink
target).

To support Cygwin-style symlinks, the new mode `sysfile` is introduced.

Co-authored-by: Johannes Schindelin <johannes.schindelin@gmx.de>
With MSys1, it was necessary to set the TERM variable to "msys". To
allow for a smooth transition from MSys1 to MSys2, let's simply handle
TERM=msys as if the user had not specified TERM at all and wanted us to
use our preferred TERM value.
Strace is a Windows program so MSYS2 will convert all arguments and environment vars and that makes debugging msys2 software with strace very tricky.
When converting `/c/` to `C:\`, the trailing slash is actually really
necessary, as `C:` is not an absolute path.

We must be very careful to do this only for root directories, though. If
we kept the trailing slash also for, say, `/y/directory/`, we would run
into the following issue: On FAT file systems, the normalized path is
used to fake inode numbers. As a result, `Y:\directory\` and
`Y:\directory` have different inode numbers!!!

This would result in very non-obvious symptoms. Back when we were too
careless about keeping the trailing slash, it was reported to the Git
for Windows project that the `find` and `rm` commands can error out on
FAT file systems with very confusing "No such file or directory" errors,
for no good reason.

During the original investigation, Vasil Minkov pointed out in
git-for-windows/git#1497 (comment),
that this bug had been fixed in Cygwin as early as 1997... and the bug
was unfortunately reintroduced into early MSYS2 versions.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Otherwise if globbing is allowed and we get called from a
Windows program, build_argv thinks we've been called from
a Cygwin program.
…spec

Reverts 25ba8f3. I can't figure out what
the intention was. I'm sure I'll find out soon enough when everything breaks.

This change means that input of:
  '"C:/test.exe SOME_VAR=\"literal quotes\""'

becomes:
  'C:/test.exe SOME_VAR="literal quotes"'

instead of:
  'C:/test.exe SOME_VAR=\literal quotes\'

.. which is at least consistent with the result for:
  '"no_drive_or_colon SOME_VAR=\"literal quotes\""'

The old result of course resulted in the quoted string being split into
two arguments at the space which is clearly not intended.

I *guess* backslashes in dos paths may have been the issue here?
If so I don't care since we should not use them, ever, esp. not at
the expense of sensible forward-slash-containing input.
Commit message for this code was:

* strace.cc (create_child): Set CYGWIN=noglob when starting new process so that

  Cygwin will leave already-parsed the command line alonw."

I can see no reason for it and it badly breaks the ability to use
strace.exe to investigate calling a Cygwin program from a Windows
program, for example:
strace mingw32-make.exe
.. where mingw32-make.exe finds sh.exe and uses it as the shell.
The reason it badly breaks this use-case is because dcrt0.cc depends
on globbing to happen to parse commandlines from Windows programs;
irrespective of whether they contain any glob patterns or not.

See quoted () comment:
"This must have been run from a Windows shell, so preserve
 quotes for globify to play with later."
Works very much like MSYS2_ARG_CONV_EXCL. In fact it uses the same
function, arg_heuristic_with_exclusions (). Also refactors parsing
the env. variables to use new function, string_split_delimited ().

The env. that is searched through is the merged (POSIX + Windows)
one. It remains to be seen if this should be made an option or not.

This feature was prompted because the R language (Windows exe) calls
bash to run configure.win, which then calls back into R to read its
config variables (LOCAL_SOFT) and when this happens, msys2-runtime
converts R_ARCH from "/x64" to an absolute Windows path and appends
it to another absolute path, R_HOME, forming an invalid path.
The biggest problem with strace spitting out `create_child: ...` despite
being asked to be real quiet is that its output can very well interfere
with scripts' operations.

For example, when running any of Git for Windows' shell scripts with
`GIT_STRACE_COMMANDS=/path/to/logfile` (which is sadly an often needed
debugging technique while trying to address the many MSYS2 issues Git for
Windows faces), any time the output of any command is redirected into a
variable, it will include that `create_child: ...` line, wreaking havoc
with Git's expectations.

So let's just really be quiet when we're asked to be quiet.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
It is simply the negation of `disable_pcon`, i.e. `MSYS=enable_pcon` is
equivalent to `MSYS=nodisable_pcon` (the former is slightly more
intuitive than the latter) and likewise `MSYS=noenable_pcon` is
equivalent to `MSYS=disable_pcon` (here, the latter is definitely more
intuitive than the former).

This is needed because we just demoted the pseudo console feature to be
opt-in instead of opt-out, and it would be awkward to recommend to users
to use "nodisable_pcon"... "nodisable" is not even a verb.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
We mount /usr/bin to /bin, but in a chroot this is broken and we
have no /bin, so try to use the real path.

chroot is used by pacman to run install scripts when called with --root
and this broke programs in install scripts calling popen()
(install-info from texinfo for example)

There are more paths hardcoded to /bin in cygwin which might also be broken
in this scenario, so this maybe should be extended to all of them.
It does not work at all. For example, `rpm -E %fedora` says that there
should be version 33 of rpmsphere at
https://github.com/rpmsphere/noarch/tree/master/r, but there is only
version 32.

Another thing that is broken: Cygwin now assumes that a recent
mingw-w64-headers version is available, but Fedora apparently only
offers v7.0.0, which is definitely too old to accommodate for the
expectation of cygwin/cygwin@c1f7c4d1b6d7.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Build with --disable-dependency-tracking because we only build once
and this saves 3-4 minutes in CI.
This will help us by automating an otherwise tedious task.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
In the Cygwin project, it was decided that the command-line of Cygwin
processes, as shown in the output of `wmic process list`, would suffer
from being truncated to 32k (and is transmitted to the child process via
a different mechanism, anyway), and therefore only the absolute path of
the executable is shown by default.

Users who would like to see the full command-line (even if it is
truncated) are expected to set `CYGWIN=wincmdln` (or, in MSYS2's case,
`MSYS=wincmdln`).

Seeing as MSYS2 tries to integrate much better with the surrounding
Win32 ecosystem than Cygwin, it makes sense to turn this on by default.

Users who wish to suppress it can still set `MSYS=nowincmdln`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
In particular, we are interested in the address of the CtrlRoutine
and the ExitProcess functions. Since kernel32.dll is loaded first thing,
the addresses will be the same for all processes (matching the
CPU architecture, of course).

This will help us with emulating SIGINT properly (by not sending signals
to *all* processes attached to the same Console, as
GenerateConsoleCtrlEvent() would do).

Co-authored-by: Naveen M K <naveen@syrusdark.website>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This patch is heavily inspired by the Git for Windows' strategy in
handling Ctrl+C.

When a process is terminated via TerminateProcess(), it has no chance to
do anything in the way of cleaning up. This is particularly noticeable
when a lengthy Git for Windows process tries to update Git's index file
and leaves behind an index.lock file. Git's idea is to remove the stale
index.lock file in that case, using the signal and atexit handlers
available in Linux. But those signal handlers never run.

Note: this is not an issue for MSYS2 processes because MSYS2 emulates
Unix' signal system accurately, both for the process sending the kill
signal and the process receiving it. Win32 processes do not have such a
signal handler, though, instead MSYS2 shuts them down via
`TerminateProcess()`.

For a while, Git for Windows tried to use a gentler method, described in
the Dr Dobb's article "A Safer Alternative to TerminateProcess()" by
Andrew Tucker (July 1, 1999),
http://www.drdobbs.com/a-safer-alternative-to-terminateprocess/184416547

Essentially, we injected a new thread into the running process that does
nothing else than running the ExitProcess() function.

However, this was still not in line with the way CMD handles Ctrl+C: it
gives processes a chance to do something upon Ctrl+C by calling
SetConsoleCtrlHandler(), and ExitProcess() simply never calls that
handler.

So for a while we tried to handle SIGINT/SIGTERM by attaching to the
console of the command to interrupt, and generating the very same event
as CMD does via GenerateConsoleCtrlEvent().

This method *still* was not correct, though, as it would interrupt
*every* process attached to that Console, not just the process (and its
children) that we wanted to signal. A symptom was that hitting Ctrl+C
while `git log` was shown in the pager would interrupt *the pager*.

The method we settled on is to emulate what GenerateConsoleCtrlEvent()
does, but on a process by process basis: inject a remote thread and call
the (private) function kernel32!CtrlRoutine.

To obtain said function's address, we use the dbghelp API to generate a
stack trace from a handler configured via SetConsoleCtrlHandler() and
triggered via GenerateConsoleCtrlEvent(). To avoid killing each and all
processes attached to the same Console as the MSYS2 runtime, we modify
the cygwin-console-helper to optionally print the address of
kernel32!CtrlRoutine to stdout, and then spawn it with a new Console.

Note that this also opens the door to handling 32-bit process from a
64-bit MSYS2 runtime and vice versa, by letting the MSYS2 runtime look
for the cygwin-console-helper.exe of the "other architecture" in a
specific place (we choose /usr/libexec/, as it seems to be the
convention for helper .exe files that are not intended for public
consumption).

The 32-bit helper implicitly links to libgcc_s_dw2.dll and
libwinpthread-1.dll, so to avoid cluttering /usr/libexec/, we look for
the helped of the "other" architecture in the corresponding mingw32/ or
mingw64/ subdirectory.

Among other bugs, this strategy to handle Ctrl+C fixes the MSYS2 side of
the bug where interrupting `git clone https://...` would send the
spawned-off `git remote-https` process into the background instead of
interrupting it, i.e. the clone would continue and its progress would be
reported mercilessly to the console window without the user being able
to do anything about it (short of firing up the task manager and killing
the appropriate task manually).

Note that this special-handling is only necessary when *MSYS2* handles
the Ctrl+C event, e.g. when interrupting a process started from within
MinTTY or any other non-cmd-based terminal emulator. If the process was
started from within `cmd.exe`'s terminal window, child processes are
already killed appropriately upon Ctrl+C, by `cmd.exe` itself.

Also, we can't trust the processes to end it's subprocesses upon receiving
Ctrl+C. For example, `pip.exe` from `python-pip` doesn't kill the python
it lauches (it tries to but fails), and I noticed that in cmd it kills python
also correctly, which mean we should kill all the process using
`exit_process_tree`.

Co-authored-by: Naveen M K <naveen@syrusdark.website>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This change is the equivalent to the change to the Ctrl+C handling we
just made.

Co-authored-by: Naveen M K <naveen@syrusdark.website>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This code has been causing issues with SUBST and mapped network drives,
so add an option (defaulted to on) which can be used to disable it where
needed.  MSYS=nonativeinnerlinks
The MSYS2 packages lack the infrastructure to build those.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Before symlinking libg.a, we need the symlink source `libmsys-2.0.a`: in
MSYS2, we copy by default (if we were creating Unix-style symlinks, the
target would not have to exist before symlinking, but when copying we do
need the source _right away_).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho and others added 12 commits February 27, 2024 14:41
When calling a non-MSys2 binary, all of the environment is converted from
POSIX to Win32, including the SHELL environment variable. In Git for
Windows, for example, `SHELL=/usr/bin/bash` is converted to
`SHELL=C:\Program Files\Git\usr\bin\bash.exe` when calling the `git.exe`
binary. This is appropriate because non-MSys2 binaries would not handle
POSIX paths correctly.

Under certain circumstances, however, `git.exe` calls an *MSys2* binary in
turn, such as `git config --edit` calling `vim.exe` unless Git is
configured to use another editor specifically.

Now, when this "improved vi" calls shell commands, it uses that $SHELL
variable *without quoting*, resulting in a nasty error:

	C:\Program: No such file or directory

Many other programs behave in the same manner, assuming that $SHELL does
not contain spaces and hence needs no quoting, unfortunately including
some of Git's own scripts.

Therefore let's make sure that $SHELL gets "posified" again when entering
MSys2 programs.

Earlier attempts by Git for Windows contributors claimed that adding
`SHELL` to the `conv_envvars` array does not have the intended effect.
These reports just missed that the `conv_start_chars` array (which makes
the code more performant) needs to be adjusted, too.

Note that we set the `immediate` flag to `true` so that the environment
variable is set immediately by the MSys2 runtime, i.e. not only spawned
processes will see the POSIX-ified `SHELL` variable, but the MSys2 runtime
*itself*, too.

This fixes git-for-windows/git#542,
git-for-windows/git#498, and
git-for-windows/git#468.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
MSYS2 recently introduced that hack where the ORIGINAL_PATH variable is
set to the original PATH value in /etc/profile, unless previously set.
In Git for Windows' default mode, that ORIGINAL_PATH value is the used
to define the PATH variable explicitly.

So far so good.

The problem: when calling from inside an MSYS2 process (such as Bash) a
MINGW executable (such as git.exe) that then calls another MSYS2
executable (such as bash.exe), that latter call will try to re-convert
ORIGINAL_PATH after the previous call converted ORIGINAL_PATH from POSIX
to Windows paths. And this conversion may very well fail, e.g. when the
path list contains mixed semicolons and colons.

So let's just *force* the MSYS2 runtime to handle ORIGINAL_PATH in the
same way as the PATH variable (which conversion works, as we know).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
We are currently trying to move our cygwin build environment closer
to cygwin and some autotools/bash based build systems call "uname -s"
to figure out the OS and in many cases only handle the cygwin case, so
we have to patch them.

With this instead of patching we can set MSYSTEM=CYGWIN and change
uname output that way.

The next step would be to always output CYGWIN in an msys env by default,
but for now this allows us to get rid of all the patches without
affecting users.
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>
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
d6b1ac7 (* 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>
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 <johannes.schindelin@gmx.de>
When calling `cygpath -u C:/msys64/` in an MSYS2 setup that was
installed into `C:/msys64/`, the result should be `/`, not `//`.

Let's ensure that we do not append another trailing slash if the
converted path already ends in a slash.

This fixes msys2#112

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
In theory this doesn't make a difference because posix_to_win32_path()
is only called with rooted/absolute paths, but as pointed out in
msys2#103 PC_NOFULL will preserve
the trailing slash of unix paths (for some reason).

See "cygpath -m /bin/" (preserved) vs "cygpath -am /bin/" (dropped)

One use case where we need to trailing slashes to be preserved is the GCC build
system:
https://github.com/gcc-mirror/gcc/blob/6d82e0fea5f988e829912a/gcc/Makefile.in#L2314

The Makefile appends a slash to the prefixes and the C code doing relocation will
treat the path as a directory if there is a trailing slash. See
msys2/MINGW-packages#14173 for details.

With this change all our MSYS2 path_conv tests pass again.
When calling windows native apps from MSYS2, the runtime tries to
convert commandline arguments by a specific set of rules. This idea was
inherited from the MSys/MinGW project (which is now seemingly stale, yet
must be credited with championing this useful feature, see MinGW wiki
https://web.archive.org/web/20201112005258/http://www.mingw.org/wiki/Posix_path_conversion).

If the user does not want that behavior on a big scale, e.g. inside a
Bash script, with the changes introduced in this commit, the user can
now set the the environment variable `MSYS_NO_PATHCONV` when calling
native windows commands.

This is a feature that has been introduced in Git for Windows via
git-for-windows/msys2-runtime#11 and it predates
support for the `MSYS2_ENV_CONV_EXCL` and `MSYS2_ARG_CONV_EXCL`
environment variables in the MSYS2 runtime; Many users find the
simplicity of `MSYS_NO_PATHCONV` appealing.

So let's teach MSYS2 proper this simple trick that still allows using
the sophisticated `MSYS2_*_CONV_EXCL` facilities but also offers a
convenient catch-all "just don't convert anything" knob.

Signed-off-by: 마누엘 <nalla@hamal.uberspace.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
The `iso15924` variable is not actually a pointer.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho dscho self-assigned this Feb 27, 2024
@dscho dscho marked this pull request as ready for review February 27, 2024 14:19
dscho referenced this pull request Feb 27, 2024
A recent binutils version introduced `libsframe` and made it a
dependency of `libbfd`. This caused a linker problem in the MSYS2
project, and once Cygwin upgrades to that binutils version it would
cause the same problems there.

Let's preemptively detect the presence of `libsframe` and if detected,
link to it in addition to `libbfd`.

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

dscho commented Feb 27, 2024

I validated this manually a bit and also executed Git's test suite on it. I guess we should also add a CI workflow that checks out https://github.com/msys2/msys2-tests and runs those tests?

@lazka
Copy link
Member

lazka commented Feb 27, 2024

lgtm

I validated this manually a bit and also executed Git's test suite on it. I guess we should also add a CI workflow that checks out https://github.com/msys2/msys2-tests and runs those tests?

yes, see #135

@lazka
Copy link
Member

lazka commented Feb 28, 2024

ah, I wasn't reading your question properly, I though you were talking about the internal test suite, sorry.

Adding some integration tests would certainly help I guess.

@dscho
Copy link
Collaborator Author

dscho commented Feb 29, 2024

Adding some integration tests would certainly help I guess.

Yes, I was actually thinking specifically of the path_conv tests in msys2-tests.

But you have a good point: Now that Cygwin is taking care of their testsuite, we would be fools not to follow suit and make it work for MSYS2, too. Confidence building and some such...

I am just unsure whether we should fold this into the rebase to v3.5.1. It might make more sense to get it to work on msys2-3.4.10, and hold off updating to v3.5.1 until that time.

@dscho
Copy link
Collaborator Author

dscho commented Feb 29, 2024

It might make more sense to get it to work on msys2-3.4.10

What am I thinking! Cygwin's test suite isn't working on v3.4.*, is it?

@lazka
Copy link
Member

lazka commented Feb 29, 2024

What am I thinking! Cygwin's test suite isn't working on v3.4.*, is it?

yeah, it was broken in 3.4

With CPython our strategy is to just skip broken tests in CI, so we at least detect regressions in the working ones. Which would be a good start imho, without requiring too much work.

@dscho
Copy link
Collaborator Author

dscho commented Mar 9, 2024

With CPython our strategy is to just skip broken tests in CI, so we at least detect regressions in the working ones. Which would be a good start imho, without requiring too much work.

That makes sense to me!

However, it makes even more sense to me to merge this here PR first, then add the msys2-runtime-3.5 package in MSYS2-packages so tire kickers can have a go at it, and then add a PR to run the tests in CI (disabling whatever is broken in the initial version).

@dscho dscho merged commit cbe0932 into msys2:msys2-3.5.1 Mar 9, 2024
1 check passed
@dscho dscho deleted the tentative/msys2-3.5.1 branch March 9, 2024 22:39
dscho added a commit to dscho/MSYS2-packages that referenced this pull request Mar 9, 2024
After adjusting the `PKGBUILD` to reflect that this package is supposed
to track Cygwin v3.5.x, this commit adjusts the patches accordingly (the
trick was performed by `./update-patches.sh`, of course).

This corresponds to msys2/msys2-runtime#204.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
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.

7 participants