Skip to content
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 broken assertion; minor other fixes #233

Merged
merged 1 commit into from
Feb 14, 2024

Conversation

uuf6429
Copy link
Contributor

@uuf6429 uuf6429 commented Feb 4, 2024

Oops, I just realised this change is basically the same as #207.

This could be merged sooner if the other PR needs more time to be finished (otherwise you can also close this PR, as you wish).

@@ -223,7 +223,7 @@ private static function getMarshaler(string $name, callable $callback): ?Closure
CData $hint,
?CData $data
) use (&$callback): void {
assert($numberOfParams === 0);
assert($numberOfParams === 1);
Copy link
Contributor Author

@uuf6429 uuf6429 Feb 4, 2024

Choose a reason for hiding this comment

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

This was causing a test to fail.

I saw that the other asserts checked the param count based on the commented signature - 1, so it looks like this one should have been 1.

As to why it doesn't break in git actions, my guess is that they are running against an older version of libvips? (I noted the if (FFI::atLeast(8, 9)) { on line 217)

Copy link
Contributor Author

@uuf6429 uuf6429 Feb 5, 2024

Choose a reason for hiding this comment

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

As to why it doesn't break in git actions, my guess is that they are running against an older version of libvips? (I noted the if (FFI::atLeast(8, 9)) { on line 217)

Actually, that doesn't seem to be the case. A slightly older successful build used libvips 8.12: https://github.com/libvips/php-vips/actions/runs/7757736861/job/21160084456#step:4:121

Maybe PHP is running in production mode in the GitHub actions, which disables assertions? If that's the case, @jcupitt shouldn't we enable enable them?

self::$library_major == $x && self::$library_minor == $y && self::$library_micro >= $z;
return self::$library_major > $x
|| (self::$library_major === $x && self::$library_minor > $y)
|| (self::$library_major === $x && self::$library_minor === $y && self::$library_micro >= $z);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think this fixes (or breaks) anything, but at least it should be clearer now.

@uuf6429 uuf6429 force-pushed the fix-broken-assertion branch from 46100f7 to e4f45d5 Compare February 4, 2024 14:17
@jcupitt
Copy link
Member

jcupitt commented Feb 5, 2024

Oops, I just realised this change is basically the same as #207.

Do you mean #231? I'm getting a bit lost here :(

@uuf6429
Copy link
Contributor Author

uuf6429 commented Feb 5, 2024

Oops, I just realised this change is basically the same as #207.

Do you mean #231? I'm getting a bit lost here :(

No no, you fixed the assertions in #207.

https://github.com/libvips/php-vips/pull/207/files#diff-7ba1b99b7a6b12a224cb86e5060a4b34530ad9a2c9fd224faa01845c97fddb34L226

I found that out after I had created the PR.

@jcupitt jcupitt merged commit 13ebba3 into libvips:master Feb 14, 2024
4 checks passed
@uuf6429 uuf6429 deleted the fix-broken-assertion branch February 14, 2024 18:59
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