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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 11
    • 10, 11
    • infrastructure
    • None
    • b09
    • windows

      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.

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

              Created:
              Updated:
              Resolved: