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

Trailing backslash in VS120COMNTOOLS leads to ugly error message when running tests

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 10, 11
    • Fix Version/s: 11
    • Component/s: infrastructure
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b09
    • OS:
      windows

      Description

      When running tests using Make on a (Windows) machine where VS120COMNTOOLS is set an error message is generated.

      /bin/sh: -c: line 0: unexpected EOF while looking for matching `"'
      /bin/sh: -c: line 1: syntax error: unexpected end of file

      The message is generated by this logic in test/TestCommon.gmk:

      ifneq ($(VS120COMNTOOLS), )
        JTREG_BASIC_OPTIONS += -e:VS120COMNTOOLS=$(shell $(GETMIXEDPATH) "$(VS120COMNTOOLS)")
      endif

      The problem is that the VS120COMNTOOLS variable typically looks something like:

      $ echo $VS120COMNTOOLS
      C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\

      Of particular interest is the fact that it has a trailing backslash. When used in the make file that means it will all be expanded to something like:

      JTREG_BASIC_OPTIONS += ... $(shell cygwin -m "c:\<path>\Common7\Tools\")

      When that in turn gets executed the backslash will escape the last double quote which means that the quotes are no longer paired.

        Attachments

          Activity

            People

            Assignee:
            mikael Mikael Vidstedt
            Reporter:
            mikael Mikael Vidstedt
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: