Skip to content

[BUG] thirdPartyAudit task fails when copying duplicate files #16840

Closed
@finnegancarroll

Description

@finnegancarroll

Describe the bug

Plugin dependencies which use identical file names for their metadata will cause the thirdPartyAudit task to fail for the plugin with the following error:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':plugins:transport-grpc:thirdPartyAudit'.
> Could not copy zip entry '/Users/carrofin/.gradle/caches/modules-2/files-2.1/com.google.guava/guava/33.2.1-jre/818e780da2c66c63bbb6480fef1f3855eeafa3e4/guava-33.2.1-jre.jar!META-INF/LICENSE' to '/Users/carrofin/fdev/tmp/OpenSearch/plugins/transport-grpc/build/precommit/thirdPartyAudit/thirdPartyAudit/META-INF/LICENSE'.
   > /Users/carrofin/fdev/tmp/OpenSearch/plugins/transport-grpc/build/precommit/thirdPartyAudit/thirdPartyAudit/META-INF/LICENSE (Is a directory)

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Get more help at https://help.gradle.org.

In this case dependency 1 attempts to write a LICENSE file to plugins/<my-plugin>/build/precommit/thirdPartyAudit/thirdPartyAudit/META-INF while dependency 2 populates a LICENSE directory at the same location.

Related component

Build

To Reproduce

Note: It appears this specific minimal example does not reproduce on case sensitive file systems. At some point gradle normalizes the capitalization of LICENSE the file which in actuality is lowercase when written to disk.

Branch with minimal example: https://github.com/finnegancarroll/OpenSearch/tree/dbg-plugin-3prtyaud

Reproduce with:

./gradlew precommit -x :plugins:transport-grpc:testingConventions

Expected behavior

thirdPartyAudit task should handle this collision gracefully and pass.
Proposed solution - Create sub directories for each dependency: #16844

Metadata

Metadata

Assignees

No one assigned

    Labels

    BuildBuild Tasks/Gradle Plugin, groovy scripts, build tools, Javadoc enforcement.bugSomething isn't workinguntriaged

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions