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

build-infra: More precise and correct detection of msvcr*.dll



    • Bug
    • Status: Resolved
    • P3
    • Resolution: Fixed
    • None
    • 8
    • infrastructure
    • b113


      There are several problems with the current code for detecting locating a proper msvcr100.dll on Windows, which is done in TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV in toolchain_windows.m4. This bug regards the proper way to locate it automatically.

      The current logic are searching blindly using "find" and "grep" in the directory pointed to by VCINSTALLDIR. This bad for several reasons:
      1) The find has to traverse the whole VC installation dir, which takes several seconds even on an extremely fast Windows machine. (Find is *slow* on cygwin).
      2) Then, we make some kind of wild "grep" and "head" hunt, which at best is unnessary, and at worst can dig up just about any broken file.
      3) And finally the VCINSTALLDIR is not processed by us, and is thus in the "C:\Program Files\..." format. This causes cygwin warnings, like this:

      checking for msvcr100.dll... cygwin warning:
        MS-DOS style path detected: C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\
        Preferred POSIX equivalent is: /cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0/VC/
        CYGWIN environment variable option "nodosfilewarning" turns off this warning.
        Consult the user's guide for more details about POSIX paths:

      Fortunately, we don't have to do this, since we know *exactly* were to find the file, if it exists.
      It is present in the VS10/VC/redist directory, e.g.
      /cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0//VC/redist/x64/Microsoft.VC100.CRT/
      /cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0//VC/redist/x86/Microsoft.VC100.CRT/

      (Which one depends on if we're building for x86 or x86_64).

      The "/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0//VC" part should be pointed to by $VCINSTALLDIR, however we need to do something like:
      first, to get it in /cygdrive/... format.

      However, this is only true if full VS2010 was installed, and not VS2010 Express, or just the Windows SDK. In that case, the redist directory is missing. If that is the case, the default fallback is to look in $SYSTEMROOT/system32, as is currently being done. There, however, lies only the version that matches the build OS architecture (wrt 32 or 64 bits). If the other one is needed and no full VS2010 is installed, the user *must* point out a user-installed version.




            ihse Magnus Ihse Bursie
            ihse Magnus Ihse Bursie
            0 Vote for this issue
            2 Start watching this issue