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

Turbo gets stuck on circular dependencies #262

Closed
jakst opened this issue Dec 14, 2021 · 4 comments
Closed

Turbo gets stuck on circular dependencies #262

jakst opened this issue Dec 14, 2021 · 4 comments
Labels
kind: bug Something isn't working

Comments

@jakst
Copy link

jakst commented Dec 14, 2021

What version of Turborepo are you using?

1.0.9

Describe the Bug

Our monorepo contains a few circular dependencies. We are actively working to remove them, but have some more work to do there.

When running for example yarn turbo run build with config "dependsOn": ["^build"], turborepo will just get stuck after printing • Running lint in 89 packages. I assume it's going into an endless loop as CPU usage goes up significantly.

Expected Behavior

It would be nice if turbo threw a warning and exited gracefully on this. Preferably including a description of the dependency circle (can sometimes be several packages long).

To Reproduce

  • Init a new repo with turbo
  • Point two packages at each other in respective package.json
  • Make sure "build": { "dependsOn": ["^build"] } is set in the pipeline config
  • run yarn turbo run build
@jaredpalmer jaredpalmer added the kind: bug Something isn't working label Dec 14, 2021
@jaredpalmer
Copy link
Contributor

Probably regression from v0.7. On my phone right now, but yes, we should be checking for task graph validity and cycles prior to run.

We used to do this, but was possibly omitted accidentally during v0.8.5 scheduler refactor.

Will be a one liner.

@jaredpalmer jaredpalmer self-assigned this Dec 14, 2021
@betaorbust
Copy link

Just confirmed this in my own repo -- a circular dependency results in a hung task with the turbo process taking up 100% cpu 👍

@Pagebakers
Copy link

Having this issue too, although I don't have any direct circular dependencies in my local packages and I'm not sure how to figure out what the culprit is.

Building individual packages is super fast, within seconds. Running all with concurrency 1 or 10 takes more than 30 minutes with super high cpu load.

@jaredpalmer jaredpalmer removed their assignment Jan 3, 2022
@gsoltis
Copy link
Contributor

gsoltis commented Sep 1, 2022

This should be fixed, we now produce an error for circular dependencies that shows the cycle in question.

@gsoltis gsoltis closed this as completed Sep 1, 2022
sokra pushed a commit that referenced this issue Oct 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants