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

librarymanagement / ivy screw up "java.lang.IllegalStateException: Ivy file not found in cache for " #4155

Open
Sciss opened this issue May 13, 2018 · 4 comments
Labels
area/library_management library management uncategorized Used for Waffle integration

Comments

@Sciss
Copy link

Sciss commented May 13, 2018

[info] 	published ivy to /home/hhrutz/.ivy2/local/de.sciss/scalacolliderugens-core_2.11/1.19.1/ivys/ivy.xml
[error] java.lang.IllegalStateException: Ivy file not found in cache for de.sciss#scalacolliderugens_2.11;1.19.1!
[error] 	at sbt.internal.librarymanagement.ResolutionCache.getResolvedModuleDescriptor(ResolutionCache.scala:66)

I'm fighting with this every second day. I try

$ rm -r target
$ rm -r project/target
$ rm -r ~/.ivy2/cache/de.sciss/scalacolliderugens*
$ rm -r ~/.ivy2/local/de.sciss/scalacolliderugens*
$ sbt +clean +update +publishLocal

None of this solves the bug. It's really annoying.
Tried sbt 1.1.4, 1.1.5

Build file: https://github.com/Sciss/ScalaColliderUGens/blob/55b64b7cb73daf254ccdd37c9e87260f6b460b92/build.sbt

@Sciss
Copy link
Author

Sciss commented May 13, 2018

It works after a few times, so almost certainly a race condition

@Sciss
Copy link
Author

Sciss commented May 13, 2018

The problem isn't even "solved" after the artifact is published. It comes back to bite you:

hhrutz@holiday:~/Documents/devel/Patterns (work)*$ sbt update
[info] Loading settings from build.sbt,idea.sbt ...
[info] Loading global plugins from /home/hhrutz/.sbt/1.0/plugins
[info] Loading settings from plugins.sbt ...
[info] Loading project definition from /home/hhrutz/Documents/devel/Patterns/project
[info] Loading settings from build.sbt ...
[info] Set current project to Patterns (in build file:/home/hhrutz/Documents/devel/Patterns/)
[info] Updating core...
[warn] 	::::::::::::::::::::::::::::::::::::::::::::::
[warn] 	::          UNRESOLVED DEPENDENCIES         ::
[warn] 	::::::::::::::::::::::::::::::::::::::::::::::
[warn] 	:: de.sciss#scalacolliderugens-core_2.12;1.19.1: configuration not found in de.sciss#scalacolliderugens-core_2.12;1.19.1: 'master'. It was required from de.sciss#scalacolliderugens-plugins_2.12;1.19.1 compile
[warn] 	::::::::::::::::::::::::::::::::::::::::::::::
[warn] 
[warn] 	Note: Unresolved dependencies path:
[warn] 		de.sciss:scalacolliderugens-core_2.12:1.19.1
[warn] 		  +- de.sciss:scalacolliderugens-plugins_2.12:1.19.1 (/home/hhrutz/Documents/devel/Patterns/build.sbt#L78)
[warn] 		  +- de.sciss:patterns-core_2.12:0.3.0

This is from a different project now asking for the library. The files should be there:

$ ls -laR ~/.ivy2/local/de.sciss/scalacolliderugens-core_2.12/1.19.1/
/home/hhrutz/.ivy2/local/de.sciss/scalacolliderugens-core_2.12/1.19.1/:
total 28
drwxr-xr-x 7 hhrutz hhrutz 4096 May 13 15:10 .
drwxr-xr-x 3 hhrutz hhrutz 4096 May 13 15:10 ..
drwxr-xr-x 2 hhrutz hhrutz 4096 May 13 15:10 docs
drwxr-xr-x 2 hhrutz hhrutz 4096 May 13 15:10 ivys
drwxr-xr-x 2 hhrutz hhrutz 4096 May 13 15:10 jars
drwxr-xr-x 2 hhrutz hhrutz 4096 May 13 15:10 poms
drwxr-xr-x 2 hhrutz hhrutz 4096 May 13 15:10 srcs

/home/hhrutz/.ivy2/local/de.sciss/scalacolliderugens-core_2.12/1.19.1/docs:
total 14260
drwxr-xr-x 2 hhrutz hhrutz     4096 May 13 15:10 .
drwxr-xr-x 7 hhrutz hhrutz     4096 May 13 15:10 ..
-rw-r--r-- 1 hhrutz hhrutz 14583426 May 13 15:10 scalacolliderugens-core_2.12-javadoc.jar
-rw-r--r-- 1 hhrutz hhrutz       32 May 13 15:10 scalacolliderugens-core_2.12-javadoc.jar.md5
-rw-r--r-- 1 hhrutz hhrutz       40 May 13 15:10 scalacolliderugens-core_2.12-javadoc.jar.sha1

/home/hhrutz/.ivy2/local/de.sciss/scalacolliderugens-core_2.12/1.19.1/ivys:
total 20
drwxr-xr-x 2 hhrutz hhrutz 4096 May 13 15:10 .
drwxr-xr-x 7 hhrutz hhrutz 4096 May 13 15:10 ..
-rw-r--r-- 1 hhrutz hhrutz 2195 May 13 15:10 ivy.xml
-rw-r--r-- 1 hhrutz hhrutz   32 May 13 15:10 ivy.xml.md5
-rw-r--r-- 1 hhrutz hhrutz   40 May 13 15:10 ivy.xml.sha1

/home/hhrutz/.ivy2/local/de.sciss/scalacolliderugens-core_2.12/1.19.1/jars:
total 2032
drwxr-xr-x 2 hhrutz hhrutz    4096 May 13 15:10 .
drwxr-xr-x 7 hhrutz hhrutz    4096 May 13 15:10 ..
-rw-r--r-- 1 hhrutz hhrutz 2061310 May 13 15:09 scalacolliderugens-core_2.12.jar
-rw-r--r-- 1 hhrutz hhrutz      32 May 13 15:10 scalacolliderugens-core_2.12.jar.md5
-rw-r--r-- 1 hhrutz hhrutz      40 May 13 15:10 scalacolliderugens-core_2.12.jar.sha1

/home/hhrutz/.ivy2/local/de.sciss/scalacolliderugens-core_2.12/1.19.1/poms:
total 20
drwxr-xr-x 2 hhrutz hhrutz 4096 May 13 15:10 .
drwxr-xr-x 7 hhrutz hhrutz 4096 May 13 15:10 ..
-rw-r--r-- 1 hhrutz hhrutz 1697 May 13 15:10 scalacolliderugens-core_2.12.pom
-rw-r--r-- 1 hhrutz hhrutz   32 May 13 15:10 scalacolliderugens-core_2.12.pom.md5
-rw-r--r-- 1 hhrutz hhrutz   40 May 13 15:10 scalacolliderugens-core_2.12.pom.sha1

/home/hhrutz/.ivy2/local/de.sciss/scalacolliderugens-core_2.12/1.19.1/srcs:
total 140
drwxr-xr-x 2 hhrutz hhrutz   4096 May 13 15:10 .
drwxr-xr-x 7 hhrutz hhrutz   4096 May 13 15:10 ..
-rw-r--r-- 1 hhrutz hhrutz 123617 May 13 15:09 scalacolliderugens-core_2.12-sources.jar
-rw-r--r-- 1 hhrutz hhrutz     32 May 13 15:10 scalacolliderugens-core_2.12-sources.jar.md5
-rw-r--r-- 1 hhrutz hhrutz     40 May 13 15:10 scalacolliderugens-core_2.12-sources.jar.sha1

@Sciss
Copy link
Author

Sciss commented May 13, 2018

So in this case, the bug was that scalacolliderugens-plugins which depends on scalacolliderugens-core was specified, and sbt fails to get the transitive dependency. If I add scalacolliderugens-core here as well, the build proceeds.

@dwijnand dwijnand added the area/library_management library management label May 14, 2018
@eed3si9n
Copy link
Member

See also #2874.
Maybe we should recommend against using publishLocal in general and switch to publishM2.

@eed3si9n eed3si9n added the uncategorized Used for Waffle integration label Sep 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/library_management library management uncategorized Used for Waffle integration
Projects
None yet
Development

No branches or pull requests

3 participants