square/anvil

Stub gen FileNotFoundException with new file tracking enabled

ZacSweers opened this issue · 0 comments

Using 2.50 betas with the new file tracking enabled, we've seen a sporadic crash like this after changing branches during stub gen.

Couple interesting notes I see here

  • It happens on a variant source set (where the flavor here is internal)
  • This happened locally, but the file it's referencing is a CI path ("buildkite-agent"). Possibly something up with its interaction with remote build cache?
:apps:app-di:kaptGenerateStubsInternalDebugKotlin FAILED	
e: java.io.FileNotFoundException: /var/lib/buildkite-agent/builds/mbr-buildkite-agent-android-iad-ktkcvr-1/slack/android-pull-request/apps/app-di/../../../../../../../../../Users/<redacted>/dev/slack-android/main/apps/app-di/src/internal/kotlin/slack/di/anvil/InternalModuleProxy.kt (No such file or directory)	
	at java.base/java.io.FileInputStream.open0(Native Method)	
	at java.base/java.io.FileInputStream.open(FileInputStream.java:213)	
	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:152)	
	at kotlin.io.FilesKt__FileReadWriteKt.readBytes(FileReadWrite.kt:63)	
	at com.squareup.anvil.compiler.codegen.incremental.GeneratedFileCache.md5(GeneratedFileCache.kt:167)	
	at com.squareup.anvil.compiler.codegen.incremental.GeneratedFileCache.md5(GeneratedFileCache.kt:170)	
	at com.squareup.anvil.compiler.codegen.incremental.GeneratedFileCache.hasChanged(GeneratedFileCache.kt:153)	
	at com.squareup.anvil.compiler.codegen.incremental.GeneratedFileCache.hasChanged(GeneratedFileCache.kt:150)	
	at com.squareup.anvil.compiler.codegen.incremental.FileCacheOperations.restoreFromCache(FileCacheOperations.kt:39)	
	at com.squareup.anvil.compiler.codegen.CodeGenerationExtension.analysisCompleted(CodeGenerationExtension.kt:97)