Skip to content

make leaner bindings #63

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 5 commits into from
Dec 5, 2022
Merged

Conversation

gdamjan
Copy link
Contributor

@gdamjan gdamjan commented Nov 17, 2022

iterate over the php include directories, and update the builder to only create bindings from the header files in those directories. This omits all of the other non-php related types and functions from the bindings, and avoids the need to explicitly add hundreds of functions to the blocklist.

With that php_bindings.rs also become 14000 lines smaller
48803 php_bindings.rs.old
34222 php_bindings.rs

also fixed compile errors related to the _Float64x type no functions using it are in the bindings any more

iterate over the php include directories, and update the builder
to only create bindings from the header files in those directories

php_bindings.rs become 14000 lines smaller
48803 php_bindings.rs.old
34222 php_bindings.rs

also fixed compile errors related to the _Float64x type
no functions using it are in the bindings any more
@gdamjan
Copy link
Contributor Author

gdamjan commented Nov 17, 2022

just an example of the compile failures before this patch

❯ cargo build
   Compiling phper-sys v0.5.1 (/home/damjan/src/phper/phper-sys)
error[E0412]: cannot find type `_Float64x` in this scope
     --> /home/damjan/src/phper/target/debug/build/phper-sys-caf06ff3c34bff86/out/php_bindings.rs:10412:30
      |
3040  | pub type _Float64 = f64;
      | ------------------------ similarly named type alias `_Float64` defined here
...
10412 |     pub fn fminimumf64x(__x: _Float64x, __y: _Float64x) -> _Float64x;
      |                              ^^^^^^^^^ help: a type alias with a similar name exists: `_Float64`

error[E0412]: cannot find type `_Float64x` in this scope
     --> /home/damjan/src/phper/target/debug/build/phper-sys-caf06ff3c34bff86/out/php_bindings.rs:10412:46
      |
3040  | pub type _Float64 = f64;
      | ------------------------ similarly named type alias `_Float64` defined here
...
10412 |     pub fn fminimumf64x(__x: _Float64x, __y: _Float64x) -> _Float64x;
      |                                              ^^^^^^^^^ help: a type alias with a similar name exists: `_Float64`

gdamjan added a commit to gdamjan/ruwstgi that referenced this pull request Nov 17, 2022
nothing much to see really

also, now waiting for
phper-framework/phper#63
@jmjoy
Copy link
Member

jmjoy commented Dec 2, 2022

I think you should pass the CI and then I can review it.

Copy link
Member

@jmjoy jmjoy left a comment

Choose a reason for hiding this comment

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

Thanks for your excellent work!

@jmjoy jmjoy merged commit 5f4fe4c into phper-framework:master Dec 5, 2022
@gdamjan gdamjan deleted the leaner-bindings branch December 5, 2022 04:46
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