Imagick / imagick

๐ŸŒˆ The Imagick PHP extension ๐ŸŒˆ
http://pecl.php.net/imagick
Other
547 stars 138 forks source link

New release with PHP 8 support? #358

Closed dzuelke closed 2 years ago

dzuelke commented 3 years ago

Hi @Danack and others,

PHP 8.0.0 is getting really close and it looks like this extension supports it already.

All that's missing is a Git tag, and a release to PECL :)

Would be super if that could be done anytime soon so that e.g. PaaSes have a stable release version to provide to customers.

Thanks!

kowalski7cc commented 3 years ago

duplicate of #331

dzuelke commented 3 years ago

Sort of; I am specifically asking to just cut a release from what already works ;)

lzsiga commented 3 years ago

Couldn't compile imagick with PHP-8 either: the interface of extensions has been changed again.

stecklars commented 3 years ago

Considering that PHP 8.0 is about to be released, is there an update? That would be very helpful. Thanks :)

centminmod commented 3 years ago

yes please :)

vladislavtkachenko commented 3 years ago

@Danack We are looking forward to the release of Imagic, before tomorrow's php 8 release

waja commented 3 years ago

For all those brave ppl asking for a PHP8 compatible release: How about providing fixes and/or pull requests? Just complaining that something doesn't work which is provided free as beer does not work. OpenSource lives from contribution!

vladislavtkachenko commented 3 years ago

It's probably much easier for people who are familiar with the code and have developed it to make improvements than for those who are just reaping the benefits

Danack commented 3 years ago

waja wrote:

OpenSource lives from contribution!

Hmm. Actually I don't think it does. It's much more of a 'people need to be able to afford food and housing' problem than needing more contributors.

vladislavtkachenko wrote:

We are looking forward to the release of Imagic, before tomorrow's php 8 release

This maybe a cultural difference, but to me this is a aggravatingly passive aggressive tone to use. You are setting your expectation that you expect someone to do work for free on your preferred timeline.

vladislavtkachenko commented 3 years ago

Sorry if that sounded rude. I meant that the community uses the package and hopes to continue using it, but not everyone can make changes to fix some errors. And we hope for you. Thank you for your work, Danack

Danack commented 3 years ago

dzuelke wrote:

PaaSes have a stable release version to provide to customers.

David, I believe you work for a wholly owned subsidiary of a large multinational company that has approximately $17 billion in annual revenue.

I fully understand that having all the libraries that your customers need to upgrade to PHP 8 available on the day that PHP 8 launches would be of benefit to them, and also to your company.

It won't make any difference to the timeline of shipping a version that supports PHP 8, but if having OpenSource projects be maintained is of value to you, please look at sponsoring the work I do: https://github.com/sponsors/Danack Or you can contact me via email if for any reasons going through github sponsors is not desirable.

I'll write more elsewhere but to summarize; I do not enjoy supporting this library and I do not use this library. Which makes working on it be a thing that I wonder why I do.

dzuelke wrote:

I am specifically asking to just cut a release from what already works ;)

For the record, 'just' is a four letter word. My problem with it is that it is not a productive conversational technique. In this case it assumes that something is going to be simple, which means that the person who knows why something might be difficult has to push back, before the conversation even begins.

In this case, asking 'what else needs to be done for the release?' would have been more productive, and the answer would have been:

mkoppanen commented 3 years ago

Interesting to see Heroku open source strategy in action:

  1. Open an issue
  2. ???
  3. Profit!
dzuelke commented 3 years ago

Alright folks. Slow down.

First of all, apologies for the use of "just". I indeed meant it as "limited in scope to releasing the current state", not "finally fixing all the outstanding invisible issues".

The reasoning being that tagging a first release (there always are betas/RCs for this extension, which is great for this purpose) makes it easier for people to test it - mainly beacuse a pecl install becomes possible, so the barrier to building from source for many users is drastically lower, and it has a particular version attached to it, which makes it a lot easier for any services/platforms/tools that provide the extension (since it has a known number and stability, e.g. for Composer dependency usage), which all helps with broader testing.

The sole recent open issue that related to PHP 8 support, #331, said "should work now", and there were no obvious other outstanding issues reported on the repo, or e.g. issues that tracked the failing builds you're now mentioning, @Danack.

The most up to date information I had at the time when I opened this issue was that "it's fixed in master", with no indication that there were outstanding todos.

Todos I would of course be happy to dedicate personal and work time to help with where I could.

For example, you now created issue #362, and that's something I can probably indeed look at, as I was just recently attempting to track changes to resource limit handling in ImageMagick (AFAICT they're side effects of bugfixes in recent versions).

But if this sort of stuff isn't tracked anywhere and visible, I can't know about it. Nor can anybody else.

Which of course does not absolve me from first asking "what else needs to be done for this release?", as @Danack has rightfully reminded me!

Would it maybe be possible to create a milestone for the new release and assigning any outstanding issues and PRs to that milestone so that it's clear for me and others how to contribute to the effort?

Thanks!

dzuelke commented 3 years ago

@mkoppanen I'm sorry we haven't been able to show the same level of "giving back" to the PHP ecosystem so far as we have for, say, e.g. Ruby, whose creator (and others) we hired in 2011 to work on the language full-time.

As you can probably imagine, it's the very fact that we are now part of such a large organization that can sometimes make these things difficult.

That being said, like many other parts of our systems, the so-called buildpacks we create for language support on the Heroku platfporm are all open source, and used widely by not only competing free or commercial platforms, but also by open source alternatives like Dokku or Herokuish, which use our buildpacks and even the binaries we provide to let you run a self-hosted Heroku-like PaaS.

Meaning you can git push to your own infrastructure, and it'll use the ext-imagick builds we provide.

As you can probably imagine, these users will be asking for ImageMagick support for PHP 8 just as quickly as our (free or paying) customers, and they all will benefit from an eventual release.

Just in case that helps with the "???" portion of your comment.

Danack commented 3 years ago

Would it maybe be possible to create a milestone for the new release and assigning any outstanding issues and PRs to that milestone so that it's clear for me and others how to contribute to the effort?

No, not really. Throwing more staff at a task at the last minute doesn't make it go any quicker.

But if this sort of stuff isn't tracked anywhere and visible, I can't know about it. Nor can anybody else.

I've been hoping more people would help for over four years, but the problem is that managing other people is even more boring and annoying than just doing the work myself. In general, the prospect of having to divide up work only when it becomes a problem for other people sounds like exactly the wrong approach.

it's the very fact that we are now part of such a large organization that can sometimes make these things difficult.

Thank-you for apologising, but at the same time....the morality of the situation escapes me.

At a fundamental level, there is a horrible breakdown in allocation of resources to projects that businesses rely on. That's something large companies can address quite easily with cash money.

As I said, the release for PHP 8 will happen soon, regardless of funding. But I don't think OpenSource projects are sustainable long term, without companies that use them starting to fund them.

SoftCreatR commented 3 years ago

Building imagick from source works fine under PHP 8 (at least RC 3):

image

andypost commented 3 years ago

Just wanted to share results of build from commit 765649716faf3215b6ffca1b329e6a49aa42b24f It passed tests for 7 arches on Alpinelinux https://gitlab.alpinelinux.org/andypost/aports/-/pipelines/60590

pkly commented 3 years ago

Fails to build in docker running php8 alpine3-12

FROM php:8.0.0-fpm-alpine3.12

RUN printf "\n" | pecl install imagick
SoftCreatR commented 3 years ago

Fails to build in docker running php8 alpine3-12

FROM php:8.0.0-fpm-alpine3.12

RUN printf "\n" | pecl install imagick

There is no PECL release of imagick for PHP 8. You'll need to build it by yourself.

waja commented 3 years ago

There is no PECL release of imagick for PHP 8. You'll need to build it by yourself.

And the question is "how?". Even pickle isn't able at the moment...

SoftCreatR commented 3 years ago

Shouldn't be that hard. I'll try it by myself and provide you the results, if I can make it work.

L3o-pold commented 3 years ago
git clone https://github.com/Imagick/imagick
cd imagick
phpize && ./configure
make
make install
SoftCreatR commented 3 years ago

While this is correct, it requires php-dev to be installed.

SoftCreatR commented 3 years ago

@waja My Docker experience is very limited. However, you may check this out:

https://gist.github.com/SoftCreatR/d3393d918407f0f9177f88147832e925

waja commented 3 years ago

My Docker experience is very limited. However, you may check this out:

@SoftCreatR I found some time to get it compiling, many thanks.

vladislavtkachenko commented 3 years ago

If the current master works with php 8, what do we need to be able to install the package via pecl?

SoftCreatR commented 3 years ago

Nothing but wait for a PECL release.

SoftCreatR commented 3 years ago

Sury has published a compatible (Debian/Ubuntu) package.

Danack commented 3 years ago

OpenSource lives from contribution!

Hmm. Actually I don't think it does.

@L3o-pold Thanks for posting that. At the same time.....

I've been trying to write some words about the state of OpenSource, and how the situation has changed from the 'old days' when people were more likely to make contributions. Part of that is due to how many different technologies people use every day and so can't be in a position to contribute back to all of them. Another part is how relatively few developers who use PHP also know C, compared to say the early 200x's. For both of those, it's hard to 'blame' people for not stepping up.

But another part is just that people are just out of practice of contributing. In this example, it would have been trivial for anyone reading those instructions to open a PR adding them to the readme.

Sury has published a compatible (Debian/Ubuntu) package.

Exciting. To be clear, that should be considered a fork; if nothing else, there are parameter name changes being worked on that are exposed in PHP 8 due to named parameters.

Github announced that it is now possible for companies to support OpenSource through the Github sponsors program.

Please can you tell whoever runs your company that the Github sponsors program is now available for companies. If companies depend on software, then it needs to be supported or it will either go away, or be absorbed by Microsoft who appear to be borging as much of the software ecosystem as they can.

https://github.com/sponsors/Danack

iquito commented 3 years ago

@Danack: While I understand your frustration, you don't come off sympathetic at all in this thread, because your anger dominates everything you write and respond to. I think that is a pity, because the issues you are having are important and worthy to be discussed, and many people like me will only have known about them from this thread, but the added layer of anger detracts from that.

Samnan commented 3 years ago

Tried to install myself first using pecl, it failed, found this issue. Cloned, ran phpize, configure, make, make install as mentioned earlier.

Imagick is back and i can keep working with my project as usual.

WELL DONE Team Imagick. Keep up the great work.

I just wonder why it is so difficult for any dev machine to clone and make.

bancer commented 3 years ago

I got this error while compiling PHP 8.0.1. I do not rush but would like to ask when should people expect this issue to be fixed.

creating libtool
appending configuration tag "CXX" to libtool
configure: patching config.h.in
configure: creating ./config.status
config.status: creating config.h
running: make
/bin/bash /tmp/pear/temp/pear-build-scrutinizeryoBhhT/imagick-3.4.4/libtool --mode=compile cc -I. -I/tmp/pear/temp/imagick -I/tmp/pear/temp/pear-build-scrutinizeryoBhhT/imagick-3.4.4/include -I/tmp/pear/temp/pear-build-scrutinizeryoBhhT/imagick-3.4.4/main -I/tmp/pear/temp/imagick -I/home/scrutinizer/.phpenv/versions/8.0.1/include/php -I/home/scrutinizer/.phpenv/versions/8.0.1/include/php/main -I/home/scrutinizer/.phpenv/versions/8.0.1/include/php/TSRM -I/home/scrutinizer/.phpenv/versions/8.0.1/include/php/Zend -I/home/scrutinizer/.phpenv/versions/8.0.1/include/php/ext -I/home/scrutinizer/.phpenv/versions/8.0.1/include/php/ext/date/lib -I/usr/include/ImageMagick  -DHAVE_CONFIG_H  -g -O2   -fopenmp -I/usr/include/ImageMagick   -c /tmp/pear/temp/imagick/imagick_file.c -o imagick_file.lo
mkdir .libs
 cc -I. -I/tmp/pear/temp/imagick -I/tmp/pear/temp/pear-build-scrutinizeryoBhhT/imagick-3.4.4/include -I/tmp/pear/temp/pear-build-scrutinizeryoBhhT/imagick-3.4.4/main -I/tmp/pear/temp/imagick -I/home/scrutinizer/.phpenv/versions/8.0.1/include/php -I/home/scrutinizer/.phpenv/versions/8.0.1/include/php/main -I/home/scrutinizer/.phpenv/versions/8.0.1/include/php/TSRM -I/home/scrutinizer/.phpenv/versions/8.0.1/include/php/Zend -I/home/scrutinizer/.phpenv/versions/8.0.1/include/php/ext -I/home/scrutinizer/.phpenv/versions/8.0.1/include/php/ext/date/lib -I/usr/include/ImageMagick -DHAVE_CONFIG_H -g -O2 -fopenmp -I/usr/include/ImageMagick -c /tmp/pear/temp/imagick/imagick_file.c  -fPIC -DPIC -o .libs/imagick_file.o
In file included from /tmp/pear/temp/imagick/imagick_file.c:22:0:
/tmp/pear/temp/imagick/php_imagick_file.h:61:108: error: expected โ€˜;โ€™, โ€˜,โ€™ or โ€˜)โ€™ before โ€˜TSRMLS_DCโ€™
 zend_bool php_imagick_file_init(struct php_imagick_file_t *file, const char *filename, size_t filename_len TSRMLS_DC);
                                                                                                            ^
/tmp/pear/temp/imagick/php_imagick_file.h:65:54: error: expected โ€˜;โ€™, โ€˜,โ€™ or โ€˜)โ€™ before โ€˜TSRMLS_DCโ€™
 int php_imagick_safe_mode_check(const char *filename TSRMLS_DC);
                                                      ^
In file included from /tmp/pear/temp/imagick/imagick_file.c:22:0:
/tmp/pear/temp/imagick/php_imagick_file.h:68:134: error: expected โ€˜;โ€™, โ€˜,โ€™ or โ€˜)โ€™ before โ€˜TSRMLS_DCโ€™
 php_imagick_rw_result_t php_imagick_read_file(php_imagick_object *intern, struct php_imagick_file_t *file, ImagickOperationType type TSRMLS_DC);
                                                                                                                                      ^
/tmp/pear/temp/imagick/php_imagick_file.h:71:153: error: expected โ€˜;โ€™, โ€˜,โ€™ or โ€˜)โ€™ before โ€˜TSRMLS_DCโ€™
 php_imagick_rw_result_t php_imagick_write_file(php_imagick_object *intern, struct php_imagick_file_t *file, ImagickOperationType type, zend_bool adjoin TSRMLS_DC);
                                                                                                                                                         ^
/tmp/pear/temp/imagick/php_imagick_file.h:74:112: error: expected โ€˜;โ€™, โ€˜,โ€™ or โ€˜)โ€™ before โ€˜TSRMLS_DCโ€™
 zend_bool php_imagick_stream_handler(php_imagick_object *intern, php_stream *stream, ImagickOperationType type TSRMLS_DC);
                                                                                                                ^
/tmp/pear/temp/imagick/imagick_file.c:81:51: error: expected โ€˜;โ€™, โ€˜,โ€™ or โ€˜)โ€™ before โ€˜TSRMLS_DCโ€™
 zend_bool php_imagick_is_url(const char *filename TSRMLS_DC)
                                                   ^
/tmp/pear/temp/imagick/imagick_file.c:91:108: error: expected โ€˜;โ€™, โ€˜,โ€™ or โ€˜)โ€™ before โ€˜TSRMLS_DCโ€™
 zend_bool php_imagick_file_init(struct php_imagick_file_t *file, const char *filename, size_t filename_len TSRMLS_DC)
                                                                                                            ^
/tmp/pear/temp/imagick/imagick_file.c:160:133: error: expected โ€˜;โ€™, โ€˜,โ€™ or โ€˜)โ€™ before โ€˜TSRMLS_DCโ€™
 int php_imagick_read_image_using_imagemagick(php_imagick_object *intern, struct php_imagick_file_t *file, ImagickOperationType type TSRMLS_DC)
                                                                                                                                     ^
/tmp/pear/temp/imagick/imagick_file.c:201:133: error: expected โ€˜;โ€™, โ€˜,โ€™ or โ€˜)โ€™ before โ€˜TSRMLS_DCโ€™
 int php_imagick_read_image_using_php_streams(php_imagick_object *intern, struct php_imagick_file_t *file, ImagickOperationType type TSRMLS_DC)
                                                                                                                                     ^
/tmp/pear/temp/imagick/imagick_file.c:255:54: error: expected โ€˜;โ€™, โ€˜,โ€™ or โ€˜)โ€™ before โ€˜TSRMLS_DCโ€™
 int php_imagick_safe_mode_check(const char *filename TSRMLS_DC)
                                                      ^
/tmp/pear/temp/imagick/imagick_file.c:269:134: error: expected โ€˜;โ€™, โ€˜,โ€™ or โ€˜)โ€™ before โ€˜TSRMLS_DCโ€™
 php_imagick_rw_result_t php_imagick_read_file(php_imagick_object *intern, struct php_imagick_file_t *file, ImagickOperationType type TSRMLS_DC)
                                                                                                                                      ^
/tmp/pear/temp/imagick/imagick_file.c:288:153: error: expected โ€˜;โ€™, โ€˜,โ€™ or โ€˜)โ€™ before โ€˜TSRMLS_DCโ€™
 php_imagick_rw_result_t php_imagick_write_file(php_imagick_object *intern, struct php_imagick_file_t *file, ImagickOperationType type, zend_bool adjoin TSRMLS_DC)
                                                                                                                                                         ^
/tmp/pear/temp/imagick/imagick_file.c:313:112: error: expected โ€˜;โ€™, โ€˜,โ€™ or โ€˜)โ€™ before โ€˜TSRMLS_DCโ€™
 zend_bool php_imagick_stream_handler(php_imagick_object *intern, php_stream *stream, ImagickOperationType type TSRMLS_DC)
                                                                                                                ^
make: *** [imagick_file.lo] Error 1
ERROR: `make' failed
SoftCreatR commented 3 years ago

You need to compile imagick manually from git.

davidlienhard commented 3 years ago

I used the following code to install the imagick extension in a docker-container based on php:8.0-cli & php:8.0-apache I used the IMAGICK_COMMIT to fix the state of the repo to always have the same state when building the image. Never used in production but maybe this helps for the moment.

# Imagick Commit to install
# https://github.com/Imagick/imagick
ARG IMAGICK_COMMIT="132a11fd26675db9eb9f0e9a3e2887c161875206"

RUN echo "**** install imagick php extension from source ****" && \
        cd /usr/local/src && \
        git clone https://github.com/Imagick/imagick && \
        cd imagick && \
        git checkout ${IMAGICK_COMMIT} && \
        phpize && \
        ./configure && \
        make && \
        make install && \
        cd .. && \
        rm -rf imagick && \
        docker-php-ext-enable imagick
mvorisek commented 3 years ago

@Danack the master branch works well with PHP8, would it be possible to tag the HEAD with a new tag and push to pecl as well? Thanks!

schuer commented 3 years ago

๐Ÿณ Docker: In case youโ€™re still waiting for a PECL release to feed your Dockerfile, master branch indeed works fine, and docker-php-ext-install will be the magic pony:

# install imagick
# use github version for now until release from https://pecl.php.net/get/imagick is ready for PHP 8
mkdir -p /usr/src/php/ext/imagick; \
curl -fsSL https://github.com/Imagick/imagick/archive/06116aa24b76edaf6b1693198f79e6c295eda8a9.tar.gz | tar xvz -C "/usr/src/php/ext/imagick" --strip 1; \
docker-php-ext-install imagick; \

Source: https://github.com/FriendsOfREDAXO/docker-redaxo/blob/master/php8.0/apache/Dockerfile

LucaDev commented 3 years ago

Please don't take this as an attack on you, but we've been waiting for a release for 2 months now. @Danack I understand your frustration, but I also don't see the point of supporting a project that I feel is no longer supporting me. Can you please create a release or at least say why a release is not possible at this time? Maybe then we can work together on the problems. It does seem to work without any issues for a lot of people.

Sweetchuck commented 3 years ago

@LucaDev (and to all the person who reacted with thumb-up):

but I also don't see the point of supporting a project that I feel is no longer supporting me.

This project have been supporting you for several years, during those years have you supported this project?

ToeiRei commented 3 years ago

You can always roll your own package and call it an '-rc' release @LucaDev.

LucaDev commented 3 years ago

@Sweetchuck To be honest, no. As a student with no income, I didn't have the financial means for it either, but that's not the point now. I think it's good that attention is being drawn to the issue. But I think it's the wrong way to go about it. I would love to support the project. I think companies that use it a lot could also benefit from paid support or something similar. But - and again this is not an accusation, but just my perception - holding back a release is the wrong way to generate attention.

@ToeiRei Of course I could do that, but in the end there are way more less tech-savvy users out there waiting for it as well.

ToeiRei commented 3 years ago

@LucaDev so you want me to believe a simple git checkout, ./configure, make, make install is too complicated for an average PC user who is trying to run bleeding edge PHP? Let me get this straight for you: even the common web apps are not all 100% capable of PHP8.

To stop your rants: what distro are those 'less tech-savvy users' missing the package the most so I can roll a package for you?

spackmat commented 3 years ago

@ToeiRei On a Windows dev machine it is way more than just a simple make. To be honest, I don't have any clue how to complile a PHP extension on Windows. So for my production environment, I could compile Imagick myself, but not for my dev environment. But I wouldn't be allowed to do that due to rules at my hosting that forbid the usage of non official releases of any dependency. (My solution was to remove the whole Imagick-dependency from that project, as I was lucky enough that it was used only for a simple thumbnailing service that works well with GD and a simple call to gs for PDFs. Took me just three hours to port that.)

For the held back release of Imagick it feels a bit like people depending on Imagick are held hostage to gain support for the project. I don't think thats the right way for such an important library, but I see the motivation and can accept that.

So to get back to a constructive discussion here: What exactly do you (the project maintainers) want the community to do? What has to happen to motivate you releasing a new version? Is this a financial thing? What amount of donations is needed to satisfy your needs? Do you want a sponsorship? So let's organize that. Or is this more about appreciation? What are the companies using Imagick in their projects supposed to do? Do you want someone to fork the project as you are not in the mood anymore to maintain it?

Please let us know so that we all can move forward.

bally86 commented 3 years ago

Does anybody know how to compile a dll for a PHP8 installation on a Windows machine? Is there any manual available?

bally86 commented 3 years ago

Does anybody know how to compile a dll for a PHP8 installation on a Windows machine? Is there any manual available?

Okay solved the problem. I compiled a PECL extension for PHP 8 NTS x64.

Installed the latest version of ImageMagick for Windows and followed these steps to compile the extension: https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2

unclepips commented 3 years ago

Hi Bally86 - would you be prepared to share this? I have looked at the link you posted, but it is beyond me I am afraid. Thanks in advance. Phil.

bally86 commented 3 years ago

Sure, You can download the DLL from https://drive.google.com/file/d/1S7wzZQsOciS3yRsj9c3K-IY-Cs_bqY0F/view?usp=sharing

It works with this version of ImageMagick: https://download.imagemagick.org/ImageMagick/download/binaries/ImageMagick-7.0.11-0-Q16-HDRI-x64-dll.exe

And it works with PHP8 64bit NTS

unclepips commented 3 years ago

Thank you so much Michiel :-) all downloaded, will set up my development server now with this and test it out.

Thanks again, Phil.

unclepips commented 3 years ago

Hi Michiel, Sorry to be a pain, is it possible to create a DLL for TS at all? On my development server I use Apache and PHP802 and have to use the TS version. I have tried your DLL but get the error saying it cannot load:

_PHP Warning: PHP Startup: Unable to load dynamic library 'imagick' (tried: d:/pampps/php802/ext/imagick (The specified module could not be found), d:/pampps/php802/ext/phpimagick.dll (The specified module could not be found)) in Unknown on line 0

The DLL is def. in the directory, so I am presuming that the DLL is for NTS and I have TS.

Thanks, Phil.

bally86 commented 3 years ago

Unfortunately I only have a NTS version.

unclepips commented 3 years ago

No problem, thank you for sharing the NTS one though :-)