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

Shadow Plugin does not build with Gradle 6.0 #527

Closed
rpalcolea opened this issue Nov 11, 2019 · 1 comment
Closed

Shadow Plugin does not build with Gradle 6.0 #527

rpalcolea opened this issue Nov 11, 2019 · 1 comment
Milestone

Comments

@rpalcolea
Copy link
Contributor

When upgrading this project to Gradle 6.0, building it hangs forever when trying to build the JAR via shadowJar.

2019-11-11T09:20:51.144-0800 [DEBUG] [org.gradle.internal.execution.steps.CreateOutputsStep] Ensuring parent directory exists for property archiveFile at /Users/rperezalcolea/Projects/github/johnrengelman/shadow/build/libs/shadow-5.1.0-SNAPSHOT.jar
2019-11-11T09:20:51.145-0800 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter] Executing actions for task ':shadowJar'.
2019-11-11T09:20:51.145-0800 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Execute doFirst {} action for :shadowJar' started
2019-11-11T09:20:51.145-0800 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Resolve files of :shadow' started
2019-11-11T09:20:51.145-0800 [DEBUG] [org.gradle.internal.component.model.ComponentAttributeMatcher] Selected match groovy-all-1.3-2.5.8.jar (Local Groovy) from candidates [groovy-all-1.3-2.5.8.jar (Local Groovy)] for {}
2019-11-11T09:20:51.145-0800 [DEBUG] [org.gradle.internal.component.model.ComponentAttributeMatcher] Selected match gradle-api-6.0.jar (Gradle API) from candidates [gradle-api-6.0.jar (Gradle API)] for {}
2019-11-11T09:20:51.145-0800 [DEBUG] [org.gradle.internal.component.model.ComponentAttributeMatcher] Selected match groovy-all-1.3-2.5.8.jar (Gradle API) from candidates [groovy-all-1.3-2.5.8.jar (Gradle API)] for {}
2019-11-11T09:20:51.145-0800 [DEBUG] [org.gradle.internal.component.model.ComponentAttributeMatcher] Selected match kotlin-stdlib-1.3.50.jar (Gradle API) from candidates [kotlin-stdlib-1.3.50.jar (Gradle API)] for {}
2019-11-11T09:20:51.145-0800 [DEBUG] [org.gradle.internal.component.model.ComponentAttributeMatcher] Selected match kotlin-stdlib-common-1.3.50.jar (Gradle API) from candidates [kotlin-stdlib-common-1.3.50.jar (Gradle API)] for {}
2019-11-11T09:20:51.145-0800 [DEBUG] [org.gradle.internal.component.model.ComponentAttributeMatcher] Selected match kotlin-stdlib-jdk8-1.3.50.jar (Gradle API) from candidates [kotlin-stdlib-jdk8-1.3.50.jar (Gradle API)] for {}
2019-11-11T09:20:51.145-0800 [DEBUG] [org.gradle.internal.component.model.ComponentAttributeMatcher] Selected match kotlin-stdlib-jdk7-1.3.50.jar (Gradle API) from candidates [kotlin-stdlib-jdk7-1.3.50.jar (Gradle API)] for {}
2019-11-11T09:20:51.146-0800 [DEBUG] [org.gradle.internal.component.model.ComponentAttributeMatcher] Selected match kotlin-reflect-1.3.50.jar (Gradle API) from candidates [kotlin-reflect-1.3.50.jar (Gradle API)] for {}
2019-11-11T09:20:51.146-0800 [DEBUG] [org.gradle.internal.component.model.ComponentAttributeMatcher] Selected match gradle-installation-beacon-6.0.jar (Gradle API) from candidates [gradle-installation-beacon-6.0.jar (Gradle API)] for {}
2019-11-11T09:20:51.146-0800 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Resolve files of :shadow'
2019-11-11T09:20:51.146-0800 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Resolve files of :shadow' completed
2019-11-11T09:20:51.152-0800 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Execute doFirst {} action for :shadowJar'
2019-11-11T09:20:51.152-0800 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Execute doFirst {} action for :shadowJar' completed
2019-11-11T09:20:51.152-0800 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Execute copy for :shadowJar' started
2019-11-11T09:20:51.236-0800 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Resolve files of :runtimeClasspath' started
2019-11-11T09:20:51.236-0800 [DEBUG] [org.gradle.internal.component.model.ComponentAttributeMatcher] Selected match gradle-api-6.0.jar (Gradle API) from candidates [gradle-api-6.0.jar (Gradle API)] for {org.gradle.dependency.bundling=external, org.gradle.jvm.version=7, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}
2019-11-11T09:20:51.237-0800 [DEBUG] [org.gradle.internal.component.model.ComponentAttributeMatcher] Selected match groovy-all-1.3-2.5.8.jar (Gradle API) from candidates [groovy-all-1.3-2.5.8.jar (Gradle API)] for {org.gradle.dependency.bundling=external, org.gradle.jvm.version=7, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}
2019-11-11T09:20:51.237-0800 [DEBUG] [org.gradle.internal.component.model.ComponentAttributeMatcher] Selected match kotlin-stdlib-1.3.50.jar (Gradle API) from candidates [kotlin-stdlib-1.3.50.jar (Gradle API)] for {org.gradle.dependency.bundling=external, org.gradle.jvm.version=7, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}
2019-11-11T09:20:51.237-0800 [DEBUG] [org.gradle.internal.component.model.ComponentAttributeMatcher] Selected match kotlin-stdlib-common-1.3.50.jar (Gradle API) from candidates [kotlin-stdlib-common-1.3.50.jar (Gradle API)] for {org.gradle.dependency.bundling=external, org.gradle.jvm.version=7, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}
2019-11-11T09:20:51.237-0800 [DEBUG] [org.gradle.internal.component.model.ComponentAttributeMatcher] Selected match kotlin-stdlib-jdk8-1.3.50.jar (Gradle API) from candidates [kotlin-stdlib-jdk8-1.3.50.jar (Gradle API)] for {org.gradle.dependency.bundling=external, org.gradle.jvm.version=7, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}
2019-11-11T09:20:51.237-0800 [DEBUG] [org.gradle.internal.component.model.ComponentAttributeMatcher] Selected match kotlin-stdlib-jdk7-1.3.50.jar (Gradle API) from candidates [kotlin-stdlib-jdk7-1.3.50.jar (Gradle API)] for {org.gradle.dependency.bundling=external, org.gradle.jvm.version=7, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}
2019-11-11T09:20:51.237-0800 [DEBUG] [org.gradle.internal.component.model.ComponentAttributeMatcher] Selected match kotlin-reflect-1.3.50.jar (Gradle API) from candidates [kotlin-reflect-1.3.50.jar (Gradle API)] for {org.gradle.dependency.bundling=external, org.gradle.jvm.version=7, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}
2019-11-11T09:20:51.237-0800 [DEBUG] [org.gradle.internal.component.model.ComponentAttributeMatcher] Selected match gradle-installation-beacon-6.0.jar (Gradle API) from candidates [gradle-installation-beacon-6.0.jar (Gradle API)] for {org.gradle.dependency.bundling=external, org.gradle.jvm.version=7, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}
2019-11-11T09:20:51.237-0800 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Resolve files of :runtimeClasspath'
2019-11-11T09:20:51.237-0800 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Resolve files of :runtimeClasspath' completed
2019-11-11T09:20:55.870-0800 [LIFECYCLE] [org.gradle.cache.internal.DefaultFileLockManager] 
2019-11-11T09:20:55.870-0800 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2019-11-11T09:20:55.871-0800 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2019-11-11T09:20:55.871-0800 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2019-11-11T09:20:55.871-0800 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2019-11-11T09:20:55.871-0800 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2019-11-11T09:20:55.871-0800 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2019-11-11T09:21:05.869-0800 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2019-11-11T09:21:05.869-0800 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2019-11-11T09:21:05.869-0800 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2019-11-11T09:21:05.869-0800 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2019-11-11T09:21:05.869-0800 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2019-11-11T09:21:05.869-0800 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2019-11-11T09:21:15.868-0800 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2019-11-11T09:21:15.868-0800 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.

I'm attaching the jstack for the daemon and it seems like having troubles while relocating:

Daemon worker" #19 prio=5 os_prio=31 tid=0x00007fbebc185800 nid=0x5c03 runnable [0x0000700003512000]
   java.lang.Thread.State: RUNNABLE
	at com.github.jengelman.gradle.plugins.shadow.relocation.Relocator$canRelocatePath.call(Unknown Source)
	at com.github.jengelman.gradle.plugins.shadow.impl.RelocatorRemapper.map(RelocatorRemapper.groovy:101)

shadow-jstack.log

The interesting part is that we don't see this happening with projects consuming Shadow plugin 5.2.0. So wondering if this is something particular in the setup for this build

@johnrengelman johnrengelman added this to the 6.0 milestone Jan 14, 2020
@Tapchicoma
Copy link

I've successfully build my plugin on Gradle 6 having "shadow" and "gradle-api-plugins" combination by replacing this line https://github.com/johnrengelman/shadow/blob/a7f0908521029a848b5de2e2a131af146bd213cd/build.gradle#L29 to:

configurations.named(JavaPlugin.API_CONFIGURATION_NAME) {
    dependencies.remove(project.dependencies.gradleApi())
}

Before this change shadowJar still includes gradleApi() in resulting jar despite having proposed line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants