Skip to content

PHPC-2128: Create stub file for functions #1349

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 2 commits into from
Aug 26, 2022

Conversation

alcaeus
Copy link
Member

@alcaeus alcaeus commented Aug 23, 2022

PHPC-2128

This adds the last stub file needed to no longer have to write arginfo definitions ourselves. However, there's a small catch to it: due to the way gen_stub.php generates the code, the function entries are not prefixed with their namespace (unlike for methods where they are prefixed by the class name, which includes the namespace). This essentially means that as soon was we want to have a function with one name in two separate namespaces, the autogenerated file will no longer work, as shown in this gist.

I'm fine with this for now and am working to improve gen_stub upstream to fix this issue; however we can also defer this until the upstream script is fixed.

@alcaeus alcaeus requested review from jmikola and levon80999 August 23, 2022 11:07
@alcaeus alcaeus self-assigned this Aug 23, 2022
@alcaeus
Copy link
Member Author

alcaeus commented Aug 23, 2022

The naming issue upstream is fixed by php/php-src#9406.

Copy link
Member

@jmikola jmikola left a comment

Choose a reason for hiding this comment

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

Minor suggestions but LGTM.

Is the plan to merge this now and then regenerate after php/php-src#9406 is merged? If so, do you want to create a separate tracking ticket for that?

@alcaeus alcaeus force-pushed the feature/phpc-2128 branch from 4c48866 to ce3d66f Compare August 25, 2022 07:13
@alcaeus alcaeus force-pushed the feature/phpc-2128 branch from ce3d66f to 821b577 Compare August 25, 2022 07:14
@alcaeus
Copy link
Member Author

alcaeus commented Aug 25, 2022

Is the plan to merge this now and then regenerate after php/php-src#9406 is merged? If so, do you want to create a separate tracking ticket for that?

If the PR to php-src is merged today, I'd make the changes to avoid circling back to this, but if the PR is delayed I'd merge this down and create a separate ticket for making the changes.

@jmikola
Copy link
Member

jmikola commented Aug 26, 2022

I'll leave this for you to merge on your own time.

@alcaeus
Copy link
Member Author

alcaeus commented Aug 26, 2022

Merging now since the PR might take a few more days to be merged. For reference, changes to the stub generation script don't automatically cause a regeneration of the arginfo files, as the stub file hash stored in the arginfo file is not dependent on the generation script. Changes to the script will only take effect when the stub file changes, which protects us from these BC breaks happening randomly.

@alcaeus alcaeus merged commit 2b03e66 into mongodb:master Aug 26, 2022
@alcaeus alcaeus deleted the feature/phpc-2128 branch August 26, 2022 09:37
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