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

Building with org.gradle.parallel=true fails due to resolving dependencies in other subprojects #201

Closed
SquidDev opened this issue Jun 6, 2024 · 0 comments · Fixed by #211

Comments

@SquidDev
Copy link
Contributor

SquidDev commented Jun 6, 2024

Attempting to use recent versions of NeoGradle with parallel builds and multiple projects fails with the following error:

* What went wrong:
A problem occurred configuring root project 'mdk-example'.
> Could not determine the dependencies of null.
   > Current thread does not hold the state lock for project ':another'

This is a relatively recent regression — 7.0.133 works, while 7.0.137 fails — so I suspect this was introduced by #191.

Steps to reproduce

  • Clone the MDK (tested at bfc7eb87a59b671a274dbb8d94aab28784beea8e).
  • Add a new subproject (does not need to have NeoGradle installed), and a dependency on that project. I've included the full patch below.
  • Run ./gradlew tasks --parallel to configure the project.
Changes.patch
diff --git a/another/build.gradle b/another/build.gradle
new file mode 100644
index 0000000..8c234a6
--- /dev/null
+++ b/another/build.gradle
@@ -0,0 +1,7 @@
+plugins {
+  id("java-library")
+}
+
+dependencies {
+ implementation "com.google.guava:guava:31.1-jre"
+}
diff --git a/build.gradle b/build.gradle
index 700db60..4e48e4d 100644
--- a/build.gradle
+++ b/build.gradle
@@ -3,7 +3,7 @@ plugins {
     id 'eclipse'
     id 'idea'
     id 'maven-publish'
-    id 'net.neoforged.gradle.userdev' version '7.0.133'
+    id 'net.neoforged.gradle.userdev' version '7.0.139'
 }
 
 version = mod_version
@@ -88,6 +88,7 @@ dependencies {
     // And its provides the option to then use net.minecraft as the group, and one of; client, server or joined as the module name, plus the game version as version.
     // For all intends and purposes: You can treat this dependency as if it is a normal library you would use.
     implementation "net.neoforged:neoforge:${neo_version}"
+    implementation project(":another")
 
     // Example optional mod dependency with JEI
     // The JEI API is declared for compile time use, while the full JEI artifact is used at runtime
diff --git a/gradle.properties b/gradle.properties
index a4a8575..16eacae 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -2,6 +2,7 @@
 org.gradle.jvmargs=-Xmx1G
 org.gradle.daemon=false
 org.gradle.debug=false
+org.gradle.parallel=true
 
 #read more on this at https://github.com/neoforged/NeoGradle/blob/NG_7.0/README.md#apply-parchment-mappings
 # you can also find the latest versions at: https://parchmentmc.org/docs/getting-started
diff --git a/settings.gradle b/settings.gradle
index ada876e..4434e83 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -9,3 +9,5 @@ pluginManagement {
 plugins {
     id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0'
 }
+
+include(":another")

Full log output

marchermans added a commit that referenced this issue Jun 17, 2024
Fix Locale handling in string processing in as many places as I reasonably can.
Fix Parallel running
Fix Parallel central cache locking
Fix recompile not being cached
Fix DownloadAssets causing issues in multi project runs
Fix DevLogin conventionForRun triggering issues on none Client runs by convention

Closes #209
Closes #207
Closes #201
Closes #197
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

Successfully merging a pull request may close this issue.

1 participant