MSYS2 reports cygwin triplet causing bash configure failure

XMLWordPrintable

    • b11
    • windows

        With a recent MSYS2 update, the default value of the MSYSTEM_CHOST environment variable has changed.

        > The $MSYSTEM_CHOST environment variable will now report x86_64-pc-cygwin instead of x86_64-pc-msys

        Source: https://www.msys2.org/news/#2025-06-20-replacing-x86_64-pc-msys-with-x86_64-pc-cygwin

        When setting up the JDK build (bash configure), $MSYSTEM_CHOST is referenced. As a result, even though you are actually trying to build with MSYS, it is mistakenly recognized as a Cygwin environment. This causes the build setup (bash configure) to fail.

        ```
        $ bash configure
        ...
        checking build system type... x86_64-pc-cygwin
        checking host system type... x86_64-pc-cygwin
        checking target system type... x86_64-pc-cygwin
        checking openjdk-build os-cpu... windows-x86_64
        checking openjdk-target os-cpu... windows-x86_64
        checking compilation type... native
        checking Windows environment type... cygwin
        checking cygwin drive prefix... ''
        checking cygwin root directory as Windows path... 'C:\msys64'
        checking cygwin temp directory... MicrosoftWindowsVersion10.0.26200.7462MicrosoftCorporation.Allrightsreserved./c/Users/xxx/dev/tmp/jdk>
        ...
        checking for pacman... /c/Users/xxx/dev/tmp/jdk/build/windows-x86_64-server-release/fixpath: line 3: syntax error near unexpected token (' /c/Users/xxx/dev/tmp/jdk/build/windows-x86_64-server-release/fixpath: line 3: . /c/Users/xxx/dev/tmp/jdk/make/scripts/fixpath.sh -e /usr/bin/cygpath -p NONE -r C:\msys64 -t MicrosoftWindowsVersion10.0.26200.7462MicrosoftCorporation.Allrightsreserved./c/Users/xxx/dev/tmp/jdk> -c /c/Windows/System32/cmd.exe "$@"'
        /c/Users/xxx/dev/tmp/jdk/build/windows-x86_64-server-release/fixpath: line 3: syntax error near unexpected token (' /c/Users/xxx/dev/tmp/jdk/build/windows-x86_64-server-release/fixpath: line 3: . /c/Users/xxx/dev/tmp/jdk/make/scripts/fixpath.sh -e /usr/bin/cygpath -p NONE -r C:\msys64 -t MicrosoftWindowsVersion10.0.26200.7462MicrosoftCorporation.Allrightsreserved./c/Users/xxx/dev/tmp/jdk> -c /c/Windows/System32/cmd.exe "$@"'
        configure: The command for PKGHANDLER, which is given as "/usr/bin/pacman", can not be properly resolved.
        configure: Please see the section "Special Considerations" in building.md.
        configure: This is the error message given by fixpath:
        /c/Users/xxx/dev/tmp/jdk/build/windows-x86_64-server-release/fixpath: line 3: syntax error near unexpected token (' /c/Users/xxx/dev/tmp/jdk/build/windows-x86_64-server-release/fixpath: line 3: . /c/Users/xxx/dev/tmp/jdk/make/scripts/fixpath.sh -e /usr/bin/cygpath -p NONE -r C:\msys64 -t MicrosoftWindowsVersion10.0.26200.7462MicrosoftCorporation.Allrightsreserved./c/Users/xxx/dev/tmp/jdk> -c /c/Windows/System32/cmd.exe "$@"'
        configure: error: Cannot continue
        configure exiting with result code 2
        ```

              Assignee:
              Daishi Tabata
              Reporter:
              Daishi Tabata
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: