Tensor icon indicating copy to clipboard operation
Tensor copied to clipboard

Installation on Alpine and php 8.2+

Open Kabingeran opened this issue 9 months ago • 5 comments

Hi! Does not install on Alpine with php 8.2+ via pecl. Has anyone tried to install it?

Kabingeran avatar Apr 04 '25 13:04 Kabingeran

Hi @Kabingeran I don't think it compiles in Alpine. We had an Alpine environment set up in our CI pipeline and it failed to compile. Since we've shifted our focus away from Tensor and to contributing to NumPower (https://github.com/RubixML/numpower) I haven't had much of a reason to look into the issue further than that.

Here's the GitHub Actions logs for the last time we tried to run the compile workflow on Alpine with PHP 8.2

https://github.com/RubixML/Tensor/actions/runs/14185339324/job/40287690335

Is there something that stands out to you in those logs? I'd be happy to work with you to fix it.

andrewdalpino avatar Apr 09 '25 23:04 andrewdalpino

Please add Alpine. Otherwise, your package will not make it into most builds. It looks like you are passing the wrong argument type?

Kabingeran avatar Apr 10 '25 10:04 Kabingeran

/tmp/pear/temp/tensor/ext/kernel/require.c is part of Zephir, a third-party dependency we use to compile to a PHP extension. Perhaps this is an issue for them?

https://github.com/zephir-lang/zephir

The extension compiles fine on Ubuntu with PHP 8.2 and 8.3, not sure why you changed the title of this issue.

https://github.com/RubixML/Tensor/actions/runs/14185879466

andrewdalpino avatar Apr 11 '25 23:04 andrewdalpino

Why you use Zephir? This is an unnecessary dependence that brings problems. If this bug is not your responsibility, then who will work on it?

Kabingeran avatar Apr 13 '25 20:04 Kabingeran

Hi,

I’m trying to install Tensor 3.0.7 via PECL on Alpine Linux with PHP 8.3 (Docker image: php:8.3-fpm-alpine or dunglas/frankenphp:php8.3-alpine).

The build fails with the following error:

error: passing argument 1 of 'zval_ptr_dtor' from incompatible pointer type [-Wincompatible-pointer-types]
zval_ptr_dtor(zend_string_path);
             ^~~~~~~~~~~~~~~~
note: expected 'zval *' but argument is of type 'zend_string *'

This happens in kernel/require.c (and possibly other files) because the extension tries to call zval_ptr_dtor on a zend_string* rather than a zval*. This change in PHP’s internal API seems to have started in PHP 8.1+. Despite the PECL page stating that 3.0.7 supports up to PHP 8.3, the current codebase is not compatible.

Environment: • PHP 8.3.0 (Alpine Linux) • PECL tensor 3.0.7

Suggested next steps: • Review and update the codebase for compatibility with PHP 8.3 internal API changes (especially type handling in memory management functions). • Adjust the zval_ptr_dtor calls, and test across PHP 8.0, 8.1, 8.2, and 8.3.

Thanks!

rgr avatar Jul 26 '25 17:07 rgr