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

#7407: Register package dependent packages #7412

Merged
merged 3 commits into from
Dec 26, 2024
Merged

Conversation

gamebox
Copy link
Collaborator

@gamebox gamebox commented Dec 25, 2024

A package that depended on another package would hang forever because nothing registered the other package as a module to load like it would with an App. This fixes that.

Closes #7407

@gamebox
Copy link
Collaborator Author

gamebox commented Dec 25, 2024

Cargo test and clippy pass locally

@gamebox gamebox added bug Something isn't working P-high High priority/frequency labels Dec 25, 2024
@smores56
Copy link
Collaborator

Have you tested this with real packages?

@gamebox
Copy link
Collaborator Author

gamebox commented Dec 25, 2024

Depends on what you mean by a real package. I built my own packages and had them depend on others. Do you have examples I should check out?

@smores56
Copy link
Collaborator

No, that works. I just meant packages instead of a Rust test, which wasn't added. I think if you got this working with your own packages, that gives me confidence that it'll work.

@gamebox
Copy link
Collaborator Author

gamebox commented Dec 25, 2024

How would I go about adding a test for this? And where would it live? load_internal? Work?

@gamebox
Copy link
Collaborator Author

gamebox commented Dec 26, 2024

Added a unit test for you @smores56

Comment on lines +1320 to +1323
let use_main = match header_type {
Package { .. } | App { .. } | Platform { .. } => true,
Module { .. } | Builtin { .. } | Hosted { .. } => false,
};
Copy link
Member

Choose a reason for hiding this comment

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

maybe localize to the usage site

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Couldn't find a way due to borrow issue without introducing clones

ayazhafiz
ayazhafiz previously approved these changes Dec 26, 2024
@smores56 smores56 enabled auto-merge December 26, 2024 17:00
@smores56 smores56 merged commit b0d1d16 into roc-lang:main Dec 26, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P-high High priority/frequency
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Roc docs hangs indefinitely for any package depending on another package
3 participants