Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uber fails with java.nio.file.DirectoryNotEmptyException #364

Closed
jgdavey opened this issue Dec 18, 2015 · 12 comments
Closed

uber fails with java.nio.file.DirectoryNotEmptyException #364

jgdavey opened this issue Dec 18, 2015 · 12 comments
Labels

Comments

@jgdavey
Copy link
Contributor

jgdavey commented Dec 18, 2015

When one jar has a folder with the same name as a file in another, hard-link is unable to delete the directory. The process can't continue.

Adding the relative path of the file/directory in question to the --exclude list is a work-around.

A minimal reproducible example:

# build.boot
(set-env!
 :dependencies '[[org.clojure/clojure    "1.7.0" :scope "provided"]
                 [com.datomic/datomic-free "0.9.5327"]])

Then run boot uber target -d target

@jgdavey
Copy link
Contributor Author

jgdavey commented Dec 18, 2015

Boot 2.5.1 exhibits this

@jgdavey
Copy link
Contributor Author

jgdavey commented Dec 18, 2015

Tagging #361, as it seems like a very similar issue (default merge strategy).

@micha micha added the Bug label Dec 18, 2015
@micha micha closed this as completed in 9443143 Dec 19, 2015
@micha
Copy link
Contributor

micha commented Dec 19, 2015

Can you please try

BOOT_VERSION=2.5.2-SNAPSHOT boot uber

and verify that this is fixed (i.e. warning and no exception).

@jgdavey
Copy link
Contributor Author

jgdavey commented Dec 19, 2015

Unfortunately, I'm still seeing the error:

$ BOOT_VERSION=2.5.2-SNAPSHOT boot uber
Adding uberjar entries...
              clojure.lang.ExceptionInfo: java.nio.file.DirectoryNotEmptyException: /Users/jgdavey/.boot/cache/tmp/.../i5q/-grrwi1/LICENSE
    data: {:file
           "/var/folders/tx/srdmskyn1z17lfvdf9h8nmfc0000gn/T/boot.user4137288643226806424.clj",
           :line 39}

@jgdavey
Copy link
Contributor Author

jgdavey commented Dec 19, 2015

Worth noting: the folder is lowercase, but the files are upper (license/ vs LICENSE)

@martinklepsch
Copy link
Member

@jgdavey just to make sure:you don't have a boot.properties in th same directory?

@micha micha reopened this Dec 19, 2015
@micha micha closed this as completed in d5810ba Dec 19, 2015
@micha
Copy link
Contributor

micha commented Dec 19, 2015

@jgdavey I updated the SNAPSHOT, can you please try again? I think we really have a fix now, for real and seriously. :)

@micha micha reopened this Dec 19, 2015
@jgdavey
Copy link
Contributor Author

jgdavey commented Dec 20, 2015

Using the latest snapshot, I get new output (a warning is logged), but the error is still happening:

$ BOOT_VERSION=2.5.2-SNAPSHOT boot uber                                                  
Adding uberjar entries...
Merge conflict: META-INF/LICENSE
              clojure.lang.ExceptionInfo: java.util.concurrent.ExecutionException: java.nio.file.DirectoryNotEmptyException: target/META-INF/LICENSE
    data: {:file
           "/var/folders/tx/srdmskyn1z17lfvdf9h8nmfc0000gn/T/boot.user5887960706409675517.clj",
           :line 19}
 java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: java.nio.file.DirectoryNotEmptyException: target/META-INF/LICENSE
 java.util.concurrent.ExecutionException: java.nio.file.DirectoryNotEmptyException: target/META-INF/LICENSE
java.nio.file.DirectoryNotEmptyException: target/META-INF/LICENSE
    file: "target/META-INF/LICENSE"
             sun.nio.fs.UnixCopyFile.copy            UnixCopyFile.java:  564
   sun.nio.fs.UnixFileSystemProvider.copy  UnixFileSystemProvider.java:  253
                                      ...
                    boot.filesystem/copy!               filesystem.clj:   51
                   boot.filesystem/patch!               filesystem.clj:   82
                                      ...
boot.core/fileset-syncer/fn/iter/fn/fn/fn                     core.clj:  774
      clojure.core/binding-conveyor-fn/fn                     core.clj: 1916
                                      ...

@micha
Copy link
Contributor

micha commented Dec 20, 2015

@jgdavey This was a tricky one. Hard to reproduce exactly here because I don't have access to a case-insensitive filesystem, but I think I have a sufficiently warped combination of jars now to trigger every possible conflict.

I pushed a new and (final?) snapshot. Confidence is high for this one. I think you'll be pleasantly surprised at the result.

@martinklepsch
Copy link
Member

@micha can confirm that @jgdavey's repro works with latest snapshot. A conflict message is printed:

Merge conflict: not adding META-INF/LICENSE

@micha
Copy link
Contributor

micha commented Dec 20, 2015

💥 thanks @martinklepsch !

@micha micha closed this as completed Dec 20, 2015
@jgdavey
Copy link
Contributor Author

jgdavey commented Dec 21, 2015

I can also confirm: both my repro and my non-contrived project are working with the latest snapshot. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants