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

Provide error information directly when class definition loading fails #16898

Merged

Conversation

dolezvo1
Copy link
Contributor

Copy link

welcome bot commented Jul 13, 2024

Thanks for opening this pull request! Now continious integration (CI) will build Pharo with your change and run all tests. This might fail due to many reasons! Please check if your PR breaks the build or makes tests fail. Feel free to add comments to the PR. After this, before your PR can be merged it needs one or more reviews. Do not hesitate to ask people (on the Mailinglist or Discord) to help! When the CI shows no problems and there are positive reviews, your PR will be merged.

@dolezvo1
Copy link
Contributor Author

dolezvo1 commented Jul 13, 2024

I think the original code might be wrong in a slight way, as indicated by the note that a second pass might fix the errors. Perhaps this would be fixed if the terminating condition in loadClassDefinitions checked equivalence of the collected errors as opposed to only checking the number of the collected errors?

@Ducasse
Copy link
Member

Ducasse commented Jul 14, 2024

Please notice that I'm not sure that Pharo use the Metacello repository

@Ducasse Ducasse requested a review from guillep July 14, 2024 16:59
@jecisc
Copy link
Member

jecisc commented Jul 14, 2024

I changed this code in P12. I don't have time to review now but I'll review it next week

@Ducasse
Copy link
Member

Ducasse commented Jul 14, 2024

Tx Cyril :)

@jecisc
Copy link
Member

jecisc commented Jul 15, 2024

I think the original code might be wrong in a slight way, as indicated by the note that a second pass might fix the errors. Perhaps this would be fixed if the terminating condition in loadClassDefinitions checked equivalence of the collected errors as opposed to only checking the number of the collected errors?

Checking the size should be enough because we will not load definitions in the n+1 pass that was not already present in the n pass of the loading. So we don't need to check for equivalences

Copy link
Member

@jecisc jecisc left a comment

Choose a reason for hiding this comment

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

I just have one little code cleaning I suggested, except that, the changes seems good to me

Comment on lines +250 to +257
errorsDict keysDo: [ :ea |
s
space;
space;
nextPutAll: ea summary;
nextPutAll: ' (';
nextPutAll: ((errorsDict at: ea) description asString);
nextPutAll: ')';
Copy link
Member

@jecisc jecisc Jul 15, 2024

Choose a reason for hiding this comment

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

Suggested change
errorsDict keysDo: [ :ea |
s
space;
space;
nextPutAll: ea summary;
nextPutAll: ' (';
nextPutAll: ((errorsDict at: ea) description asString);
nextPutAll: ')';
errorsDict keysAndValuesDo: [ :definition :error |
s
space;
space;
nextPutAll: definition summary;
nextPutAll: ' (';
nextPutAll: error description asString;
nextPutAll: ')';

Copy link
Member

Choose a reason for hiding this comment

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

@jecisc may be we should do your changes and integrate this PR

Copy link
Member

Choose a reason for hiding this comment

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

I don't have the rights to push my changes to this PR. I'll just integrate it. My changes were for readability only

@jecisc jecisc merged commit b4c245c into pharo-project:Pharo13 Aug 1, 2024
1 of 2 checks passed
Copy link

welcome bot commented Aug 1, 2024

Congrats on merging your first pull request! Do another one! We try to have a list of (relatively) easy issues here: https://github.com/orgs/pharo-project/projects/8.

GitHub
GitHub is where people build software. More than 100 million people use GitHub to discover, fork, and contribute to over 420 million projects.

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.

Insufficient debug info when Warning: The following definitions had errors while loading.
3 participants