> In the MSYS2 environment, the system is currently detected as a Cygwin 
> environment. As a result, the following code is not executed under MSYS2, 
> which in turn breaks the execution of `cmd.exe /c`:
> 
>   if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys2"; then
>     # Must be done prior to calling any commands to avoid mangling of command 
> line
>     export MSYS2_ARG_CONV_EXCL="*"
>   fi
> 
> 
> I considered three possible approaches to fix this issue:
> 1. Modify `basic_windows.m4` so that `MSYS2_ARG_CONV_EXCL="*"` is also set in 
> non‑MSYS2 environments (such as WSL and Cygwin).
> 2. Introduce the following logic early in the `configure` processing and set 
> the environment variable `$MSYSTEM_CHOST` to the MSYS2 value:
> 
> if test "x$MSYSTEM" != "x"; then
>   MSYSTEM_CHOST="x86_64-pc-msys"
> fi
> 
> 3. Add a note to `build.md` (the approach adopted in this PR).
> 
> Approaches 1 and 2 are better in the sense that they do not require any 
> additional steps at build time, but they also have issues.
> With approach 1, the build proceeds as if it were in a Cygwin environment 
> even though it is actually an MSYS2 environment, which could lead to 
> unexpected errors.
> With approach 2, the logic needs to run very early in the configure process 
> (before `PLATFORM_SETUP_OPENJDK_BUILD_AND_TARGET`), and introducing 
> platform‑specific handling at such an early stage is not recommended.
> For these reasons, I chose approach 3.
> 
> One concern I still have is whether this issue also occurs with the ARM 
> version of MSYS2. Unfortunately, I do not have access to an ARM Windows 
> environment and cannot verify this myself. For now, the addition to 
> `build.md` is limited to `x86‑64`.  
> If someone can confirm that the same problem occurs (or does not occur) on 
> the latest ARM version of MSYS2, I will update the documentation accordingly.

Daishi Tabata has updated the pull request incrementally with one additional 
commit since the last revision:

  add a comment

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/29810/files
  - new: https://git.openjdk.org/jdk/pull/29810/files/e24e974d..6794cf1a

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=29810&range=04
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=29810&range=03-04

  Stats: 1 line in 1 file changed: 1 ins; 0 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/29810.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/29810/head:pull/29810

PR: https://git.openjdk.org/jdk/pull/29810

Reply via email to