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

AOT's Linker.java seems to eagerly fail-fast on Windows.

XMLWordPrintable

    • b06
    • generic
    • windows

        jtreg by design curates the environment variables exposed to the test subject and if devkit is not used all of AOT regression tests will fail.

        I encountered this on JDK11.08, but this issue exists in the latest release.

        The reason is as follows:
        1. Consider this:
        https://hg.openjdk.java.net/jdk-updates/jdk11u/file/030bc020dc04/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/Linker.java#l203

        The logic tries to get the environment variable as follows:

        String programFilesX86 = System.getenv("ProgramFiles(x86)”);
        And Linker.java will keel over if “ProgramFiles(x86)” is not present.

        2. The next failure is here:
        https://hg.openjdk.java.net/jdk-updates/jdk11u/file/030bc020dc04/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/Linker.java#l226
        vswhere.exe will return an empty output when the environment variable “ProgramData” is not defined, essentially vswhere.exe fails silently.

        The above logic seems to fail-fast, if the environment variable “programFilesX86” does not exist, and even if it did and not having ProgramData will cause vswhere.exe will fail silently in which case Linker.java will never find older versions of VisualStudio as enumerated by VSVERSIONS.

              kvn Vladimir Kozlov
              ksrini Kumar Srinivasan
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Created:
                Updated:
                Resolved: