United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-7098530 tools/javac/javazip/Test.sh can fail on Windows
JDK-7098530 : tools/javac/javazip/Test.sh can fail on Windows

Details
Type:
Bug
Submit Date:
2011-10-06
Status:
Closed
Updated Date:
2012-05-07
Project Name:
JDK
Resolved Date:
2012-04-20
Component:
tools
OS:
windows_xp
Sub-Component:
javac
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:

Related Reports
Backport:

Sub Tasks

Description
Here is an example of the failure:
----------System.out:(9/516)*----------
# create zip/jar files with source code
C:/aurora/sandbox/jdk/bin/jar cf /good.jar -C C:/aurora/sandbox/testbase/tools/javac/javazip/good B.java
java.io.FileNotFoundException: \\good.jar (Access is denied)
	at java.io.FileOutputStream.open(Native Method)
	at java.io.FileOutputStream.<init>(FileOutputStream.java:203)
	at java.io.FileOutputStream.<init>(FileOutputStream.java:95)
	at sun.tools.jar.Main.run(Main.java:190)
	at sun.tools.jar.Main.main(Main.java:1177)
error: unexpected result: command failed
----------System.err:(33/1971)*----------
Usage: cygpath (-d|-m|-u|-w|-t TYPE) [-f FILE] [OPTION]... NAME...
       cygpath [-c HANDLE] 
       cygpath [-ADHOPSW] 
       cygpath [-F ID] 
Convert Unix and Windows format paths, or output system path information

Output type options:
  -d, --dos             print DOS (short) form of NAMEs (C:\\PROGRA~1\\)
  -m, --mixed           like --windows, but with regular slashes (C:/WINNT)
  -M, --mode            report on mode of file (binmode or textmode)
  -u, --unix            (default) print Unix form of NAMEs (/cygdrive/c/winnt)
  -w, --windows         print Windows form of NAMEs (C:\\WINNT)
  -t, --type TYPE       print TYPE form: 'dos', 'mixed', 'unix', or 'windows'
Path conversion options:
  -a, --absolute        output absolute path
  -l, --long-name       print Windows long form of NAMEs (with -w, -m only)
  -p, --path            NAME is a PATH list (i.e., '/bin:/usr/bin')
  -s, --short-name      print DOS (short) form of NAMEs (with -w, -m only)
  -C, --codepage CP     print DOS, Windows, or mixed pathname in Windows
                        codepage CP.  CP can be a numeric codepage identifier,
                        or one of the reserved words ANSI, OEM, or UTF8.
                        If this option is missing, cygpath defaults to the
                        character set defined by the current locale.
System information:
  -A, --allusers        use `All Users' instead of current user for -D, -O, -P
  -D, --desktop         output `Desktop' directory and exit
  -H, --homeroot        output `Profiles' directory (home root) and exit
  -O, --mydocs          output `My Documents' directory and exit
  -P, --smprograms      output Start Menu `Programs' directory and exit
  -S, --sysdir          output system directory and exit
  -W, --windir          output `Windows' directory and exit
  -F, --folder ID       output special folder with numeric ID and exit
Try `cygpath --help' for more information.
result: Failed. Execution failed: exit code 1


test result: Failed. Execution failed: exit code 1

                                    

Comments
SUGGESTED FIX

Change the cygpath call to
    SCR=`pwd | cygpath -d -f -`
                                     
2011-10-06
EVALUATION

The problem is this code in Test.sh
  CYGWIN* )
    FS="/"
    SCR=`pwd | cygpath -d`
    ;;
Piping into cygpath doesn't work.  This causes the cygpath error shown in the description, and it causes SCR to be empty.  Then Test.sh does this:
  ...../jar cf "${SCR}${FS}good.jar" .....
which expands to
  ...../jar cf /good.jar .....

Apparently, this normally works ok, but if / is not writable, then the test fails as shown in the description.
The above code has been in this test for more than two years and we have only seen it fail once.
                                     
2011-10-06



Hardware and Software, Engineered to Work Together