Skip to content

Porting/cmpVERSION.pl - Handle new modules as not an error #20936

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 1 commit into from
Mar 17, 2023

Conversation

atrodo
Copy link
Contributor

@atrodo atrodo commented Mar 16, 2023

Checking that a module version was bumped when .c/.h files are updated has an edge case where the previous version was unknown, notably when adding a new module to cpan/. The fix for this is to mark new modules as a new version in those cases

Checking that a module version was bumped when .c/.h files are updated has
an edge case where the previous version was unknown, notably when adding a
new module to cpan/. The fix for this is to mark new modules as a new version
in those cases
Copy link
Collaborator

@demerphq demerphq left a comment

Choose a reason for hiding this comment

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

LGTM, was there a specific test case that come up that I can use to test this with?

@atrodo
Copy link
Contributor Author

atrodo commented Mar 17, 2023

This change came up when I was working on #20739. After I added Net::SSLeay, t/porting/cmp_version.t would fail saying that there was no versions bumped but files were modified. The error is not specific to Net::SSLeay, it is for any new package added that has .c/.h files included, even though I suspect that occurrence would be rare.

I tried to find a simple way to add Net::SSLeay to have see the error, but the most reliable instructions appear to be cherry-picking the first commit of #20739, 0a1795a, and running Porting/cmpVERSION.pl. For me, running that displays:

$ Porting/cmpVERSION.pl --tap
1..5
#
# Comparing against v5.37.8 ....
#
ok 1 - SKIP Can't parse $VERSION in cpan/Net-SSLeay/inc/Test/Net/SSLeay.pm
ok 2 - SKIP Can't parse $VERSION in cpan/Net-SSLeay/inc/Test/Net/SSLeay/Socket.pm
ok 3 - SKIP Can't parse $VERSION in cpan/Net-SSLeay/lib/Net/SSLeay.pm
ok 4 - SKIP Can't parse $VERSION in cpan/Net-SSLeay/lib/Net/SSLeay/Handle.pm
# No versions bumped in cpan/Net-SSLeay but 1 file was modified
# cpan/Net-SSLeay/constants.c
not ok 5 - in cpan/Net-SSLeay 1 file was modified but no versions were bumped
# not ok 5 - in cpan/Net-SSLeay 1 file was modified but no versions were bumped

Adding in this PR, that last error becomes ok.

@demerphq demerphq merged commit c1cac03 into Perl:blead Mar 17, 2023
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.

2 participants