Mac build fun

David Chase at
Wed Jan 9 03:30:11 UTC 2013

I had a failure building on a Mac (Mountain Lion, 10.8.2), both new build and old build, at this step:

	    /Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home/bin/java -XX:-PrintVMOptions -XX:+UnlockDiagnosticVMOptions -XX:-LogVMOutput -Djava.awt.headless=true -Xmx512m -Xms512m -XX:PermSize=32m -XX:MaxPermSize=160m -jar /Users/dr2chase/work/jdk8tl/build/macosx-x86_64/../macosx-x86_64-debug/btjars/buildmetaindex.jar \
		-o meta-index *.jar
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: -7
	at java.lang.String.substring(

I did some snooping, and this was the problem:

firstSlashIndex = 5, name = javax/.DS_Store

I.E. I must have visited a directory in the Finder or some such, and it created a .DS_Store file for me.

And it turns out, using the usual command for getting rid of them, that they are getting recreated again, very quickly.

find . -name .DS_Store -exec rm '{}' \;
find . -name .DS_Store -print

the second command would find things to print.

I closed all my finder and spotlight windows, deleted again, and it stayed deleted, and my build succeeded.
I think this also explains mystery failures (directory not empty) in various attempts at make clean.
I plan to look into a "solution" that redirects .DS_Store files into a separate directory:

Just a heads up.  I'm not sure whether it makes sense to harden the build against this or not; it seems like a royal pain.


More information about the build-dev mailing list