Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8226521

Detect WSL2 as WSL in configure

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 14
    • Fix Version/s: 14
    • Component/s: infrastructure
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b03
    • OS:
      windows

      Description

      From Andrew Luo on build-dev:

      Hi Everyone,

      Now that a preview of WSL2 is available for testing (https://devblogs.microsoft.com/commandline/wsl-2-is-now-available-in-windows-insiders/), I decided to experiment a little bit and tried compiling OpenJDK with WSL2. To correctly detect WSL2, however, I had to make a minor change in config.guess to account for that fact that "Microsoft" in the output of "uname -r" has changed to lowercase:

      WSL1: 4.4.0-17763-Microsoft
      WSL2: 4.19.43-microsoft-standard

      Patch is inline. One thing to note, however, is that WSL2 does not fully work yet due to a bug. I have investigated the issue and filed the bug with Microsoft (https://github.com/microsoft/WSL/issues/4161).

      Thanks,

      -Andrew

      diff -r 5eeee2cc94f5 make/autoconf/build-aux/config.guess
      --- a/make/autoconf/build-aux/config.guess Fri Jun 14 20:30:10 2019 -0700
      +++ b/make/autoconf/build-aux/config.guess Mon Jun 17 23:14:56 2019 -0700
      @@ -63,7 +63,7 @@
      # Test and fix wsl
      echo $OUT | grep x86_64-unknown-linux-gnu > /dev/null 2> /dev/null
      if test $? = 0; then
      - uname -r | grep Microsoft > /dev/null 2> /dev/null
      + uname -r | grep -i microsoft > /dev/null 2> /dev/null
         if test $? = 0; then
           OUT="x86_64-pc-wsl"
         fi

        Attachments

          Activity

            People

            Assignee:
            erikj Erik Joelsson
            Reporter:
            erikj Erik Joelsson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: