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

Detect infinite dependencies #279

Merged
merged 11 commits into from
Oct 4, 2021

Conversation

emilyaherbert
Copy link
Contributor

@emilyaherbert emilyaherbert commented Sep 29, 2021

Closes #76

This PR adds code that checks for and detects infinite dependencies. In the event of circular or infinite dependencies, the compiler returns an error noting where the circular dependency is created.

@emilyaherbert emilyaherbert added the compiler General compiler. Should eventually become more specific as the issue is triaged label Sep 29, 2021
@emilyaherbert emilyaherbert self-assigned this Sep 29, 2021
@emilyaherbert emilyaherbert marked this pull request as ready for review October 1, 2021 00:07
@emilyaherbert
Copy link
Contributor Author

Compiling infinite_dependencies
Compiled library "stdlib".
 --> /Users/emilyherbert/fuel/sway/test/src/e2e_vm_tests/test_programs/infinite_dependencies/src 
1 | library foo;
2 | dep b_dependency;                                                            
  | ^^^^^^^^^^^^^^^^^ File a_dependency.sw generates an infinite depedency cycle.
3 |

 --> /Users/emilyherbert/fuel/sway/test/src/e2e_vm_tests/test_programs/infinite_dependencies/src 
1 | library foo;
2 | dep a_dependency;                                                            
  | ^^^^^^^^^^^^^^^^^ File b_dependency.sw generates an infinite depedency cycle.
3 |

Aborting due to 2 errors.

core_lang/src/error.rs Show resolved Hide resolved
core_lang/src/lib.rs Outdated Show resolved Hide resolved
core_lang/src/lib.rs Outdated Show resolved Hide resolved
core_lang/src/semantic_analysis/syntax_tree.rs Outdated Show resolved Hide resolved
@otrho
Copy link
Contributor

otrho commented Oct 3, 2021

I've thrown in a little commit which reversed the &mut BuildConfig changes, and now the diff is pretty much just the additions for the dependency graph and the internal check.

@emilyaherbert emilyaherbert merged commit e0c043b into master Oct 4, 2021
@emilyaherbert emilyaherbert deleted the emilyaherbert-76/infinite-dependencies branch October 4, 2021 00:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler General compiler. Should eventually become more specific as the issue is triaged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Detect infinite dependencies
2 participants