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

Deleting cached jars triggers NoSuchFileException #821

Open
olafurpg opened this issue Feb 24, 2019 · 1 comment · May be fixed by #2604
Open

Deleting cached jars triggers NoSuchFileException #821

olafurpg opened this issue Feb 24, 2019 · 1 comment · May be fixed by #2604
Labels
bug A defect or misbehaviour. build server Any issue or pull request that has to do with hot compilers or BSP. task / compile

Comments

@olafurpg
Copy link
Contributor

Steps to reproduce

  • sbt bloopInstall a project
  • compile works as expected
  • rm -rf the cache location for downloaded jars that are referenced in .bloop/*.json files
  • bloop compile proje<TAB>
$ bloop compile fron<TAB>
java.nio.file.NoSuchFileException: /Users/olafurpg/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.10.7/scala-library-2.10.7.jar
	at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
	at sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes(UnixFileAttributeViews.java:55)
	at sun.nio.fs.UnixFileSystemProvider.readAttributes(UnixFileSystemProvider.java:144)
	at java.nio.file.Files.readAttributes(Files.java:1737)
	at bloop.ScalaInstance.$anonfun$hashCode$1(ScalaInstance.scala:65)
	at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:237)
	at scala.collection.IndexedSeqOptimized.foreach(IndexedSeqOptimized.scala:36)
	at scala.collection.IndexedSeqOptimized.foreach$(IndexedSeqOptimized.scala:33)
	at scala.collection.mutable.WrappedArray.foreach(WrappedArray.scala:39)
	at scala.collection.TraversableLike.map(TraversableLike.scala:237)
	at scala.collection.TraversableLike.map$(TraversableLike.scala:230)
	at scala.collection.AbstractTraversable.map(Traversable.scala:108)
	at bloop.ScalaInstance.<init>(ScalaInstance.scala:61)
	at bloop.ScalaInstance$.newInstance$1(ScalaInstance.scala:109)
	at bloop.ScalaInstance$.$anonfun$apply$7(ScalaInstance.scala:114)
	at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)
	at bloop.ScalaInstance$.apply(ScalaInstance.scala:114)
	at bloop.data.Project$.$anonfun$fromConfig$1(Project.scala:110)
	at scala.Option.flatMap(Option.scala:188)
	at bloop.data.Project$.fromConfig(Project.scala:106)
	at bloop.data.Project$.fromBytesAndOrigin(Project.scala:170)

In Metals, this error manifests as a timeout exception during the BSP initialize handshake.

I expected Bloop to report an error in the cli like this instead

$ bloop compile frontend
[E] .bloop/frontend.json references missing file /Users/olafurpg/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.10.7/scala-library-2.10.7.jar

In BSP, I expect Bloop to initialize but ignore build targets that reference missing jars. It could report errors via logMessage instead.

@jvican jvican changed the title NoSuchFileException when deleting cached jars Deleting cached jars triggers NoSuchFileException Feb 26, 2019
@jvican jvican added bug A defect or misbehaviour. build server Any issue or pull request that has to do with hot compilers or BSP. task / compile labels Feb 26, 2019
@jvican jvican self-assigned this Feb 26, 2019
@jvican jvican removed their assignment Mar 6, 2019
@jvican
Copy link
Contributor

jvican commented Mar 6, 2019

Thanks for reporting. The issue is not critical so I'm delaying a fix for this to the next minor release after 1.3.0.

tgodzik added a commit to tgodzik/bloop that referenced this issue Feb 12, 2025
Fixes scalacenter#821

This might cause loading configuration a bit, but that should not be an issue compared to potential user trouble when the artifacts are missing.
tgodzik added a commit to tgodzik/bloop that referenced this issue Feb 12, 2025
Fixes scalacenter#821

This might cause loading configuration a bit, but that should not be an issue compared to potential user trouble when the artifacts are missing.
@tgodzik tgodzik linked a pull request Feb 12, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A defect or misbehaviour. build server Any issue or pull request that has to do with hot compilers or BSP. task / compile
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants