这是indexloc提供的服务,不要输入任何密码
Skip to content

Handle cycles in package dependency graph #1050

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

Merged
merged 4 commits into from
Apr 14, 2022
Merged

Conversation

gsoltis
Copy link
Contributor

@gsoltis gsoltis commented Apr 13, 2022

Fixes #1002

Instead of hanging during graph traversal, we instead print out the list of packages that form a cycle and exit with exit code 1

@vercel
Copy link

vercel bot commented Apr 13, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Deployment Preview Updated
turbo-site Deployed View Apr 13, 2022 at 11:39PM (UTC)

@jaredpalmer
Copy link
Contributor

jaredpalmer commented Apr 13, 2022

On mobile, our DAG library has a .Validate method. Not sure if you knew. Ignore me if you did, will review in am

@gsoltis
Copy link
Contributor Author

gsoltis commented Apr 13, 2022

@jaredpalmer Ha, good call. The Validate method has almost the exact same code I just wrote. I'll use that instead.

@gsoltis
Copy link
Contributor Author

gsoltis commented Apr 13, 2022

Turns out Validate won't work for us after all. Validate requires a single root node, but we have a root for each package with no dependents (i.e. each app)

@kodiakhq kodiakhq bot merged commit 3a7ad7c into main Apr 14, 2022
@kodiakhq kodiakhq bot deleted the gsoltis/detect_cycles branch April 14, 2022 12:04
@Aaron-Pool
Copy link

@gsoltis So, I know this is going to sound stupid, but it happened to me today and was super frustrating, so I figured I'd post about it here. Long story short, I accidentally listed a package as a dependency of itself, and it caused turbo repo to hang but did not print the warning. I don't know if that's an edge case that this PR should cover, but it's worth noting that, if you accidentally do it, it's very hard to debug 🤷‍♂️

@gsoltis
Copy link
Contributor Author

gsoltis commented Apr 25, 2022

Huh, ok. I opened an issue for it: #1117

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 this pull request may close these issues.

turborepo hangs after building the first app
3 participants