Coder Social home page Coder Social logo

heroku-buildpack-vips's People

Contributors

alex88 avatar automata avatar bibendi avatar brandoncc avatar cstavish avatar danandreasson avatar erichmachado avatar jcupitt avatar jklina avatar jlaxson avatar jonathanong avatar jonnor avatar josephfrazier avatar mcgoooo avatar sgerrand avatar swrobel avatar wwarne avatar zackespry avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

heroku-buildpack-vips's Issues

Can't build sharp 0.32.6 with version 8.14.5

While following key instructions, I'm unable to build sharp on heroku.

Here is a basic repository that can be pushed to Heroku to reproduce the issue:

https://github.com/opencollective/sharp-libvips-buildpack

Error:

npm ERR! code 1
npm ERR! path /tmp/build_57817716/node_modules/sharp
npm ERR! command failed
npm ERR! command sh -c (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)
npm ERR! sharp: Detected globally-installed libvips v8.14.5
npm ERR! sharp: Building from source via node-gyp
npm ERR! 
npm ERR! make: Entering directory '/tmp/build_57817716/node_modules/sharp/build'
npm ERR!   CC(target) Release/obj.target/nothing/../node-addon-api/nothing.o
npm ERR! rm -f Release/obj.target/../node-addon-api/nothing.a Release/obj.target/../node-addon-api/nothing.a.ar-file-list; mkdir -p `dirname Release/obj.target/../node-addon-api/nothing.a
npm ERR! ar crs Release/obj.target/../node-addon-api/nothing.a @Release/obj.target/../node-addon-api/nothing.a.ar-file-list
npm ERR!   COPY Release/nothing.a
npm ERR!   TOUCH Release/obj.target/libvips-cpp.stamp
npm ERR!   CXX(target) Release/obj.target/sharp-linux-x64/src/common.o
npm ERR! make: Leaving directory '/tmp/build_57817716/node_modules/sharp/build'
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | linux | x64
npm ERR! gyp info find Python using Python version 3.10.12 found at "/usr/bin/python3"
npm ERR! gyp http GET https://nodejs.org/download/release/v20.10.0/node-v20.10.0-headers.tar.gz
npm ERR! gyp http 200 https://nodejs.org/download/release/v20.10.0/node-v20.10.0-headers.tar.gz
npm ERR! gyp http GET https://nodejs.org/download/release/v20.10.0/SHASUMS256.txt
npm ERR! gyp http 200 https://nodejs.org/download/release/v20.10.0/SHASUMS256.txt
npm ERR! gyp info spawn /usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args '/tmp/build_57817716/.heroku/node/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args 'binding.gyp',
npm ERR! gyp info spawn args '-f',
npm ERR! gyp info spawn args 'make',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/tmp/build_57817716/node_modules/sharp/build/config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/tmp/build_57817716/.heroku/node/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/app/.cache/node-gyp/20.10.0/include/node/common.gypi',
npm ERR! gyp info spawn args '-Dlibrary=shared_library',
npm ERR! gyp info spawn args '-Dvisibility=default',
npm ERR! gyp info spawn args '-Dnode_root_dir=/app/.cache/node-gyp/20.10.0',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=/tmp/build_57817716/.heroku/node/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=/app/.cache/node-gyp/20.10.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/tmp/build_57817716/node_modules/sharp',
npm ERR! gyp info spawn args '-Dnode_engine=v8',
npm ERR! gyp info spawn args '--depth=.',
npm ERR! gyp info spawn args '--no-parallel',
npm ERR! gyp info spawn args '--generator-output',
npm ERR! gyp info spawn args 'build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! readelf: Error: '/usr/local/lib/libvips-cpp.so': No such file
npm ERR! Package libgsf-1 was not found in the pkg-config search path.
npm ERR! Perhaps you should add the directory containing `libgsf-1.pc'
npm ERR! to the PKG_CONFIG_PATH environment variable
npm ERR! Package 'libgsf-1', required by 'vips', not found
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! <command-line>: warning: "_GLIBCXX_USE_CXX11_ABI" redefined
npm ERR! <command-line>: note: this is the location of the previous definition
npm ERR! In file included from ../src/common.cc:13:
npm ERR! /tmp/build_57817716/vendor/vips/include/vips/vips8:35:10: fatal error: glib-object.h: No such file or directory
npm ERR!    35 | #include <glib-object.h>
npm ERR!       |          ^~~~~~~~~~~~~~~
npm ERR! compilation terminated.
npm ERR! make: *** [sharp-linux-x64.target.mk:139: Release/obj.target/sharp-linux-x64/src/common.o] Error 1
npm ERR! gyp ERR! build error 
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack at ChildProcess.<anonymous> (/tmp/build_57817716/.heroku/node/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:209:23)
npm ERR! gyp ERR! System Linux 4.4.0-1104-aws
npm ERR! gyp ERR! command "/tmp/build_57817716/.heroku/node/bin/node" "/tmp/build_57817716/.heroku/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /tmp/build_57817716/node_modules/sharp
npm ERR! gyp ERR! node -v v20.10.0
npm ERR! gyp ERR! node-gyp -v v10.0.1
npm ERR! gyp ERR! not ok

Vips::Error VipsForeignSave in gif images (not a known file format)

Hello,

I'm using this buildpack in a Rails applications in Heroku. I managed to make it work but I'm having issues with gif images.

I get the error when dealing with gif images:

Vips::Error
VipsForeignSave: "/tmp/image_processing20210326-4-5xvus3.gif" is not a known file format

I found this thread exposing a similar issue and the proposed solution is to rebuild libvips with libmagick support.

I there a way to do that using this buildpack or should I do a fork instead?

Thanks!

Error: '/usr/src/vips/lib/libvips-cpp.so': No such file

Hey guys, I'm trying to use this buildpack to get PDF support for Sharp to work on Heroku. All goes well until Sharp tries to build from source and throws this error. Any idea what is causing this issue?

readelf: Error: '/usr/src/vips/lib/libvips-cpp.so': No such file gyp: Call to 'if readelf -Ws "$(PKG_CONFIG_PATH="/tmp/build_de8e195ae9ee65c6d0ee7803b4290341/.apt/usr/lib/x86_64-linux-gnu/pkgconfig:/tmp/build_de8e195ae9ee65c6d0ee7803b4290341/.apt/usr/lib/i386-linux-gnu/pkgconfig:/tmp/build_de8e195ae9ee65c6d0ee7803b4290341/.apt/usr/lib/pkgconfig::/tmp/build_de8e195ae9ee65c6d0ee7803b4290341/vendor/vips/lib/pkgconfig:/tmp/build_de8e195ae9ee65c6d0ee7803b4290341/.apt/usr/lib/x86_64-linux-gnu/pkgconfig:/tmp/build_de8e195ae9ee65c6d0ee7803b4290341/.apt/usr/lib/i386-linux-gnu/pkgconfig:/tmp/build_de8e195ae9ee65c6d0ee7803b4290341/.apt/usr/lib/pkgconfig::/usr/local/lib/pkgconfig:/usr/lib/pkgconfig" pkg-config --variable libdir vips-cpp)/libvips-cpp.so" | c++filt | grep -qF __cxx11;then echo "1";else echo "0";fi' returned exit status 0 while in binding.gyp. while trying to load binding.gyp

(mis)usage of heroku-buildpack-vips

Hi @brandoncc

TL;DR: will heroku-buildpack-vips support Ruby 3.0.3 any time soon? (or anything I can possibly do to help?)

LR: got my toes burned by going with the libvips on a new Rails project to be managed on-site with dokku - and learning that the standard ruby-buildpack does not help I was comforted by finding your work! But, alas, it seems (and I have to admit I know absolutely nothing of buildpacks, sadly) that we cannot use Ruby 3.0.3 - or at least that is what I take away from this:

src % git push staging staging:master
Enumerating objects: 3981, done.
Counting objects: 100% (3981/3981), done.
Delta compression using up to 8 threads
Compressing objects: 100% (3909/3909), done.
Writing objects: 100% (3981/3981), 3.56 MiB | 5.92 MiB/s, done.
Total 3981 (delta 2763), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (2763/2763), done.
-----> Cleaning up...
-----> Building greybox from herokuish
-----> Adding BUILD_ENV to build environment...
       BUILD_ENV added successfully
-----> Warning: Multiple default buildpacks reported the ability to handle this app. The first buildpack in the list below will be used.
       Detected buildpacks: multi ruby nodejs
-----> Multipack app detected
=====> Downloading Buildpack: https://github.com/brandoncc/heroku-buildpack-vips
=====> Detected Framework: vips (heroku-20 stack)
-----> Vendoring binaries
       Fetching /tmp/buildpackDneo5/build/heroku-20.tar.gz
-----> Configuring build environment
-----> Building runtime environment
-----> Discovering process types
       Procfile declares types -> web
-----> Releasing greybox...
-----> Checking for predeploy task
       No predeploy task found, skipping
-----> Checking for release task
       No release task found, skipping
-----> App Procfile file found
=====> Processing deployment checks
       No CHECKS file found. Simple container checks will be performed.
       For more efficient zero downtime deployments, create a CHECKS file. See https://dokku.com/docs/deployment/zero-downtime-deploys/ for examples
-----> Deploying greybox via the docker-local scheduler...
-----> Deploying web (count=1)
       Attempting pre-flight checks (web.1)
       Waiting for 10 seconds (web.1)
3a8beed3537b5710a50e0b8077133138cbefdb73b3d8372ea411a5f15e8e5b4b
remote:  !     App container failed to start (web.1)
=====> Start of greybox container output (web.1)
       /usr/lib/ruby/2.7.0/bundler/definition.rb:495:in `validate_ruby!': Your Ruby version is 2.7.0, but your Gemfile specified 3.0.3 (Bundler::RubyVersionMismatch)
        from /usr/lib/ruby/2.7.0/bundler/definition.rb:470:in `validate_runtime!'
        from /usr/lib/ruby/2.7.0/bundler.rb:143:in `setup'
        from /usr/lib/ruby/2.7.0/bundler/setup.rb:20:in `block in <top (required)>'
        from /usr/lib/ruby/2.7.0/bundler/ui/shell.rb:136:in `with_level'
        from /usr/lib/ruby/2.7.0/bundler/ui/shell.rb:88:in `silence'
        from /usr/lib/ruby/2.7.0/bundler/setup.rb:20:in `<top (required)>'
        from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
        from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
        from /app/config/boot.rb:3:in `<top (required)>'
        from bin/rails:3:in `require_relative'
        from bin/rails:3:in `<main>'
---8<---
       /usr/lib/ruby/2.7.0/bundler/definition.rb:495:in `validate_ruby!': Your Ruby version is 2.7.0, but your Gemfile specified 3.0.3 (Bundler::RubyVersionMismatch)
        from /usr/lib/ruby/2.7.0/bundler/definition.rb:470:in `validate_runtime!'
        from /usr/lib/ruby/2.7.0/bundler.rb:143:in `setup'
        from /usr/lib/ruby/2.7.0/bundler/setup.rb:20:in `block in <top (required)>'
        from /usr/lib/ruby/2.7.0/bundler/ui/shell.rb:136:in `with_level'
        from /usr/lib/ruby/2.7.0/bundler/ui/shell.rb:88:in `silence'
        from /usr/lib/ruby/2.7.0/bundler/setup.rb:20:in `<top (required)>'
        from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
        from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
        from /app/config/boot.rb:3:in `<top (required)>'
        from bin/rails:3:in `require_relative'
        from bin/rails:3:in `<main>'
=====> End of greybox container output (web.1)
remote: 2022/05/24 17:06:44 exit status 1
remote: parallel: This job failed:
remote: /var/lib/dokku/plugins/available/scheduler-docker-local/bin/scheduler-deploy-process-container greybox herokuish dokku/greybox:latest latest web 1 1
remote: 2022/05/24 17:06:45 exit status 1
remote: 2022/05/24 17:06:45 exit status 1
To greybox:greybox
 ! [remote rejected] staging -> master (pre-receive hook declined)
error: failed to push some refs to 'greybox:greybox'
?1 src % 

Update to libvips 8.15.0

The latest version of libvips is now 8.15.0 and the latest version of sharp (0.33.0) requires it.

I personally attempted to do it running: VIPS_VERSION=8.15.0 ./build.sh

And got the following error:

#13 4.181 The Meson build system
#13 4.181 Version: 1.3.0
#13 4.181 Source dir: /usr/local/src/libvips-8.15.0
#13 4.181 Build dir: /usr/local/src/libvips-8.15.0/build
#13 4.181 Build type: native build
#13 4.181 
#13 4.181 meson.build:1:0: ERROR: Value "false" (of type "string") for combo option "Build GObject introspection data" is not one of the choices. Possible choices are (as string): "enabled", "disabled", "auto".

AVIF not working out of the box

Using the heroku-22 stack, I got this error:

Vips::Error:
VipsForeignSave: "/tmp/image_processing20220629-52-veut21.avif" is not a known file format

Buildpacks:

1. heroku-community/apt
2. https://github.com/brandoncc/heroku-buildpack-vips
3. https://github.com/brian-kephart/heroku-buildpack-jemalloc.git
4. https://github.com/heroku/heroku-buildpack-activestorage-preview
5. heroku/ruby

Aptfile:

libglib2.0-0
libglib2.0-dev
libpoppler-glib8

VipsForeignLoad error converting PDF to PNG

I have been trying to use vips on heroku with this buildpack but I have been running into issues that I don't experience when running locally. I am trying to convert a pdf to a png and doing it from memory. I get this error:

Vips::Error (VipsForeignLoad: source is not in a known format)

It happens while running the following ruby code:

source = Vips::Source.new_from_memory(generate)
preview = Vips::Image.new_from_source(source, "")

I am thinking that perhaps there isn't the correct library installed for doing this conversion?

Locally I am running vips 8.10.1 but on heroku I seem to only be able to run 8.9.2 even if I set a VIPS_VERSION config var to 8.10.1.

I apologize for my ignorance with the low level code and installations going on to make all this magic happening. I was hoping that you might have more experience to point me in the right direction.

500's after latest changes

Since this morning i have started getting 500's on my heroku instance with the following error messages.

I assume its related to this change

2020-09-21T10:25:49.585977+00:00 app[web.1]: Could not open library 'libvips.so.42': libwebpmux.so.3: cannot open shared object file: No such file or directory):
2020-09-21T10:25:49.585978+00:00 app[web.1]: [87e314a0-905e-4c6f-b66c-117803df07ae]

HEIF/HEIC support seems broken

I've been trying to get HEIC/HEIF images working in both your buildpack as well as https://github.com/hardpixel/heroku-buildpack-vips, but to no avail. I noticed you opened libvips/libvips#1945 at one point but, presumably, you then got libheif working properly with Vips? Does it still work for you by any chance? I was trying to debug this in both buildpacks but couldn't figure it out. The other buildpack wasn't reporting any helpful info (aside from libheif being installed and listed places like vips --vips-config and vips -l. However, when I tried the same commands with your buildpack, I actually do get a warning about the heif module when trying to run any vips command. For example:

$ dokku run vips --vips-config

(process:13): VIPS-WARNING **: 18:51:11.173: unable to load "/app/vendor/vips/lib/vips-modules-8.14/vips-heif.so" -- libheif.so.1: cannot open shared object file: No such file or directory
enable debug: false
enable deprecated: true
enable modules: true
enable cplusplus: true
enable RAD load/save: true
enable Analyze7 load/save: true
enable PPM load/save: true
enable GIF load: true
use fftw for FFTs: true
accelerate loops with ORC: true
ICC profile support with lcms: true
zlib: true
text rendering with pangocairo: true
font file support with fontconfig: true
EXIF metadata support with libexif: true
JPEG load/save with libjpeg: true
JXL load/save with libjxl: false (dynamic module: false)
JPEG2000 load/save with OpenJPEG: false
PNG load/save with libspng: true
PNG load/save with libpng: false
selected quantisation package: imagequant
TIFF load/save with libtiff: true
image pyramid save with libgsf: true
HEIC/AVIF load/save with libheif: true (dynamic module: true)
WebP load/save with libwebp: true
PDF load with PDFium: true
PDF load with poppler-glib: false (dynamic module: false)
SVG load with librsvg: true
EXR load with OpenEXR: true
OpenSlide load: false (dynamic module: false)
Matlab load with libmatio: false
NIfTI load/save with niftiio: false
FITS load/save with cfitsio: false
GIF save with cgif: true
selected Magick package: MagickCore (dynamic module: true)
Magick API version: magick6
Magick load: true
Magick save: true

Did something maybe change in your Dockerfile after you originally added Vips support? I can reproduce these errors in a fresh Rails application simply by adding ruby-vips to the Gemfile and then adding your buildpack to index 1 before pushing to my Dokku server.

vips 8.9.2

There's a bug I'm experiencing that vips 8.9.2 fixed, so hoping to get this buildpack updated :) Thanks!

PDFs not working unless I add `poppler-utils` to Aptfile

Hi!

I have problems rendering PDFs in current setup on Heroku-20. It was fixed after I added poppler-utils to the Aptfile though not sure if this is recommended solution.

Regards,
Oskar

Aptfile

libglib2.0-0
libglib2.0-dev
libpoppler-glib8

Heroku log:

2022-04-27T08:35:47.163898+00:00 app[web.1]: I, [2022-04-27T08:35:47.163840 #4]  INFO -- : [d02f7f62-3b26-440c-a691-4e49980b8f90] Started GET "/documents" for *.*.*.* at 2022-04-27 08:35:47 +0000
2022-04-27T08:35:47.165023+00:00 app[web.1]: I, [2022-04-27T08:35:47.164969 #4]  INFO -- : [d02f7f62-3b26-440c-a691-4e49980b8f90] Processing by DocumentsController#index as */*
2022-04-27T08:35:47.253304+00:00 app[web.1]: I, [2022-04-27T08:35:47.253231 #4]  INFO -- : [d02f7f62-3b26-440c-a691-4e49980b8f90]   Rendered documents/index.jbuilder (Duration: 32.0ms | Allocations: 10605)
2022-04-27T08:35:47.253516+00:00 app[web.1]: I, [2022-04-27T08:35:47.253484 #4]  INFO -- : [d02f7f62-3b26-440c-a691-4e49980b8f90] Completed 500 Internal Server Error in 88ms (ActiveRecord: 16.6ms | Allocations: 13216)
2022-04-27T08:35:47.254363+00:00 app[web.1]: F, [2022-04-27T08:35:47.254328 #4] FATAL -- : [d02f7f62-3b26-440c-a691-4e49980b8f90]   
2022-04-27T08:35:47.254364+00:00 app[web.1]: [d02f7f62-3b26-440c-a691-4e49980b8f90] ActionView::Template::Error (ActiveStorage::UnrepresentableError):
2022-04-27T08:35:47.254365+00:00 app[web.1]: [d02f7f62-3b26-440c-a691-4e49980b8f90]      9: json.file do
2022-04-27T08:35:47.254365+00:00 app[web.1]: [d02f7f62-3b26-440c-a691-4e49980b8f90]     10:   json.child! do
2022-04-27T08:35:47.254365+00:00 app[web.1]: [d02f7f62-3b26-440c-a691-4e49980b8f90]     11:     json.size "thumb"
2022-04-27T08:35:47.254366+00:00 app[web.1]: [d02f7f62-3b26-440c-a691-4e49980b8f90]     12:     json.url document.file.representation(resize_to_limit: [200, 200]).processed.url
2022-04-27T08:35:47.254367+00:00 app[web.1]: [d02f7f62-3b26-440c-a691-4e49980b8f90]     13:   end
2022-04-27T08:35:47.254367+00:00 app[web.1]: [d02f7f62-3b26-440c-a691-4e49980b8f90]     14:   json.child! do
2022-04-27T08:35:47.254367+00:00 app[web.1]: [d02f7f62-3b26-440c-a691-4e49980b8f90]     15:     json.size "medium"
2022-04-27T08:35:47.254368+00:00 app[web.1]: [d02f7f62-3b26-440c-a691-4e49980b8f90]   
2022-04-27T08:35:47.254368+00:00 app[web.1]: [d02f7f62-3b26-440c-a691-4e49980b8f90] app/views/documents/_document.jbuilder:12
2022-04-27T08:35:47.254368+00:00 app[web.1]: [d02f7f62-3b26-440c-a691-4e49980b8f90] app/views/documents/_document.jbuilder:10
2022-04-27T08:35:47.254369+00:00 app[web.1]: [d02f7f62-3b26-440c-a691-4e49980b8f90] app/views/documents/_document.jbuilder:9
2022-04-27T08:35:47.254369+00:00 app[web.1]: [d02f7f62-3b26-440c-a691-4e49980b8f90] app/views/documents/index.jbuilder:1

Herok build log:

-----> Building on the Heroku-20 stack
-----> Using buildpacks:
       1. https://github.com/heroku/heroku-buildpack-apt
       2. https://github.com/brandoncc/heroku-buildpack-vips
       3. heroku/ruby
-----> Apt app detected
-----> Detected Aptfile or Stack changes, flushing cache
-----> Updating apt caches
       Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease
       Get:2 http://archive.ubuntu.com/ubuntu focal-security InRelease [114 kB]
       Get:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
       Hit:4 http://apt.postgresql.org/pub/repos/apt focal-pgdg InRelease
       Get:5 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [1,155 kB]
       Get:6 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [2,188 kB]
       Fetched 3,571 kB in 1s (3,854 kB/s)
       Reading package lists...
-----> Fetching .debs for libglib2.0-0
       Reading package lists...
       Building dependency tree...
       0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 15 not upgraded.
       Need to get 1,287 kB of archives.
       After this operation, 0 B of additional disk space will be used.
       Get:1 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libglib2.0-0 amd64 2.64.6-1~ubuntu20.04.4 [1,287 kB]
       Fetched 1,287 kB in 0s (11.2 MB/s)
       Download complete and in download only mode
-----> Fetching .debs for libglib2.0-dev
       Reading package lists...
       Building dependency tree...
       0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 15 not upgraded.
       Need to get 1,506 kB of archives.
       After this operation, 0 B of additional disk space will be used.
       Get:1 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libglib2.0-dev amd64 2.64.6-1~ubuntu20.04.4 [1,506 kB]
       Fetched 1,506 kB in 0s (12.3 MB/s)
       Download complete and in download only mode
-----> Fetching .debs for libpoppler-glib8
       Reading package lists...
       Building dependency tree...
       The following additional packages will be installed:
         libnspr4 libnss3 libpoppler97
       The following NEW packages will be installed:
         libnspr4 libnss3 libpoppler-glib8 libpoppler97
       0 upgraded, 4 newly installed, 0 to remove and 15 not upgraded.
       Need to get 2,388 kB of archives.
       After this operation, 8,363 kB of additional disk space will be used.
       Get:1 http://archive.ubuntu.com/ubuntu focal/main amd64 libnspr4 amd64 2:4.25-1 [107 kB]
       Get:2 http://archive.ubuntu.com/ubuntu focal-security/main amd64 libnss3 amd64 2:3.49.1-1ubuntu1.6 [1,256 kB]
       Get:3 http://archive.ubuntu.com/ubuntu focal/main amd64 libpoppler97 amd64 0.86.1-0ubuntu1 [915 kB]
       Get:4 http://archive.ubuntu.com/ubuntu focal/main amd64 libpoppler-glib8 amd64 0.86.1-0ubuntu1 [109 kB]
       Fetched 2,388 kB in 1s (2,890 kB/s)
       Download complete and in download only mode
-----> Installing libglib2.0-0_2.64.6-1~ubuntu20.04.4_amd64.deb
-----> Installing libglib2.0-dev_2.64.6-1~ubuntu20.04.4_amd64.deb
-----> Installing libnspr4_2%3a4.25-1_amd64.deb
-----> Installing libnss3_2%3a3.49.1-1ubuntu1.6_amd64.deb
-----> Installing libpoppler97_0.86.1-0ubuntu1_amd64.deb
-----> Installing libpoppler-glib8_0.86.1-0ubuntu1_amd64.deb
-----> Writing profile script
-----> Rewrite package-config files
-----> vips (heroku-20 stack) app detected
-----> Vendoring binaries
       Fetching /tmp/codon/tmp/buildpacks/9d9d827d88c1c1e37cae04f38ca711f444f443aa/build/heroku-20.tar.gz
-----> Configuring build environment
-----> Building runtime environment
-----> Ruby app detected
-----> Installing bundler 2.3.10
-----> Removing BUNDLED WITH version in the Gemfile.lock
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-3.1.2
-----> Installing dependencies using bundler 2.3.10

Bug in PATHs

Hi,

Firstly, thanks for this! From trying out a few vips build packs this seems to be the best and most current one!

I have found a bug in the way the PATHs are updated, and it seems the bug has been there a while. In fact its apparent in every build pack that uses the same bash vendor() function and there are a good few of them (at least 16 other build packs, see: https://github.com/search?l=&p=2&q=%22function+vendor%28%29+%7B%22+buildpack+language%3AShell&type=Code)

Effectively PATHs are constructed twice in the bin/compile script which results in the PATHs of previous build packs being backed into the environment setup script of the current build pack. This results in them appearing twice and out of order. I discovered it when using this with the python build pack and having /usr/local/bin appear before /app/.heroku/python/bin in the PATH with the wrong python being used.

My PATH was generated as:

/app/bin:/app/vendor/vips/bin:/app/.apt/usr/bin:/usr/local/bin:/usr/bin:/bin:/tmp/codon/vendor/bin:/app/.heroku/python/bin:/app/.heroku/node/bin:/app/.heroku/yarn/bin:/app/.apt/usr/bin:/usr/local/bin:/usr/bin:/bin:/app/bin:/app/node_modules/.bin

Note the repetition, out of order and /tmp/codon/vendor/bin which should not be there in the deployed slug, its an artefact from the build process (Herokus build playroom is called codon)

After fixing it we get this which is correct:

/app/bin:/app/vendor/vips/bin:/app/.heroku/python/bin:/app/.heroku/node/bin:/app/.heroku/yarn/bin:/app/.apt/usr/bin:/usr/local/bin:/usr/bin:/bin:/app/bin:/app/node_modules/.bin

I have fixed it in my fork here: samwillis@7e47b1d

Support for libwebp and libheif

Would it be easy to add support for libwebp and libheif to this buildpack?

I haven't fully understood Docker yet, so I haven't had much luck myself.

Do we actually need an Aptfile for libglib2.0?

The README specifies that we need to use apt to install these packages:

  • libglib2.0-0
  • libglib2.0-dev

However Heroku says that both of these are available by default and I have been running this buildpack for some time without installing them via Aptfile. I previously was only installing libpoppler-glib8 via Aptfile, and recently removed the apt buildpack altogether since that dependency isn't required, and all seems to be working well on my end.

Broken in heroku-20

Upgraded my stack to heroku-20 and started receiving this error whenever I tried using vips to process images:

Could not open library 'libvips.so.42': libMagickCore-6.Q16.so.3: cannot open shared object file: No such file or directory):

heroku vips wont build

I'm getting this error on Heroku.

Could not open library 'libvips.so.42': libpoppler-glib.so.8: cannot open shared object file: No such file or directory.

So I added an Aptfile with this content:

libglib2.0-0 libglib2.0-dev libpoppler-glib8

I also have these buildpacks in order:

https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku-community/apt.tgz
https://github.com/brandoncc/heroku-buildpack-vips.git
heroku/ruby

I don't want to switch back to imagemagick but I need to get this fixed to continue my build.

Heroku-22 support

I have been unsuccessful in getting this build pack to work in my Heroku app. After installing, I'm still getting the following error. I just realized this build pack supports up to Heroku-20 and I am running Heroku-22.

Do I need to downgrade or will support for Heroku-22 be out soon? Thanks!

Error:
Could not open library 'libvips.so.42': libvips.so.42: cannot open shared object file: No such file or directory)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.