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

Allow source dependencies without settings file before making DeprecateUndefinedBuildWorkExecutor.execute() fail #13793

Closed
lacasseio opened this issue Jul 15, 2020 · 11 comments
Assignees
Labels
Milestone

Comments

@lacasseio
Copy link
Contributor

Expected Behavior

Gradle should not report deprecated feature for "included build" from source dependencies without settings.gradle file, that is without a Gradle build.

Current Behavior

Gradle reports a deprecated feature for source dependencies without Gradle build where the entire build is configured using injected plugins.

Context

According to the deprecation warning, this will break the build using the source dependency feature to wrap other build systems in Gradle 7.0.

Steps to Reproduce

Consume a project without a Gradle build using source dependencies.

Your Environment

Build scan URL: I would love to produce one but the build scan plugin doesn't support source dependencies.

@lacasseio
Copy link
Contributor Author

This seems to be the call stack for the deprecation warning:

Executing Gradle tasks as part of an undefined build has been deprecated. This will fail with an error in Gradle 7.0. Consult the upgrading guide for further information: https://docs.gradle.org/6.2.1/userguide/upgrading_version_5.html#executing_gradle_without_a_settings_file_has_been_deprecated
	at org.gradle.execution.DeprecateUndefinedBuildWorkExecutor.execute(DeprecateUndefinedBuildWorkExecutor.java:39)
	at org.gradle.execution.BuildOperationFiringBuildWorkerExecutor$ExecuteTasks.run(BuildOperationFiringBuildWorkerExecutor.java:57)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92)
	at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
	at org.gradle.execution.BuildOperationFiringBuildWorkerExecutor.execute(BuildOperationFiringBuildWorkerExecutor.java:42)
	at org.gradle.initialization.DefaultGradleLauncher.runWork(DefaultGradleLauncher.java:255)
	at org.gradle.initialization.DefaultGradleLauncher.doClassicBuildStages(DefaultGradleLauncher.java:164)
	at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:140)
	at org.gradle.initialization.DefaultGradleLauncher.executeTasks(DefaultGradleLauncher.java:120)
	at org.gradle.composite.internal.DefaultIncludedBuild$1.run(DefaultIncludedBuild.java:216)
	at org.gradle.internal.work.DefaultWorkerLeaseService.withSharedLease(DefaultWorkerLeaseService.java:119)
	at org.gradle.internal.work.StopShieldingWorkerLeaseService.withSharedLease(StopShieldingWorkerLeaseService.java:70)
	at org.gradle.composite.internal.DefaultIncludedBuild.execute(DefaultIncludedBuild.java:213)
	at org.gradle.composite.internal.DefaultIncludedBuildController.doBuild(DefaultIncludedBuildController.java:196)
	at org.gradle.composite.internal.DefaultIncludedBuildController.run(DefaultIncludedBuildController.java:106)
	at org.gradle.composite.internal.DefaultIncludedBuildControllers$BuildOpRunnable.run(DefaultIncludedBuildControllers.java:126)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
	at java.lang.Thread.run(Thread.java:748)

@lacasseio
Copy link
Contributor Author

Any update on this issue? My understanding is this very valid use case will start failing on Gradle 7.0 which is not a good outcome for my project and the future of source dependency.

@lacasseio
Copy link
Contributor Author

Any update on this issue? As Gradle 7.0 approaches, this becomes important to solve or at least have a workaround.

@lacasseio
Copy link
Contributor Author

Is there any chance this will be addressed before 7.0? This would effectively introduce a regression in the next major release.

@lacasseio
Copy link
Contributor Author

@ljacomet @big-guy Any news if this will become a regression in 7.0?

@ljacomet ljacomet added this to the 7.0 RC1 milestone Jan 6, 2021
@ljacomet
Copy link
Member

ljacomet commented Jan 6, 2021

I have added this to the 7.0 RC1 milestone to make sure we give you an answer.

@jjohannes
Copy link
Contributor

I agree that there should be a special handling of this case and that the deprecation warning should not be emitted.

Before we attempt to make DeprecateUndefinedBuildWorkExecutor.execute() fail for certain cases, this has to be addressed. A test case for this scenario has to be added.

If this turns out to be more difficult than expected, we can also fix this in one of the next releases and not make this a failure at all in 7.0 but keep the deprecation warning for now.

@jjohannes jjohannes changed the title Wrongly report deprecated feature for source dependencies not using Gradle build tool Allow source dependencies without settings file before making DeprecateUndefinedBuildWorkExecutor.execute() fail Jan 18, 2021
@jjohannes jjohannes self-assigned this Feb 1, 2021
@jjohannes jjohannes added the @core Issue owned by GBT Core label Feb 1, 2021
@jjohannes
Copy link
Contributor

jjohannes commented Feb 2, 2021

@lacasseio could you please share a minimal reproduced that triggers the deprecation message?

@jjohannes
Copy link
Contributor

Never mind. Of course 5 minutes after I wrote the above, I got it.

@jjohannes
Copy link
Contributor

Fix for the original issue: #15997

@lacasseio
Copy link
Contributor Author

Thanks for fixing this, I appreciate it.

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

No branches or pull requests

3 participants