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

fix: packaging breaks on cyclic dependencies #94

Merged
merged 1 commit into from
Jan 29, 2024

Conversation

notdryft
Copy link
Member

Motivation:

  • grpc-java has two modules that depend on each other, causing circular recursion on the collectDepAndChildren function

Modification:

  • stop the recursion if the accumulator already contains a dependency

Result:

  • stackoverflowless

Motivation:

- grpc-java has two modules that depend on each other, causing circular
  recursion on the collectDepAndChildren function

Modification:

- stop the recursion if the accumulator already contains a dependency

Result:

- stackoverflowless
acc.add(dep)
for (child in dep.children) {
collectDepAndChildren(child, acc)
if (!acc.contains(dep)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So cool.
But I'm just wondering how the user end up in this situation, compilers don't like cyclic dependencies in my memories, I'm curious to know how such a jar is generated.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The scope of these dependencies is runtime, not compile.

Copy link
Member

@slandelle slandelle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@notdryft notdryft merged commit 5e055d6 into main Jan 29, 2024
1 check passed
@notdryft notdryft deleted the cyclic-dependencies-fix branch January 29, 2024 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants