-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fixes to phar stub #10706
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
base: PHP-8.1
Are you sure you want to change the base?
Fixes to phar stub #10706
Conversation
There were a couple of issues with the phar stub. It seems that in the past people did not realise they had to change shortarc.php and run makestub.php to generate the stubfile and instead they modified stub.h manually. This meant that there were a couple of mistakes in the stub which are fixed in this patch. In particular: * The title tag was not closed * The length of the stub was wrong in stub.h * This PR syncs previous changes to stub.h back to shortarc.php and vice versa. * Adds a note such that hopefully no mistakes against updating the stubs are made in the future (hopefully). * The makestub.php script was actually broken because the expected signature of the stub got changed in b874f1a
fc4e36d
to
5ec502a
Compare
assert that in https://github.com/php/php-src/blob/master/.github/actions/verify-generated-files/action.yml with CI |
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.
This looks sensible but I don't know anything about phar tbh.
One question, is the change in file permission in makestub.php intended?
I don't know a lot about phar too tbh, so best to let someone with more knowledge about phar double check I guess... 😅
Yes. This is needed so we can conveniently run it from the command line and from the CI script (see my second commit) :) |
This PR has been stale for almost a year. I remember |
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.
This looks okay after a rebase to 8.2
|
||
static const int newstub_len = 6623; | ||
static const int newstub_len = 6625; |
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.
static const int newstub_len = 6625; | |
static const size_t newstub_len = 6625; |
For master maybe?
@@ -48,8 +49,10 @@ | |||
+----------------------------------------------------------------------+ | |||
*/ | |||
|
|||
static inline void phar_get_stub(const char *index_php, const char *web, size_t *len, char **stub, const int name_len, const int web_len) | |||
static inline zend_string *phar_get_stub(const char *index_php, const char *web, const int name_len, const int web_len) |
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.
static inline zend_string *phar_get_stub(const char *index_php, const char *web, const int name_len, const int web_len) | |
static inline zend_string *phar_get_stub(const char *index_php, const char *web, size_t name_len, size_t web_len) |
It could make sense to also rearrange the parameter order in master alongside this.
There were a couple of issues with the phar stub. It seems that in the past people did not realise they had to change shortarc.php and run makestub.php to generate the stubfile and instead they modified stub.h manually. This meant that there were a couple of mistakes in the stub which are fixed in this patch. In particular: