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

Fix minor issues #6

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Conversation

a-shahba
Copy link

@a-shahba a-shahba commented Nov 7, 2024

Fixed two minor issues in the package

  • Dataset.pm declares %PDLtoHDF5fileMapping as a local variable, i.e. my %PDLtoHDF5fileMapping. However, this variable was already declared as a local one to the package (via our statement) at the top of the file. This will cause users' scripts with a shebang like #!/usr/bin/perl -w to print warning messages like

"my" variable %PDLtoHDF5fileMapping masks earlier declaration in same scope at /usr/lib/x86_64-linux-gnu/perl5/5.30/PDL/IO/HDF5/Dataset.pm line 197.

  • Package version in Makefile.PL is not consistent with the one in HDF5.pm. Because of this inconsistency when the user installs the package via cpanm (i.e. cpanm PDL::IO::[email protected]), incorrect package version will be embedded in the log message, which is misleading.

--> Working on PDL::IO::HDF5
Fetching http://www.cpan.org/authors/id/E/ET/ETJ/PDL-IO-HDF5-0.76.tar.gz ... OK
Configuring PDL-IO-HDF5-0.73 ... OK
Building and testing PDL-IO-HDF5-0.73 ...
OK
Successfully installed PDL-IO-HDF5-0.73
1 distribution installed

@mohawk2
Copy link
Member

mohawk2 commented Nov 12, 2024

Thank you for this! Please could you instead:

  • switch the licence to just "the same terms as Perl" (thereby not needing the complicated version stuff there)
  • also change the whole version thing from being in $meta_merge to just a WriteMakefile arg VERSION_FROM => 'HDF5.pm'

@mohawk2
Copy link
Member

mohawk2 commented Nov 12, 2024

I've allowed the CI, which will fail as PDL now needs 5.14+ so don't worry about that. I'm about to update the CI config, so please rebase this past that.

@a-shahba
Copy link
Author

I've allowed the CI, which will fail as PDL now needs 5.14+ so don't worry about that. I'm about to update the CI config, so please rebase this past that.

Implemented the suggested changes and rebased it past your changes to the CI yml file

@mohawk2
Copy link
Member

mohawk2 commented Nov 14, 2024

@a-shahba Thanks for accepting those suggestions. I see that you absolutely haven't rebased, but instead merged (a big clue is the word "merge" in one of the new commits). Please could you actually rebase, and force-push?

Makefile.PL Outdated
@@ -183,7 +183,7 @@ WriteMakefile(
# 'TEST_REQUIRES' => { PDL => '2.004' },
'PREREQ_PM' => { PDL => '2.004' },
'LICENSE' => 'perl',
'VERSION_FROM' => 'hdf5.pd',
'VERSION_FROM' => 'HDF5.pm',
Copy link
Member

Choose a reason for hiding this comment

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

My suggestion here was not supposed to be literal. This shows that you need to just not change this, and delete the explicit version-setting in the metadata. What you're telling it to do here is read from a file that doesn't exist until it's created by running make, which won't work from a fresh checkout or CPAN distro, because this change breaks the perl Makefile.PL stage, which is why the CI is failing.

Makefile.PL Outdated
@@ -155,7 +155,7 @@ my $meta_merge = {
},
},
resources => {
license => [ 'http://cpansearch.perl.org/src/CHM/PDL-IO-HDF5-0.73/COPYRIGHT' ],
license => [ 'the same terms as Perl' ],
Copy link
Member

Choose a reason for hiding this comment

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

This was also not supposed to be literal. Please look in the CPAN::Meta::Spec for how to actually execute this.

Makefile.PL Outdated
@@ -115,6 +115,7 @@ $LIBS .= " -lz" if($zLib);
$LIBS .= " -ljpeg" if($jpegLib);
$LIBS .= " -lm";


Copy link
Member

Choose a reason for hiding this comment

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

Please don't add random blank lines. However, deleting spurious whitespace from the end of lines as below is great!

@a-shahba
Copy link
Author

@a-shahba Thanks for accepting those suggestions. I see that you absolutely haven't rebased, but instead merged (a big clue is the word "merge" in one of the new commits). Please could you actually rebase, and force-push?

@mohawk2 I thought it would be enough for this PR to include your latest changes to the YAML file. I will rebase it shortly but I am curious why you prefer rebasing.

I read your comments and hopefully I got your points correctly this time. If not, no worries! Let me know what needs to be modified and I will do it.

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