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

Cannot access input property sourceLinks.localDirectory #2786

Closed
IgnatBeresnev opened this issue Dec 22, 2022 · 0 comments · Fixed by #2807
Closed

Cannot access input property sourceLinks.localDirectory #2786

IgnatBeresnev opened this issue Dec 22, 2022 · 0 comments · Fixed by #2807
Labels
bug feedback: Kotlin libs Feedback from Kotlin's internal libraries runner: Gradle plugin An issue/PR related to Dokka's Gradle plugin

Comments

@IgnatBeresnev
Copy link
Member

IgnatBeresnev commented Dec 22, 2022

Supposedly, because GradleSourceLinkBuilder#localDirectory is marked as InputDirectory, it keeps track of all the files within this directory so that it can mark the task as out-of-date if anything changes.

However, when localDirectory is targeting a directory with a lot of files (like the whole of the standard library), it can cause the following exceptions:

Cannot access input property 'unsuppressedSourceSets.$0.sourceLinks.$0.localDirectory' of task ':stdlib_1.0'
java.io.UncheckedIOException: Failed to create MD5 hash for file content.
        at org.gradle.internal.hash.DefaultStreamHasher.hash(DefaultStreamHasher.java:37)
        at org.gradle.internal.hash.DefaultFileHasher.hash(DefaultFileHasher.java:41)
        at org.gradle.api.internal.changedetection.state.CachingFileHasher.snapshot(CachingFileHasher.java:94)
        at org.gradle.api.internal.changedetection.state.CachingFileHasher.hash(CachingFileHasher.java:76)
        at org.gradle.api.internal.changedetection.state.SplitFileHasher.hash(SplitFileHasher.java:54)
        at org.gradle.internal.snapshot.impl.DirectorySnapshotter$PathVisitor.snapshotFile(DirectorySnapshotter.java:347)
        .....
Caused by: java.io.IOException: The process cannot access the file because another process has locked a portion of the file
        at java.io.FileInputStream.readBytes(Native Method)
        at java.io.FileInputStream.read(FileInputStream.java:233)
        at org.gradle.internal.hash.DefaultStreamHasher.doHash(DefaultStreamHasher.java:52)
        at org.gradle.internal.hash.DefaultStreamHasher.hash(DefaultStreamHasher.java:35)
        ... 120 more 

These exceptions do not stop the build, but they slow it down considerably.

Should be reproducible on https://github.com/vmishenev/kotlin/tree/update-dokka/libraries/tools/kotlin-stdlib-docs


This property is only used for getting the absolute path of the source files in order to add source links to signatures. I can see no reason for why it should be responsible for making Dokka tasks out of date.

That being said, maybe @InputDirectory could be dropped in favor of something simpler.

@IgnatBeresnev IgnatBeresnev added bug feedback: Kotlin libs Feedback from Kotlin's internal libraries runner: Gradle plugin An issue/PR related to Dokka's Gradle plugin labels Dec 22, 2022
@IgnatBeresnev IgnatBeresnev linked a pull request Jan 13, 2023 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 feedback: Kotlin libs Feedback from Kotlin's internal libraries runner: Gradle plugin An issue/PR related to Dokka's Gradle plugin
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant