Coder Social home page Coder Social logo

lovell / sharp-libvips Goto Github PK

View Code? Open in Web Editor NEW
175.0 10.0 97.0 427 KB

Packaging scripts to prebuild libvips and its dependencies - you're probably looking for https://github.com/lovell/sharp

License: Apache License 2.0

Shell 71.50% Dockerfile 22.06% CMake 6.44%

sharp-libvips's Introduction

Packaging scripts

libvips and its dependencies are provided as pre-compiled shared libraries for the most common operating systems and CPU architectures.

These are packaged and published to the npm registry under the @img organisation.

Creating a tarball

Most people will not need to do this; proceed with caution.

Run the top-level build script without parameters for help.

Linux

One build script is used to (cross-)compile the same shared libraries within multiple containers.

Windows

The output of libvips' build-win64-mxe static "web" releases are post-processed within a container.

macOS

Uses a macOS virtual machine hosted by GitHub to compile the shared libraries. The dylib files are compiled within the same build script as Linux.

  • x64 (native)
  • ARM64 (cross-compiled)

Dependency paths are modified to use the relative @rpath with install_name_tool.

WebAssembly

The scripts from wasm-vips are used to compile libvips and its dependencies as static Wasm libraries ready for further compilation into a single, statically-linked sharp shared library.

Licences

These scripts are licensed under the terms of the Apache 2.0 Licence.

The shared libraries contained in the tarballs are distributed under the terms of various licences, all of which are compatible with the Apache 2.0 Licence.

sharp-libvips's People

Contributors

abarisain avatar dennisameling avatar inukshuk avatar joschi avatar kleisauke avatar lovell avatar sumitd2 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  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  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  avatar  avatar  avatar  avatar  avatar

sharp-libvips's Issues

libpoppler addition

Since libvips can use libpoppler to open PDF, can it be added to this builds?

can't create avif using sharp-libvips 8.10.1-alpha2

I'm attempting to convert a jpeg to avif using sharp 0.26.1 and prebuilt libvips 8.10.1-alpha2, however it looks like the required symbols from libaom aren't being pulled into the shared libvips:

$ node
Welcome to Node.js v12.18.4.
Type ".help" for more information.
> const sharp = require('sharp')
undefined
> sharp('test.jpg').toFormat('heif').toFile('test.heif')
Promise { <pending> }
> node: symbol lookup error: /app/sharp-0.26.1/build/Release/../../vendor/8.10.1/lib/libvips.so.42: undefined symbol: aom_codec_av1_cx

am I jumping the gun and trying to do this before it's ready? =)

Building on Raspberry Pi fails

Upon fresh install of nodebb on Manjaro arm --

[pi@manjaro-arm:~/nodebb]$ rm ~/.npm/_libvips/libvips-8.7.0-linux-armv8.tar.gz                                              
[pi@manjaro-arm:~/nodebb]$ npm i sharp                                                                                      
                                                                                                                            
> [email protected] install /home/pi/nodebb/node_modules/sharp                                                                   
> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)        
                                                                                                                            
info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.7.0/libvips-8.7.0-linux-armv8.tar.gz    
prebuild-install WARN install No prebuilt binaries found (target=12.10.0 runtime=node arch=arm64 libc= platform=linux)      
gyp ERR! build error                                                                                                        
gyp ERR! stack Error: not found: make
 [...]
gyp ERR! System Linux 5.2.13-1-MANJARO-ARM
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/pi/nodebb/node_modules/sharp
gyp ERR! node -v v12.10.0
gyp ERR! node-gyp -v v5.0.2
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && 
node install/dll-copy)`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/pi/.npm/_logs/2019-09-21T00_10_39_296Z-debug.log

Android prebuilds?

Hi there! I'd like to run Sharp on Android, but Android doesn't support libvips by default. I've tried to install libvips via Termux, but the package hasn't been ported. Would you be opening to creating prebuilds for Android? I saw this workaround, but I'm concerned about compatibility (for Sharp and other native modules).

Thanks!

ARMv6: QEMU+Rust yak-shaving required for librsvg v2.42.0+

The pre-compiled ARMv6 binaries for libvips v8.6.1 and its dependencies include librsvg v2.40.19 rather than v2.42.0 due to the latter's dependence on the Rust toolchain.

Some Raspian-container-inside-a-QEMU-container-inside-an-Ubuntu-container magic is required to get this all working.

Can't rebuild using build script

Hello!
I tried to build linux-x64 version using build script but failed, because Debian Wheezy unsupported already. It can't add backports repo for wheeze, because it no longer exists.
Can you update, please, Dockerfile for actual version or suggest, what version to use.
Thank you!

docker ubuntu:latest error

Description

// The problem I encountered when using the gatsby library, 
// their libraries seem to depend on this library,
// It feels like a sharp problem.

gatsby-issues(#20393)

Steps to reproduce

# docker file 
FROM ubuntu:latest as builder

RUN apt-get update \
    && apt-get install -y python2.7 \
    && apt-get install -y python3.7 \
    && apt-get install -y python3-pip \
    && apt-get install -y libvips libvips-dev libvips-tools \
    && apt-get install -y glib2.0-dev \
    && apt-get install -y python-pip python-dev \
    && apt-get install -y curl

RUN rm /bin/sh && \
	ln -s /bin/bash /bin/sh

RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - \
    && apt-get install -y nodejs \
    && rm -rf /var/lib/apt/lists/*

RUN npm --version
RUN node -v

RUN npm i -g yarn

RUN npm i -g gatsby-cli
# Pull git project operation
...

RUN cd /tmp && yarn

// error

Expected result

  Be able to install successfully

Actual result

image

// Why did I install libvips and download it again?

// This package cannot be installed due to some network reasons in China, 
// so I chose to install libsvip with apt-get, but it seems to download the package again

image

Environment

gatsby-cli@latest

librsvg: attempt to enable pixbuf loader to allow nested SVGs

This is pretty tricky as it involves switching image format handling in gdk-pixbuf from builtin modules (static libraries) to external modules (shared libraries) and the relative path problems this will cause.

Linux:

Remove the --disable-pixbuf-loader and see what happens. Probably need to manually update the loader.cache file.

Windows:

Likely a similar approach to Linux but expect cross-compilation problems around the loader.cache entries.
https://github.com/jcupitt/build-win64/blob/master/8.7/vips.modules#L420

OS X:

The librsvg formula appears to have already shaved the loader.cache yak. Need to remove --without-modules from here too.

linuxmusl builds for Alpine, latest is only 8.7.0?

I mistakenly opened this issue at libvips repo.

Gist of it is an important fix for Alpine was included in 8.7.1(avoids issues writing to /tmp).

Could a new release be included(alongside sharp 0.21.2 which has a bugfix I'm looking forward to :) )

I know that this suggestion exists for building libvips on Alpine

apk add vips-dev fftw-dev build-base --update-cache \
    --repository https://alpine.global.ssl.fastly.net/alpine/edge/testing/ \
    --repository https://alpine.global.ssl.fastly.net/alpine/edge/main

However it's not compatible anymore on stable versions of Alpine, you must use alpine:edge. I believe this is due to edge switching to musl-libc while stable remains on musl. If you were building the binaries for Alpine this way previously, then perhaps a newer release on Alpine isn't an option?(well more work to do)

Libvips installation problem

I am trying to install sharp via NPM on my CentOS 7 and getting the error below:

[email protected] install: (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)`

I guess I need to install libvips. According to a post on Sharp's issue page, I need a libvips package equal to or more than 8.4.2. I have just downloaded "libvips-8.7.0-linux-x64.tar.gz" package to my server but have no idea how can I make it work. There are a bunch of *.so files. I added the path to environment variables but still not working.

The full error that I've been getting during the sharp installation is:

npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! [email protected] install: `(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2018-11-27T22_52_35_599Z-debug.log```

Custom-built vendored libvips complains about missing dependencies

I'm trying to compile my own libvips so that I can add support for other image formats.

This topic has been discussed in a few /lovell/sharp issues, which I've read, but I haven't been able to get things working.

What I've tried so far is cloning this repo, then adding (to lin.sh):

mkdir ${DEPS}/heif
curl -Ls https://github.com/strukturag/libheif/releases/download/v${VERSION_HEIF}/libheif-${VERSION_HEIF}.tar.gz | tar xzC ${DEPS}/heif --strip-components=1
cd ${DEPS}/heif
./autogen.sh
./configure --host=${CHOST} --prefix=${TARGET} --enable-static --disable-shared --disable-dependency-tracking
make install-strip

And then removing the --without-heif build flag from vips.

I then run ./build.sh 8.10.0 linux-x64

The build works (using Docker on a mac host), and it produces a tarball.. In a separate ubuntu docker image, I install sharp and then manually replace the contents of node_modules/sharp/vendor with what's in the tarball above.

I also had to change the libvips version in package.json

  "config": {
    "libvips": "8.10.0",
    "runtime": "napi",
    "target": 3
  }

I wrote a simple test script:

import * as sharp from 'sharp'

(async () => {

  await sharp(`./sample.heic`).toFormat('jpg').toFile('./sample.jpg')

})()

And when I run it, it complains that it can't find libffi. I then manually compiled and installed libffi, and then it complains that it can't find libjpeg:

/workspace/node_modules/sharp/lib/constructor.js:34
  throw new Error(error);
        ^
Error: 
Something went wrong installing the "sharp" module

libjpeg.so.8: cannot open shared object file: No such file or directory

- Remove the "node_modules/sharp" directory then run
  "npm install --ignore-scripts=false --verbose" and look for errors
- Consult the installation documentation at https://sharp.pixelplumbing.com/install
- Search for this error at https://github.com/lovell/sharp/issues

I could probably go on and install all libs manually, but this is probably a red flag. Isn't the custom vendor build I'm adding supposed to provide all of these?

The end goal is to be able to run this inside of google cloud functions, which will require some more work, but with this basic test failing I wanted to reach out for some feedback.

Thanks for putting this lib together 👍

Investigate SIMD-accelerated zlib implementations

It might be worth switching to a performance-oriented fork of the popular zlib library within the prebuild libvips binaries. Several companies have made zlib significantly faster by using modern CPU instructions (SSE, ARM NEON).

The zlib-ng project seems the most promising, it has merged the changes of both Cloudflare and Intel forks and cleans up the code in general. It's API / ABI compatible with zlib (when configured with --zlib-compat or -DZLIB_COMPAT=ON), so it can be used as a drop-in replacement (just like libjpeg-turbo).

There is no "stable" release for zlib-ng yet, so it might be too risky to migrate now. However, it's already been continuously fuzzed by OSS-Fuzz[1] and the Chromium / AOSP developers are also interested in switching to this fork[2][3].

I've already done some experiments with zlib-ng within the MXE-based Windows builds[4], and see a nice performance improvement by converting a 4,000 x 5,000 JPEG image to PNG with different compression values[5].

[1] https://github.com/google/oss-fuzz/tree/master/projects/zlib-ng
[2] https://crbug.com/687631
[3] https://groups.google.com/a/chromium.org/d/msg/blink-dev/T3rPfd6G6ps/l8pAk7gnBgAJ
[4] https://github.com/libvips/build-win64-mxe/tree/zlib-ng-experiment
[5] https://gist.github.com/kleisauke/879e3075a675c6f945dff3772d2ef0a3

Segmentation Fault on Ubuntu

Hi, having an interesting error when trying to build (and executing) a Docker image with this library, during the yarn install step.

info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.8.1/libvips-8.8.1-linuxmusl-x64.tar.gz
Segmentation fault (core dumped)
make: Entering directory '/usr/src/app/common/node_modules/sharp/build'
  TOUCH Release/obj.target/libvips-cpp.stamp
  CXX(target) Release/obj.target/sharp/src/common.o
  CXX(target) Release/obj.target/sharp/src/metadata.o
  CXX(target) Release/obj.target/sharp/src/stats.o
  CXX(target) Release/obj.target/sharp/src/operations.o
  CXX(target) Release/obj.target/sharp/src/pipeline.o
  CXX(target) Release/obj.target/sharp/src/sharp.o
  CXX(target) Release/obj.target/sharp/src/utilities.o
  SOLINK_MODULE(target) Release/obj.target/sharp.node
  COPY Release/sharp.node
make: Leaving directory '/usr/src/app/common/node_modules/sharp/build'

This error happens on Ubuntu 20.04.1 LTS. The same Docker container when run on Debian works fine. Do you have insight on why this could be happening?

Using node:10.18-alpine

Thanks for your help!

Node v14 not supported

Hi,

I've upgraded to Node v14 and I now can't install this library because there are no prebuilt binaries.

Here's the error that I'm getting

error /Users/k/code/svelte/alfred/node_modules/sharp: Command failed.
Exit code: 1
Command: (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
Arguments: 
Directory: /Users/k/code/svelte/alfred/node_modules/sharp
Output:
info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.9.0/libvips-8.9.0-darwin-x64.tar.gz
prebuild-install WARN install No prebuilt binaries found (target=14.0.0 runtime=node arch=x64 libc= platform=darwin)

Hope, it will resolve soon

Alpine 3.4.1 `Illegal instruction` via bundled vips

We've been using sharp 0.21.0 for a couple weeks w/o issue so not sure why this is just now coming up. We're using the same Docker image across multiple DC's and naturally a host of different hardware -- though all Intel based. Still digging in from our end to see what can be done, just not clear what changed so wanted to report here in case someone else is experiencing this. Perhaps related to spectre patching, but that's a shot in the dark at this point.

Build error on RHEL8 ppc64le … fatal error: vips/vips8: No such file or directory

Everything works on my MAC, but now I need to install on ppc64le running RHEL8. Looks like something is missing for building/compiling sharp-libvips on ppc64le architecture. Would you please help me resolve this issue?

[flame@flame02 auth-server]$ yarn install
yarn install v1.6.0
[1/4] Resolving packages...
[2/4] Fetching packages...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
[1/4] ⢀ ibm_db: 0.33% | 73728 bytes downloaded out of 22151131 bytes.
[2/4] ⢀ dtrace-provider: ok
[3/4] ⢀ sharp: CXX(target) Release/obj.target/sharp/src/common.o
[-/4] ⢀ waiting...
error /home/flame/auth-server/node_modules/sharp: Command failed.
Exit code: 1
Command: (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
Arguments:
Directory: /home/flame/auth-server/node_modules/sharp
Output:
info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.8.1/libvips-8.8.1-linux-ppc64.tar.gz
/home/flame/auth-server/node_modules/sharp/install/libvips.js:85
throw new Error(Status ${response.statusCode});
^

Error: Status 404
at /home/flame/auth-server/node_modules/sharp/install/libvips.js:85:17
at f (/home/flame/auth-server/node_modules/once/once.js:25:25)
at ClientRequest. (/home/flame/auth-server/node_modules/simple-get/index.js:63:5)
at Object.onceWrapper (events.js:300:26)
at ClientRequest.emit (events.js:210:5)
at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:583:27)
at HTTPParser.parserOnHeadersComplete (_http_common.js:115:17)
at TLSSocket.socketOnData (_http_client.js:456:22)
at TLSSocket.emit (events.js:210:5)
at addChunk (_stream_readable.js:309:12)
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | ppc64
gyp info find Python using Python version 2.7.5 found at "/usr/bin/python"
gyp info spawn /usr/bin/python
gyp info spawn args [
gyp info spawn args '/home/flame/.nvm/versions/node/v12.13.1/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/home/flame/auth-server/node_modules/sharp/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/home/flame/.nvm/versions/node/v12.13.1/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/home/flame/.cache/node-gyp/12.13.1/include/node/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/home/flame/.cache/node-gyp/12.13.1',
gyp info spawn args '-Dnode_gyp_dir=/home/flame/.nvm/versions/node/v12.13.1/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/home/flame/.cache/node-gyp/12.13.1/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/home/flame/auth-server/node_modules/sharp',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory /home/flame/auth-server/node_modules/sharp/build' TOUCH Release/obj.target/libvips-cpp.stamp CXX(target) Release/obj.target/sharp/src/common.o ../src/common.cc:25:10: fatal error: vips/vips8: No such file or directory #include <vips/vips8> ^~~~~~~~~~~~ compilation terminated. make: *** [Release/obj.target/sharp/src/common.o] Error 1 make: Leaving directory /home/flame/auth-server/node_modules/sharp/build'
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/home/flame/.nvm/versions/node/v12.13.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:210:5)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Linux 3.10.0-862.el7.ppc64le
gyp ERR! command "/home/flame/.nvm/versions/node/v12.13.1/bin/node" "/home/flame/.nvm/versions/node/v12.13.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/flame/auth-server/node_modules/sharp

GLIBC and AWS Lambda

We just tried to use libvips generated by ./build.sh 8.7.4 linux-x64 in AWS lambda and Sharp is failing with the following error:

Something went wrong installing the "sharp" module

/lib64/libc.so.6: version `GLIBC_2.18' not found (required by /opt/sharp/build/Release/../../vendor/lib/librsvg-2.so.2)

- Remove the "node_modules/sharp" directory, run "npm install" and look for errors
- Consult the installation documentation at https://sharp.pixelplumbing.com/en/stable/install/
- Search for this error at https://github.com/lovell/sharp/issues

Looks like commit acd9d57 introduces a dependency on GLIBC 2.19. However, AWS Lambda environment has v2.17.

Linux ARM64, align to 64k page size

I'm seeing this when starting a node.js app using sharp 0.25.3 and the pre-built arm64 sharp/libvips on an Amazon c6g.large EC2 instance:

Error:
Something went wrong installing the "sharp" module

libglib-2.0.so.0: ELF load command alignment not page-aligned

- Remove the "node_modules/sharp" directory then run
  "npm install --ignore-scripts=false --verbose" and look for errors
- Consult the installation documentation at https://sharp.pixelplumbing.com/install
- Search for this error at https://github.com/lovell/sharp/issues

    at Object.<anonymous> (/app/node_modules/sharp/lib/constructor.js:34:9)
    at Module._compile (internal/modules/cjs/loader.js:1138:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
    at Module.load (internal/modules/cjs/loader.js:986:32)
    at Function.Module._load (internal/modules/cjs/loader.js:873:16)
    at Function.wrappedLoad [as _load] (/app/node_modules/newrelic/lib/shimmer.js:481:24)
    at Module.require (internal/modules/cjs/loader.js:1026:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/app/node_modules/sharp/lib/index.js:3:15)
    at Module._compile (internal/modules/cjs/loader.js:1138:30)

The app is running in Docker using Ubuntu 20.04 and node.js 12.18.

I haven't had a chance to dig into it any further yet, but when I do I'll update this issue.

Recommendations / improvements

Hi Lovell,

Thanks for these packaging scripts! I intend to use this in the next version of NetVips (kleisauke/net-vips#21).

I've made a number of improvements to my fork that you might be able to integrate as well.

Recommendations / improvements:

  • There are a few unused shared libraries that could be removed (I didn't check the ARM* builds):

    Unused shared libraries

    In libvips-8.7.4-linux-x64.tar.gz:

    libharfbuzz-subset.so.0
    libwebpdemux.so.2
    

    In libvips-8.7.4-linuxmusl-x64.tar.gz:

    libasprintf.so.0
    libharfbuzz-subset.so.0
    libwebpdemux.so.2
    

    In libvips-8.7.4-darwin-x64.tar.gz:

    libasprintf.0.dylib
    libcairo-gobject.2.dylib
    libcairo-script-interpreter.2.dylib
    libharfbuzz-gobject.0.dylib
    libharfbuzz-icu.0.dylib
    libharfbuzz-subset.0.dylib
    liborc-test-0.4.0.dylib
    libpcre16.0.dylib
    libpcre32.0.dylib
    libpcrecpp.0.dylib
    libpcreposix.0.dylib
    libtiffxx.5.dylib
    libwebpdecoder.3.dylib
    libwebpdemux.2.dylib
    

    I fixed this by copying only the relevant shared libraries to the final lib/ directory using the ldd and otool commands (see here and here). This also removes all the symlinks in the packaging.

  • You might consider to use the build-win64-mxe distribution for Windows (see libvips/build-win64#22).

  • Perhaps we should experiment with building a statically linked library on Linux and OS X (I did the same for the Windows build). This may resolve conflicts with the system zlib in the future.

Some things I came across during the building process:

  • The OS X build currently fails on Travis with:
    Error: Options --build-from-source and --build-bottle are mutually exclusive.
    
    I removed the --build-bottle flag, but I'm not sure if it will still be built with -march=core2 (to ensure that it will work on non-AVX Intel CPUs).
  • The x64 musl build currently generates a non-working libuuid library (https://bugs.alpinelinux.org/issues/9947):
    $ ldd libvips.so.42
    ...
    Error relocating ./libuuid.so.1: getrandom: symbol not found
    
    I "duct tape" fixed this by copying your libuuid.so.1 to my final lib/ directory. We should keep an eye on that issue.

install libvips-cpp.so.42: cannot open shared object file: No such file or directory

This just started happening in our Test job running on a shared Gitlab runner. It's been working fine for months previously.

Any ideas?

> [email protected] install /builds/imkane/project/node_modules/sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)

info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.7.4/libvips-8.7.4-linux-x64.tar.gz
prebuild-install WARN install libvips-cpp.so.42: cannot open shared object file: No such file or directory
make: Entering directory '/builds/imkane/project/node_modules/sharp/build'
  TOUCH Release/obj.target/libvips-cpp.stamp
  CXX(target) Release/obj.target/sharp/src/common.o
../src/common.cc:25:22: fatal error: vips/vips8: No such file or directory
 #include <vips/vips8>
                      ^
compilation terminated.
sharp.target.mk:122: recipe for target 'Release/obj.target/sharp/src/common.o' failed
make: *** [Release/obj.target/sharp/src/common.o] Error 1
make: Leaving directory '/builds/imkane/project/node_modules/sharp/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2

Problem to use sharp / libvips on Docker / Dokku

Hello,

I'm trying to use the sharp module within a nodejs application and it works fine locally on Ubuntu. Now I want to deploy this application on our server as a dokku application. This application relies on a Dockerfile that initializes elements:

FROM node:8.9.0

# Create app directory
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app

# Install app dependencies
COPY package.json /usr/src/app/
RUN npm install

# Bundle app source
COPY . /usr/src/app

EXPOSE 5000

CMD [ "npm", "start" ]

During the execution of the npm install task, I can see traces regarding sharp and things seem successful:

> [email protected] install /usr/src/app/node_modules/sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)

info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.8.1/libvips-8.8.1-linux-x64.tar.gz

However, when I'm trying to use the endpoint relying on sharp, the application crashes.

I guess that some required libraries are missing because it's a minimal distribution within the docker image but can't find what to add.

Thanks for your help!
Thierry

borked on smartos (and I would guess other *solaris)

Be nice if a sharp binary existed for smartos but since such apparently does not npm tries to build it. Which doesn't work out too well since libvips-8.7.0-sunos-x64.tar.gz is not in the lurking:

[admin@samhain ~]$ npm i sharp

[email protected] install /home/admin/node_modules/sharp
(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)

info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.7.0/libvips-8.7.0-sunos-x64.tar.gz
/home/admin/node_modules/sharp/install/libvips.js:80
throw new Error(Status ${response.statusCode});
^

Error: Status 404

In any case, thought I'd let ya' know in case ya' wanted to shave yer' script!

fwiw:

[admin@samhain ~]$ uname -a
SunOS samhain 5.11 joyent_20180816T001857Z i86pc i386 i86pc

Otherwise know as a Joyent minimal 64 bit 18.3 smartos vm.

libvips-8.7.0-linuxmusl-armv6

Hello,
Would it be possible to add one more binary to release 8.7.0?
I'm building a docker image FROM arm32v6/alpine and I'm getting the following error as there is no
libvips-8.7.0-linuxmusl-armv6.tar.gz available

info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.7.0/libvips-8.7.0-linuxmusl-armv6.tar.gz
/usr/src/app/node_modules/sharp/install/libvips.js:81
          throw new Error(`Status ${response.statusCode}`);
          ^

Error: Status 404
    at /usr/src/app/node_modules/sharp/install/libvips.js:81:17

Not sure what's the effort involved on that, but I'm happy to try to compile that version and send it back to be released.

Thank you!

libvips build fails

Trying to get a Gatsbyjs website up and running has gotten me to this error:

$ npm install
npm WARN deprecated [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142

> [email protected] install /home/sasann/Projects/gatsby-portfolio-dev/node_modules/gatsby-plugin-manifest/node_modules/sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)

info sharp Using cached /home/sasann/.npm/_libvips/libvips-8.7.4-linux-x64.tar.gz
prebuild-install WARN install No prebuilt binaries found (target=13.8.0 runtime=node arch=x64 libc= platform=linux)
make: Entering directory '/home/sasann/Projects/gatsby-portfolio-dev/node_modules/gatsby-plugin-manifest/node_modules/sharp/build'
  TOUCH Release/obj.target/libvips-cpp.stamp
  CXX(target) Release/obj.target/sharp/src/common.o
  CXX(target) Release/obj.target/sharp/src/metadata.o
  CXX(target) Release/obj.target/sharp/src/stats.o
../src/stats.cc: In member function ‘virtual void StatsWorker::HandleOKCallback()’:
../src/stats.cc:130:37: error: no matching function for call to ‘v8::Array::Set(int&, v8::Local<v8::Object>&)’
         channels->Set(i, channelStat);
                                     ^
In file included from /home/sasann/.cache/node-gyp/13.8.0/include/node/node.h:63:0,
                 from ../src/stats.cc:19:
/home/sasann/.cache/node-gyp/13.8.0/include/node/v8.h:3547:37: note: candidate: v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>)
   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                     ^~~
/home/sasann/.cache/node-gyp/13.8.0/include/node/v8.h:3547:37: note:   candidate expects 3 arguments, 2 provided
/home/sasann/.cache/node-gyp/13.8.0/include/node/v8.h:3550:37: note: candidate: v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, uint32_t, v8::Local<v8::Value>)
   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
                                     ^~~
/home/sasann/.cache/node-gyp/13.8.0/include/node/v8.h:3550:37: note:   candidate expects 3 arguments, 2 provided
At global scope:
cc1plus: warning: unrecognized command line option ‘-Wno-cast-function-type’
sharp.target.mk:138: recipe for target 'Release/obj.target/sharp/src/stats.o' failed
make: *** [Release/obj.target/sharp/src/stats.o] Error 1
make: Leaving directory '/home/sasann/Projects/gatsby-portfolio-dev/node_modules/gatsby-plugin-manifest/node_modules/sharp/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:321:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Linux 4.15.0-76-generic
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/sasann/Projects/gatsby-portfolio-dev/node_modules/gatsby-plugin-manifest/node_modules/sharp
gyp ERR! node -v v13.8.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok 
npm WARN [email protected] requires a peer of [email protected] but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of [email protected] but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/sasann/.npm/_logs/2020-02-12T09_34_51_163Z-debug.log

If I understand correctly, It tries to compile libvips and fails. When I run ./confgure on a libvips tarball it runs fine so I don't know what dependency I'm missing.

Downloading sharp release fails with "zlib: unexpected end of file", continues to use node-gyp?

I am aware of prior issues with slow/failing installs, I am also in China presently with a VPN. When the download fails, I get an error like below. My question is, afaik the error is because the download failed or (thinks it was successful?), continuing onto using node-gyp and looking for python?

Is that the correct error/behaviour to expect? (Rather than avoid triggering node-gyp which I assume only should be done if the file was valid(eg passed checksum test)? I think the error is being raised here but it's not clear to me where it progresses towards node-gyp.

Additional question, what is node-gyp being used for here? I don't seem to need to have python installed if I provide my own local copy of the vendor content(extracted to packages /vendor directory), I guess because it passes the tests, is it requried for global libvips or remote pre-built binary sourcing only?

error /usr/local/share/.cache/yarn/v4/.tmp/5e088045120241bf9354ee531820b112.c7f5a07da6b02f6e23e872e8bb096a88c11ee395.prepare/node_modules/sharp: Command failed.
Exit code: 1
Command: (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
Arguments: 
Directory: /usr/local/share/.cache/yarn/v4/.tmp/5e088045120241bf9354ee531820b112.c7f5a07da6b02f6e23e872e8bb096a88c11ee395.prepare/node_modules/sharp
Output:
info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.7.0/libvips-8.7.0-linux-x64.tar.gz
ERR! sharp zlib: unexpected end of file
ERR! sharp Please see http://sharp.pixelplumbing.com/page/install
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp ERR! configure error 
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:484:19)
gyp ERR! stack     at PythonFinder.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:406:16)
gyp ERR! stack     at F (/usr/local/lib/node_modules/npm/node_modules/which/which.js:68:16)
gyp ERR! stack     at E (/usr/local/lib/node_modules/npm/node_modules/which/which.js:80:29)
gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/which/which.js:89:16
gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/isexe/index.js:42:5
gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/isexe/mode.js:8:5
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:154:21)
gyp ERR! System Linux 4.19.12-2-MANJARO
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/share/.cache/yarn/v4/.tmp/5e088045120241bf9354ee531820b112.c7f5a07da6b02f6e23e872e8bb096a88c11ee395.prepare/node_modules/sharp
gyp ERR! node -v v10.15.0
success Saved lockfile.

#14 is still an issue

#14 was locked from commenting for no apparent reason, but the issue occurs on brand new macos machines with XCode & Homebrew installed.

bstoner@octave % (master) npm install
> [email protected] install /Users/bstoner/Projects/github.com/FindOctave/cortex/node_modules/sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node i
nstall/dll-copy)
info sharp Using cached /Users/bstoner/.npm/_libvips/libvips-8.7.4-darwin-x64.tar.gz
prebuild-install WARN install No prebuilt binaries found (target=14.4.0 runtime=node arch=x64 libc=
platform=darwin)
  TOUCH Release/obj.target/libvips-cpp.stamp
  CXX(target) Release/obj.target/sharp/src/common.o
  CXX(target) Release/obj.target/sharp/src/metadata.o
  CXX(target) Release/obj.target/sharp/src/stats.o
../src/stats.cc:130:19: error: no matching member function for call to 'Set'
        channels->Set(i, channelStat);
        ~~~~~~~~~~^~~
/Users/bstoner/Library/Caches/node-gyp/14.4.0/include/node/v8.h:3639:37: note: candidate function
      not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                    ^
/Users/bstoner/Library/Caches/node-gyp/14.4.0/include/node/v8.h:3642:37: note: candidate function
      not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
                                    ^
1 error generated.
make: *** [Release/obj.target/sharp/src/stats.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib
/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
gyp ERR! System Darwin 19.5.0
gyp ERR! command "/usr/local/Cellar/node/14.4.0/bin/node" "/usr/local/lib/node_modules/npm/node_modu
les/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/bstoner/Projects/github.com/FindOctave/cortex/node_modules/sharp
gyp ERR! node -v v14.4.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm WARN [email protected] requires a peer of @angular/compiler@^6.0.0 || ^7.0.0 but none
is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of eslint@>= 4.12.1 but none is installed. You must ins
tall peer dependencies yourself.
npm WARN [email protected] requires a peer of webpack@^3.1.0 but none is installed.
You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >=
3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none
 is installed. You must install peer dependencies yourself.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `(node install/libvips && node install/dll-copy && prebuild-install)
|| (node-gyp rebuild && node install/dll-copy)`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/bstoner/.npm/_logs/2020-07-02T18_58_04_711Z-debug.log

Installing libvips through Homebrew doesn't fix it, but deleting the .npm/_libvips cache leads to this:

bstoner@octave % (master) npm install [email protected]

> [email protected] install /Users/bstoner/Projects/github.com/FindOctave/cortex/node_modules/sharp
> (node install/libvips && node install/dll-copy && prebuild-install --runtime=napi) || (node-gyp rebuild && node install/dll-copy)

info sharp Detected globally-installed libvips v8.9.2
info sharp Building from source via node-gyp
  CC(target) Release/obj.target/nothing/../node-addon-api/nothing.o
  LIBTOOL-STATIC Release/nothing.a
  TOUCH Release/obj.target/libvips-cpp.stamp
  CXX(target) Release/obj.target/sharp/src/common.o
In file included from ../src/common.cc:18:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/vector:276:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/climits:41:
/usr/local/Cellar/gcc/9.3.0_1/lib/gcc/9/gcc/x86_64-apple-darwin19/9.3.0/install-tools/include/limits.h:34:10: fatal error:
      'syslimits.h' file not found
#include "syslimits.h"
         ^~~~~~~~~~~~~
1 error generated.
make: *** [Release/obj.target/sharp/src/common.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
gyp ERR! System Darwin 19.5.0
gyp ERR! command "/usr/local/Cellar/node/14.4.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/bstoner/Projects/github.com/FindOctave/cortex/node_modules/sharp
gyp ERR! node -v v14.4.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm WARN [email protected] requires a peer of @angular/compiler@^6.0.0 || ^7.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of eslint@>= 4.12.1 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of webpack@^3.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `(node install/libvips && node install/dll-copy && prebuild-install --runtime=napi) || (node-gyp rebuild && node install/dll-copy)`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/bstoner/.npm/_logs/2020-07-02T19_25_23_537Z-debug.log

EDIT: I got around this via brew install libvips and adding this to my ZSHRC:

PKG_CONFIG_PATH=${PKG_CONFIG_PATH:-""}
if [[ -d /usr/local/ ]]; then
  local_pkgconfig_paths=(/usr/local/opt/*/lib/pkgconfig(N))
  for pkg_config_path in ${local_pkgconfig_paths[@]}; do PKG_CONFIG_PATH="${PKG_CONFIG_PATH[@]}:${pkg_config_path}"; done
fi
export PKG_CONFIG_PATH

Download slow/fails in China

We are located in China and use sharp for a number of our projects, but installing it is always a pain because it gets stuck at "info sharp Downloading https://github.com/lovell/sharplibvips/releases/xxxx". Sometimes it will complete after a half hour, but most of the time it just times out and the install fails. It seems like some github endpoints are blocked or filtered by the gov't for some reason. Is there any other way we could install this dependency so the sharp install recognizes it and succeeds? Thanks

Provide artifacts with libtool and pkg-config files

Hi!

Thanks for maintaining sharp and these native libraries for libvips! They're a great help to get started. 😃

I'd like to use the native libraries provided by this project in https://github.com/criteo/JVips instead of building the libraries and maintaining their build scripts in JVips, too.

Since it's a Java project using JNI to interface with the native libraries, I need to compile a small wrapper which requires the pkg-config (*.pc) and libtool (*.la) files in order to be build.
Unfortunately, those files are removed at the end of the Linux build script:

sharp-libvips/build/lin.sh

Lines 284 to 285 in 5007da5

cd ${TARGET}/lib
rm -rf pkgconfig .libs *.la libvipsCC* cmake

@lovell Do you think it would be possible and sensible to provider an additional artifact with just these files for people to use the pre-built libraries of sharp-libvips and link them to their own C wrappers?

No binary for linuxmusl-armv7

It would be great to have binaries for linuxmusl-armv7 as well.

I'm using RPi 4 with kubernetes and it some applications don't install because of Alpine containers using musl

Linux: link libvips with -Bsymbolic-functions

See kleisauke@41fb70c and kleisauke/net-vips#90 for context. Could possibly resolve lovell/sharp#575 (and other node-canvas related issues).

GLib uses this linker flag by default, so it might make sense to also link libvips with this flag. The above NetVips issue had no issues running this on macOS, so I'm not sure if this flag is needed there as well (Homebrew also seems to avoid any -Bsymbolic* linker flags, probably due to missing support for this in Xcode(?)).

Provide Brotli compressed tarballs, ~15% smaller/faster

I'm aware that the files provided by this repo are one of the biggest consumers of bandwidth across the whole of GitHub Releases.

Node.js 10.16.0+ natively supports Brotli decompression and initial testing suggest this would allow for 15-20% smaller release tarballs.

(Not that it matters so much, but compression time seems to be approximately the same as advdef --shrink-insane and decompression time is very slightly faster, although that could be simply due to less I/O.)

Things to do here:

  • Ensure all the build containers have brotli available at the command line.
  • Ensure published file extensions also include .tar.br

Then in sharp:

  • Switch from tar to tar-fs
  • Pipe through BrotliDecompress, something like:
fs
  .createReadStream(tarPath)
  .pipe(new zlib.BrotliDecompress())
  .pipe(tar.extract(vendorPath)

Experiment: provide libvips as a single shared library with its dependencies statically-linked

It looks like macOS doesn't expand @loader_path to the actual filesystem path before checking if the rpath of a dylib file has already been loaded. This means that different versions of sharp at different filesystem locations loaded in the same process can conflict when an earlier version is loaded before a later version.

To attempt to deal with this, we can experiment with unpacking prebuilt libvips binaries into versioned directory under vendor, e.g. node_modules/sharp/vendor/8.9.0/lib/..., which should then ensure the rpath includes the version number.

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.