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

Mac build problems with .DS_Store files

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Cannot Reproduce
    • Icon: P4 P4
    • 9
    • None
    • infrastructure

      Reported by David Chase. Saved here for the record.

      The .DS_Store files can popup just about anywhere and create build issues.

      -------

      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(String.java:1958)
      at build.tools.buildmetaindex.JarMetaIndex.isPrefixKnown(BuildMetaIndex.java:317)
      at build.tools.buildmetaindex.JarMetaIndex.getMetaIndex(BuildMetaIndex.java:233)
      at build.tools.buildmetaindex.BuildMetaIndex.main(BuildMetaIndex.java:97)

      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.
      Joy.

      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:

      http://asepsis.binaryage.com/#about

      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.

      David

            Unassigned Unassigned
            ohair Kelly Ohair (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: