Uploaded image for project: 'Gradle'
  1. Gradle
  2. GRADLE-944

StackOverflowError with circular multiproject dependency

    Details

    • Type: Bug
    • Status: Open
    • Resolution: Unresolved
    • Affects Version/s: 0.9
    • Fix Version/s: None

      Description

      So I mistakenly created a circular dependency amongst a multiproject, so proj A had:
      dependencies {
      compile project(':projB')

      { transitive = true }
      }

      and proj B had
      dependencies {
      compile project(':projA') { transitive = true }

      }

      Clearly this is user error, but probably it would be good if gradle would detect the problem in the dependency mapping and print a "circular depenency detected" message instead of the huge stack trace.

      FAILURE: Build aborted because of an internal error.

      • What went wrong:
        Build aborted because of an unexpected internal error. Please file an issue at: www.gradle.org.
      • Try:
        Run with -d option to get additional debug info.
      • Exception is:
        java.lang.StackOverflowError: null
        at java.util.HashMap$KeyIterator.<init>(HashMap.java:875)
        at java.util.HashMap$KeyIterator.<init>(HashMap.java:875)
        at java.util.HashMap.newKeyIterator(HashMap.java:889)
        at java.util.HashMap$KeySet.iterator(HashMap.java:921)
        at java.util.HashSet.iterator(HashSet.java:154)
        at java.util.AbstractCollection.toArray(AbstractCollection.java:124)
        at java.util.LinkedList.addAll(LinkedList.java:265)
        at java.util.LinkedList.addAll(LinkedList.java:242)
        at java.util.LinkedList.<init>(LinkedList.java:98)
        at org.gradle.api.internal.tasks.DefaultTaskDependency.getDependencies(DefaultTaskDependency.java:47)
        at org.gradle.api.internal.artifacts.dependencies.DefaultProjectDependency$2.getDependencies(DefaultProjectDependency.java:119)
        at org.gradle.api.internal.tasks.DefaultTaskDependency.getDependencies(DefaultTaskDependency.java:52)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$1.getDependencies(DefaultConfiguration.java:209)
        at org.gradle.api.internal.tasks.DefaultTaskDependency.getDependencies(DefaultTaskDependency.java:57)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$1.getDependencies(DefaultConfiguration.java:209)
        at org.gradle.api.internal.tasks.DefaultTaskDependency.getDependencies(DefaultTaskDependency.java:57)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$1.getDependencies(DefaultConfiguration.java:209)
        at org.gradle.api.internal.tasks.DefaultTaskDependency.getDependencies(DefaultTaskDependency.java:52)
        at org.gradle.api.internal.artifacts.dependencies.DefaultProjectDependency$2.getDependencies(DefaultProjectDependency.java:119)
        at org.gradle.api.internal.tasks.DefaultTaskDependency.getDependencies(DefaultTaskDependency.java:52)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$1.getDependencies(DefaultConfiguration.java:209)
        at org.gradle.api.internal.tasks.DefaultTaskDependency.getDependencies(DefaultTaskDependency.java:57)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$1.getDependencies(DefaultConfiguration.java:209)
        at org.gradle.api.internal.tasks.DefaultTaskDependency.getDependencies(DefaultTaskDependency.java:57)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$1.getDependencies(DefaultConfiguration.java:209)
        at org.gradle.api.internal.tasks.DefaultTaskDependency.getDependencies(DefaultTaskDependency.java:52)
        at org.gradle.api.internal.artifacts.dependencies.DefaultProjectDependency$2.getDependencies(DefaultProjectDependency.java:119)

        Issue Links

          Activity

          Hide
          crotwell Philip Crotwell added a comment -


          This might be related to GRADLE-766 and GRADLE-915

          Show
          crotwell Philip Crotwell added a comment - This might be related to GRADLE-766 and GRADLE-915
          Hide
          adammurdoch Adam Murdoch added a comment -

          This is the same as GRADLE-715.

          Show
          adammurdoch Adam Murdoch added a comment - This is the same as GRADLE-715 .
          Hide
          bmuschko Benjamin Muschko added a comment -

          As announced on the Gradle blog we are planning to completely migrate issues from JIRA to GitHub.

          We intend to prioritize issues that are actionable and impactful while working more closely with the community. Many of our JIRA issues are inactionable or irrelevant. We would like to request your help to ensure we can appropriately prioritize JIRA issues you’ve contributed to.

          Please confirm that you still advocate for your JIRA issue before December 10th, 2016 by:

          • Checking that your issues contain requisite context, impact, behaviors, and examples as described in our published guidelines.
          • Leave a comment on the JIRA issue or open a new GitHub issue confirming that the above is complete.

          We look forward to collaborating with you more closely on GitHub. Thank you for your contribution to Gradle!

          Show
          bmuschko Benjamin Muschko added a comment - As announced on the Gradle blog we are planning to completely migrate issues from JIRA to GitHub. We intend to prioritize issues that are actionable and impactful while working more closely with the community. Many of our JIRA issues are inactionable or irrelevant. We would like to request your help to ensure we can appropriately prioritize JIRA issues you’ve contributed to. Please confirm that you still advocate for your JIRA issue before December 10th, 2016 by: Checking that your issues contain requisite context, impact, behaviors, and examples as described in our published guidelines . Leave a comment on the JIRA issue or open a new GitHub issue confirming that the above is complete. We look forward to collaborating with you more closely on GitHub. Thank you for your contribution to Gradle!

            People

            • Assignee:
              Unassigned
              Reporter:
              crotwell Philip Crotwell
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:

                Development