Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Switch extensions from IDL to HNI #1480

Open
simonwelsh opened this Issue · 24 comments
@simonwelsh

This is more a longish-term task list issue to help track migrating extensions from IDL to HNI. I'll try to keep it updated as the migration progresses and include hints/types/recommendations as I come across them.

As part of this I'm also tidying up some of the API where possible, trying to move away from Variant if only a single type's expected/returned and getting everything working with ZendParamMode.

I'm using 512ecad as an example of what to do.

Existing idl files:

My current observations: (please correct if these are wrong)

  • You can't use closures inside a systemlib.php
  • Type hint parameters and return types (see the aforementioned commit for examples)
  • Feel free to move C++ methods/functions into PHP if it makes sense and is easy to do so.
@staabm

doing all at once could make it really hard to review..?

@simonwelsh

Also, would be really boring to do ;)

I was thinking of using this more as organising/tracking and then doing one extension at a time (for instance, I'm currently doing ext/reflection) and keeping a record of things that I've discovered if others want to help.

@staabm

ah got it now... ;-).

@scannell

Thanks for working on this @simonwelsh!

@JoelMarcey
Owner

This is awesome. Making sure @ptarjan and @sgolemon are a permanent part of this thread too...

@ptarjan

Wow, awesome! I'd love if the IDL machinery died.

@jdelong and I were chatting about this, and migrating them is a great time to clean them as they move over.

  1. Move anything that can be done in PHP, into PHP (constant declaration, wrapper functions, anything that doesn't call C++)
  2. Remove any hand-rolled type checking
  3. Check the zend tests for any low hanging incompatibility fruit
This was referenced
@Pomyk

I started working on mongo, but it will take some time ;)

@aris

Hi all,

What is an IDL? What it's differents with HNI?

And I know about HNI from the last release note: Hhvm Native Interface -> Possibility to call c++ function from PHP.
But I still not sure about these two and can't found any documentation about them.

-Aris

@elgenie

Thanks for taking this on @simonwelsh . Are you using a script that reads in .idl.json and produces the .php declarations? If so, is that script checked in as part of these conversion commits?

@simonwelsh

@elgenie No, I'm doing it all by hand, basing of the PHP docs, then what the function actually returns. I've found that the IDL files aren't accurate enough to convert directly, so just deciding to skip the segfaults from mismatching types.

@WizKid

tools/docskel/docskel.php uses the Zend docs to create a HNI skeleton. At least I think that was the script I used when I created that start of mysqli. But @sgolemon should know more.

@simonwelsh

@WizKid Sweet, that'll save me copy+pasting the descriptions. Still have to manually do the signatures, given how many edge cases the signature in the docs doesn't cover. Or things like bzopen with completely undocumented (but tested) features (it can take an open file resource instead of a filename).

@WizKid

@simonwelsh Yea it is far from perfect but it usually give you a good start.

@igorastds

What's a reason for having Bountysource record for this one? Is it actual? (I can help with porting..)

@scannell

@igorastds: There is a lot of otherwise relatively thankless work to do here that, once complete, will allow us to clean up the extensions story. It is to encourage community assistance with that.

@dewyatt

These all-encompassing bug bounties are very off-putting.

@scannell

@dewyatt, we've provided the feedback to Bountysource that it would be better to have an integrated way to do this without creating 70 additional open issues on the project. Unfortunately there's no support for that at the moment.

@staabm

@simonwelsh do we need to add XSL 72ed649 to the todo-list?

@simonwelsh

@staabm Already have. Has put the amount merged back below 15% :(

@sgolemon sgolemon referenced this issue from a commit
@simonwelsh simonwelsh Convert ext/mysql to HNI
Part of #1480

Also includes the commit in #2024

Closes facebook/hhvm#2027

#2027

Reviewed By: @ptarjan

Differential Revision: D1220239

Pulled By: @fredemmott
a33595f
@staabm

@simonwelsh gd is missing in this list and was done by sarah in 5fc0301

@simonwelsh

@staabm This is a list of the IDL files. GD used image.idl.json.

@sgolemon sgolemon referenced this issue from a commit
@simonwelsh simonwelsh Convert ext/standard/class_object to HNI
Also moves get_called_class() out of function and into this, as that's
how the PHP docs groups it.

Part of #1480

Closes #1625

Reviewed By: @fredemmott

Differential Revision: D1248722

Pulled By: @ptarjan
3fe2a77
@mcuadros

@simonwelsh what do you think about port yaml ext to native? instead of ZendCompat? worth it?

@lowjoel

@simonwelsh #2471 will allow closures in systemlib.

@sgolemon sgolemon referenced this issue from a commit
@sgolemon sgolemon Convert ext/openssl to HNI
Summary: Part of #1480
Closes #2472

Reviewed By: @fredemmott

Differential Revision: D1288651
c9e36a6
@JoelMarcey JoelMarcey referenced this issue from a commit
@simonwelsh simonwelsh Convert ext/mcrypt to HNI
Summary: Part of #1480

The revert is my workaround for #1738, so probably shouldn't be merged. I'm just keeping it in here so I don't have to keep reverting it when something breaks in the tests ;)

Also adds a rasie_deprecation() function and changes raise_message() to call that for deprecation notices rather than a plain notice.
Closes #1760

Reviewed By: ptarjan, sgolemon

Subscribers: hphp-diffslists, ps

Differential Revision: D1331176

Pulled By: @JoelMarcey
eb1f20b
@JoelMarcey JoelMarcey referenced this issue from a commit
@simonwelsh simonwelsh Convert ext/memcached to HNI
Summary: Part of #1480
Closes #2421

Reviewed By: @ptarjan

Differential Revision: D1339030

Pulled By: @JoelMarcey
d882070
@JoelMarcey JoelMarcey referenced this issue from a commit
@simonwelsh simonwelsh Convert ext/session to HNI
Summary: Part of #1480
Closes #2332

Reviewed By: @ptarjan

Differential Revision: D1338645

Pulled By: @JoelMarcey
e3fcbc6
@JoelMarcey JoelMarcey referenced this issue from a commit
@simonwelsh simonwelsh Convert ext/imap to HNI
Summary: Part of #1480

Also makes the extension optional, so the libc-client dependency is now optional too (hooray!)
Closes #2731

Reviewed By: @ptarjan

Differential Revision: D1346062

Pulled By: @JoelMarcey
df92ec0
@JoelMarcey JoelMarcey referenced this issue from a commit
@simonwelsh simonwelsh Convert ext/standard/output to HNI
Summary: Part of #1480
Closes #2760

Reviewed By: @sgolemon

Differential Revision: D1349032

Pulled By: @JoelMarcey
cc8db5c
@facebook-github-bot facebook-github-bot referenced this issue from a commit
@simonwelsh simonwelsh Convert ext/memcache to HNI
Summary: Part of #1480
Closes #2795

Reviewed By: @ptarjan

Differential Revision: D1354168

Pulled By: @JoelMarcey
64d5962
@simonwelsh

50% of the IDL files are now gone :cake: :smile:

@facebook-github-bot facebook-github-bot referenced this issue from a commit
@simonwelsh simonwelsh Convert ext/mysql to HNI
Summary: Part of #1480

Also includes the commit in #2024
Closes #2027

Reviewed By: ptarjan, joelm

Differential Revision: D1410521

Pulled By: @fredemmott
2bcb8e0
This was referenced
@hhvm-bot hhvm-bot referenced this issue from a commit
@bauerj bauerj Move debugger from IDL to HNI
Summary: Part of #1480.

This moves the functions from `debugger.idl.json` to HNI.
Closes #3491

Reviewed By: @ptarjan

Differential Revision: D1502583

Pulled By: svcscm
3248bb2
@hhvm-bot hhvm-bot referenced this issue from a commit
@bauerj bauerj Move mailparse to HNI
Summary: This pull request moves the functions in mailparse.idl.json to HNI.

Also, `ezmlm_hash` now calculates the hash it should calculate.

Part of #1480
Closes #3505

Reviewed By: @ptarjan

Differential Revision: D1502587
fba842b
This was referenced
@hhvm-bot hhvm-bot referenced this issue from a commit
@bauerj bauerj Rewrite misc.idl.json to HNI
Summary: This pull request moves the functions in misc.idl.json to HNI.

Part of #1480
Closes #3525

Reviewed By: @fredemmott

Differential Revision: D1506187

Pulled By: @sgolemon
6901484
@hhvm-bot hhvm-bot referenced this issue from a commit
@Majkl578 Majkl578 Convert system/idl/function to HNI
Summary: Convert system/idl/function to HNI.
Also fixes compatibility with PHP, when func_get_arg() is called with non-integer parameter.

Part of #1480.
Closes #3942

Reviewed By: @​svcscm

Differential Revision: D1608060

Pulled By: @ptarjan
9283735
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.