-
Notifications
You must be signed in to change notification settings - Fork 53
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 caller() for PAR::Packer in modulinos packer #509
Conversation
in date/echo/factor/glob/units
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The check for 'main' is a bit weird here and we can't disallow that. That would be surprising to people who write a simple program and want to load one of the modulinos.
Is this something that PAR does that caller(1)
won't catch?
Note that this change makes t/factor/factor.t hang. |
Long story short : |
I'll raise another PR with all the code, so you can have the full picture. |
Somehow a commit "packer v1.32" has been added to this PR. |
If |
I don't know anything how packer works, so I don't have any advice to give there. Maybe people on /r/perl or Stackoverflow would know. |
To fix the issue with 'main' in modulinos : I've set |
bin/date
Outdated
@@ -22,7 +22,8 @@ my $VERSION = '1.0.4'; | |||
# prefer this if it is defined. | |||
my $TZ; | |||
|
|||
run(\@ARGV) unless caller(); | |||
# run if called directly, indirectly, directly par-packed, undirectly par-packed | |||
run(\@ARGV) if !caller() || caller(0) =~ /PerlPowerTools/ || caller(0) eq 'PAR' || caller(1) eq 'PAR'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why this is needed, but caller(0) is being evaluated twice, 1st by regex then by "eq". Would it be better to cover both PAR and PerlPowerTools in the regex?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this plan (with some fixes), but let's choose a namespace that only the packer stuff will use just to avoid possible conflicts. Something like PerlPowerTools::Packed that's not already in use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good ideas
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why this is needed, but caller(0) is being evaluated twice, 1st by regex then by "eq". Would it be better to cover both PAR and PerlPowerTools in the regex?
There are some layers and iterations of development on this line of code...
The latest changes are good. It looks like there's an unrelated files outside of bin/ that snuck in. If we can fix that up I think this request is good to go. |
Sorry, but where are the unrelated files? I don't find them. Another question : I've not yet committed the latest 'perlpowertools.exe' file itself. Should I do it, or will it be rebuilt automatically anyway? Thanks |
When I look at this PR in GitHub, there are 12 files changed. I figure that you merge something and some other files snuck in. As for rebuilding, I haven't set up anything to do anything with packer. If something needs to be rebuilt we'll have to figure that out. It might happen as part of the release GitHub action. |
The 12 files are changed as intended :
|
For this PR, you should only be fixing the files under bin/. This is the same thing I said before. I'm not going to merge the files outside of bin/ for this change, so the pull request needs to be fixed. |
Thanks! |
No description provided.