Case sensitive bug building on WIndows

Stephen Colebourne scolebourne at joda.org
Thu Jan 10 09:52:51 PST 2013


I spent most of today trying to solve a problem preventing the new
build autoconf from working, when it had worked last night.

Between last night and lunchtime today, I reinstalled cygwin (E drive
in instead of C drive) and setup the permissions correctly (previously
there were effectively no permissions enforced, now there are
permissions). One of these things borked the script.

After a good four or five hours, we traced the problem to line 16423
(and its friend line 16407) in this file:
http://hg.openjdk.java.net/build-infra/jdk8/file/52c14058a460/common/autoconf/generated-configure.sh

Basically, the Microsoft SDK has a file named "SetEnv.Cmd", where the
"Cmd" is clearly weird, when it should be "cmd". But in WIndows,
things are not case sensitive. By changing the permissions from no
permissions to explicit permissions, the file had gone from executable
allowed (implicitly, with no permissions) to explicitly not
executable. The "which" command thus no longer found the "SetEnv.Cmd",
as the cmd file was not marked as executable. The block of code linked
above is explicitly designed to work around the limitations of
"which", but failed because it only checked for "cmd", not case
insensitive "cmd".

Changing the line from:
 && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
to:
 && test "x`$ECHO \"$path\" | $GREP -ie \"\\.bat$\" -ie \"\\.cmd$\"`" != x \
makes it ignore case, and the autoconf completed successfully.

I'd also note that I wasted a lot of time trying to follow the advice
of not mixing spaces, when that really wasn't the problem at all.

Stephen



More information about the build-infra-dev mailing list