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 libheif build #42

Merged
merged 12 commits into from
Sep 18, 2023
Merged

Fix libheif build #42

merged 12 commits into from
Sep 18, 2023

Conversation

brandoncc
Copy link
Contributor

@brandoncc brandoncc commented Sep 4, 2023

As reported in #41, the build was broken when I rebuilt the configuration to work with libvips 8.14 by using meson. I missed one variable rename, which caused the libheif shared library to be put in the wrong place.

I also updated the libheif build to remove unnecessary extras, per @jcupitt in #41 (comment)

Closes #41

John Cuppit (libvips creator and maintainer) found issues with the
heroku-built libheif and the compiled version of pdfium. He recommended
switching back to poppler as a result.

#41 (comment)
#41 (comment)
The stacks are getting more and more native libraries that we depend on
installed by Heroku. This allows us to remove them from our build and
just include the -dev packages that match the runtime packages that
Heroku installed.
@@ -39,7 +39,11 @@ RUN apt-get install -y \
libfftw3-dev \
libopenexr-dev \
libgirepository1.0-dev \
libmagickcore-dev
libmagickcore-dev \
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this needed? It might be safer without it.

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 know, to be honest. I think that this is used as a fallback for some file types, is that right? I've been worried about negatively affecting users of the buildpack by removing it, which is why I haven't. What do you think the chance of a negative impact is?

Copy link
Contributor

@jcupitt jcupitt Sep 18, 2023

Choose a reason for hiding this comment

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

It's still used for very minor things like BMP and ICO, but nothing more important than that I think.

Getting rid of imagemagick and its patchy security record was one of the drivers behind rails switching to libvips, so I think it probably shouldn't be part of the libvips build.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a great point, I didn't know that. I'm comfortable with that small chance of a negative impact 👍

libxml2-dev \
libfftw3-dev \
libopenexr-dev \
libgirepository1.0-dev \
Copy link
Contributor

Choose a reason for hiding this comment

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

you can skip this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, thanks for pointing that out. I searched for "intro" and didn't find anything...I forgot it was just gi.

libfftw3-dev \
libopenexr-dev \
libgirepository1.0-dev \
libmagickcore-dev \
Copy link
Contributor

Choose a reason for hiding this comment

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

this can go too

wget \
python3-pip \
ninja-build \
intltool \
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this can go

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 thought so, but wasn't sure. I guess I could have removed it and just looked for a failing build.


# clean and package
ARG STACK_VERSION
RUN cd $PREFIX \
&& rm -rf bin/gif* bin/orc* bin/gsf* bin/batch_* bin/vips-* \
&& rm -rf bin/vipsprofile bin/light_correct bin/shrink_width \
&& rm -rf bin/gif* \
Copy link
Contributor

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 is needed

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 thought it might have been needed for the cgif build, thanks for pointing that out. I see that bin/vipsprofile does still exist. You used to recommend deleting that, should we keep deleting it?

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh I missed that. Yes, I would delete vipsprofile too.

Copy link
Contributor

@jcupitt jcupitt left a comment

Choose a reason for hiding this comment

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

Sorry, I made a set of separate comments, I should have done a proper review

One of the drivers of Rails switching to libvips was the security risks
posed by imagemagick. It would be better if we don't add that risk back
to Rails apps by including it in the libvips build.
@brandoncc brandoncc merged commit afd3a8e into master Sep 18, 2023
@brandoncc brandoncc deleted the fix-libheif-build branch September 18, 2023 21:21
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.

HEIF/HEIC support seems broken
2 participants