You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Investigate reducing the dependencies to install vips #42
One of the hardest parts about using Sharp is setting it up. Being able to just say "npm install sharp" would make it easier for a lot of people to try it out.
Currently libvips isn't very easy to set up on an Amazon Linux box, and on Mac OS X it requires brew (there are some instances in which one may wish not to install brew). So if there were an easier way to build vips and it were integrated with Sharp's installation that could help a lot.
Instructions for yum (EC2 in particular) and a dockerfile would certainly be useful for production setups.
I was chatting with a friend earlier today who didn't have brew installed and he found Sharp difficult to set up on Mavericks. I don't think it's reasonable for the Sharp project to precompile vips for major platforms but it would be nice for compilation to be easier.
For example node-fibers is pretty easy to install on all major platforms and it ships with the source of its dependencies. So something similar where Sharp ships with the source of vips could be helpful, even if it's a longer term goal that might require help from the vips team.
On Tue, May 27, 2014 at 11:31 PM, Lovell Fuller [email protected]
wrote:
Instructions in the README for yum-based installation (to include AWS's default AMIs) would definitely help, thanks for the suggestion.
How about a sample Dockerfile? That would help with an Elastic Beanstalk deployment.
Not sure I'd want the maintenance overhead of including and compiling all dependencies from source!
Reply to this email directly or view it on GitHub: #42 (comment)
The libcoro dependency of node-fibers appears a lot simpler than libvips (which then has its own dependencies to worry about too).
What I really like about the node-fibers repo is the provision of build.js, an idea sharp could borrow as a "bootstrap" to verify that dependencies are present, providing more useful feedback/help in the event things are not quite ready. Thanks for the inspiration!
I'm also happy to provide installation instructions for other Mac OS package managers, e.g. Fink, if there's enough call for it.
i would love if vips was included so i can deploy it to places like heroku without crazy images and stuff. however, it makes total sense not to as it's super complicated. it could also take forever to build
I've added a preinstall.sh shell script on the preinstall branch that can be used to install libvips and its dependencies on a wide variety of OS and package manager combos (but not Windows).
When everyone is happy that preinstall.sh is solid enough, I'd like to either add it as the preinstall script in package.json (completely ignoring the "INSTALL SCRIPTS ARE AN ANTIPATTERN" warning) or somehow get gyp to call it.
Here's my output on Yosemite. Seems to be working.
$ ./preinstall.sh
Found libvips 7.40.11
$ brew remove vips
Uninstalling /usr/local/Cellar/vips/7.40.11...
$ ./preinstall.sh
Could not find libvips using a PKG_CONFIG_PATH of '/usr/lib/pkgconfig:/usr/local/Library/ENV/pkgconfig/10.10::/usr/local/lib/pkgconfig:/usr/lib/pkgconfig'
Detected Mac OS
Installing libvips via homebrew
==> Downloading http://www.vips.ecs.soton.ac.uk/supported/7.40/vips-7.40.11.tar.g
Already downloaded: /Library/Caches/Homebrew/vips-7.40.11.tar.gz
==> ./configure --prefix=/usr/local/Cellar/vips/7.40.11 --with-magick --with-magi
==> make check
==> make install
==> Caveats
If you need Python to find the installed site-packages:
mkdir -p ~/Library/Python/2.7/lib/python/site-packages
echo '/usr/local/lib/python2.7/site-packages' > ~/Library/Python/2.7/lib/python/site-packages/homebrew.pth
==> Summary
🍺 /usr/local/Cellar/vips/7.40.11: 196 files, 13M, built in 65 seconds
I use vanilla ./configure with $PREFIX set to a subdirectory of my home directory, and make install things. I'm not a UNIX neckbeard, but it's a very reasonable expectation to expect to be able to make local, non-global installations of compiled software.
Only being able to have a single active version of a dependency on an entire system is literally a singleton pattern and it makes a number of compromises to the system's integrity I'm not really willing to make, not the least of which is making a subdirectory of /usr/local user-owned-and-writable.
Not to mention, new OS upgrades often break - sometimes subtly, sometimes blatantly - changes made by the package managers, and I prefer not to be dependent on upstream fixes to get a system up and running to where I'd like it to be.
@mahnunchik Thanks for testing/confirming. If it makes you feel any better, I'm hearing about all sorts of problems with El Capitan upgrades breaking homebrew, xcode etc.
$ npm install git+https://github.com/lovell/sharp#look
-
> [email protected] install /home/andreas/express-processimage/node_modules/sharp
> node-gyp rebuild
ERROR: libc version 2.13 requires manual installation
gyp: Call to 'LDD_VERSION="ldd (Debian EGLIBC 2.13-38+deb7u8) 2.13
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper." node -e "require('./binding').download_vips()"' returned exit status 1. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/home/andreas/.nvm/v0.10.40/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:343:16)
gyp ERR! stack at ChildProcess.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:820:12)
gyp ERR! System Linux 3.14.36-20150326-1131-6606ede
gyp ERR! command "node" "/home/andreas/.nvm/v0.10.40/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/andreas/express-processimage/node_modules/sharp
gyp ERR! node -v v0.10.40
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok
npm WARN optional dep failed, continuing [email protected]
@papandreou It might be as simple as changing the base OS in the Dockerfile used to generate the binaries.
If you'd like to experiment, you can run ./packaging/build.sh to generate the packaging/libvips-8.1.1-lin.tar.gz file. If present, this file is used instead of downloading from bintray at npm install time.
I've managed to locally reproduce the heap corruption problem affecting Node v4 and v5 on the Windows CI environment. I think it's something to do with thread switching but I haven't figured it out yet. Here's the stacktrace should anyone else have any ideas:
The forthcoming v0.12.0 release will provide pre-compiled binaries for 64-bit Windows and Linux. I've moved the work to investigate the best way to support OS X (and ARM) to #312.
Thank you very much to everyone on this thread for all your suggestions, help and testing during the last year and a half!
I'm closing+locking this issue now - please open a new issue if you're having any problems with the pre-compiled binaries or have further thoughts.
Activity
lovell commentedon May 28, 2014
Instructions in the README for yum-based installation (to include AWS's default AMIs) would definitely help, thanks for the suggestion.
How about a sample Dockerfile? That would help with an Elastic Beanstalk deployment.
Not sure I'd want the maintenance overhead of including and compiling all dependencies from source!
ide commentedon May 28, 2014
Instructions for yum (EC2 in particular) and a dockerfile would certainly be useful for production setups.
I was chatting with a friend earlier today who didn't have brew installed and he found Sharp difficult to set up on Mavericks. I don't think it's reasonable for the Sharp project to precompile vips for major platforms but it would be nice for compilation to be easier.
For example node-fibers is pretty easy to install on all major platforms and it ships with the source of its dependencies. So something similar where Sharp ships with the source of vips could be helpful, even if it's a longer term goal that might require help from the vips team.
On Tue, May 27, 2014 at 11:31 PM, Lovell Fuller [email protected]
wrote:
lovell commentedon May 28, 2014
The libcoro dependency of node-fibers appears a lot simpler than libvips (which then has its own dependencies to worry about too).
What I really like about the node-fibers repo is the provision of build.js, an idea sharp could borrow as a "bootstrap" to verify that dependencies are present, providing more useful feedback/help in the event things are not quite ready. Thanks for the inspiration!
I'm also happy to provide installation instructions for other Mac OS package managers, e.g. Fink, if there's enough call for it.
jonathanong commentedon May 29, 2014
i would love if vips was included so i can deploy it to places like heroku without crazy images and stuff. however, it makes total sense not to as it's super complicated. it could also take forever to build
lovell commentedon May 29, 2014
@jonathanong There's a Heroku Buildpack at https://github.com/alex88/heroku-buildpack-vips which I've not tried but seems only slightly out of date with respect to required version numbers. Perhaps send a PR to upgrade to libvips 7.38.5 and liborc 0.4.19.
Add support for the operations exposed by the 'sharp' library. Fixes #6.
Made sharp an optional dependency (waiting for lovell/sharp#42).
lovell commentedon Oct 23, 2014
I've added a preinstall.sh shell script on the
preinstallbranch that can be used to install libvips and its dependencies on a wide variety of OS and package manager combos (but not Windows).If everyone/anyone following this issue is able to test the instructions at https://github.com/lovell/sharp/tree/preinstall#prerequisites - especially on Mac OS as I've not been able to verify this - I would very much appreciate it.
lovell commentedon Oct 24, 2014
When everyone is happy that
preinstall.shis solid enough, I'd like to either add it as the preinstall script inpackage.json(completely ignoring the "INSTALL SCRIPTS ARE AN ANTIPATTERN" warning) or somehow getgypto call it.ide commentedon Oct 25, 2014
Here's my output on Yosemite. Seems to be working.
lovell commentedon Oct 25, 2014
Great news, thanks @ide.
Is your friend available to help? What, if any, package/dependency management tool(s) do they use?
toulouse commentedon Oct 27, 2014
That's me.
I use vanilla ./configure with $PREFIX set to a subdirectory of my home directory, and make install things. I'm not a UNIX neckbeard, but it's a very reasonable expectation to expect to be able to make local, non-global installations of compiled software.
Only being able to have a single active version of a dependency on an entire system is literally a singleton pattern and it makes a number of compromises to the system's integrity I'm not really willing to make, not the least of which is making a subdirectory of /usr/local user-owned-and-writable.
Not to mention, new OS upgrades often break - sometimes subtly, sometimes blatantly - changes made by the package managers, and I prefer not to be dependent on upstream fixes to get a system up and running to where I'd like it to be.
papandreou commentedon Oct 27, 2014
The preinstall script works fine on Ubuntu 14.04 here. This patch makes it work with Debian Wheezy as well: #111
41 remaining items
lovell commentedon Nov 10, 2015
@mahnunchik Thanks for testing/confirming. If it makes you feel any better, I'm hearing about all sorts of problems with El Capitan upgrades breaking homebrew, xcode etc.
papandreou commentedon Nov 17, 2015
On Debian Wheezy I get:
papandreou commentedon Nov 17, 2015
Oh, I should look at https://github.com/lovell/sharp/blob/look/docs/install.md instead, of course, and it does say Debian 8. Bummer.
lovell commentedon Nov 17, 2015
@papandreou Yes, sorry, I had to draw a line somewhere. Debian Wheezy's version of libc is over 4 years' old. Is this likely to be a problem?
papandreou commentedon Nov 17, 2015
I'm stuck with Wheezy in my production environment for the time being, so for me personally, yes :(
Do you have any idea how much work it'd be?
lovell commentedon Nov 17, 2015
@papandreou It might be as simple as changing the base OS in the Dockerfile used to generate the binaries.
If you'd like to experiment, you can run
./packaging/build.shto generate thepackaging/libvips-8.1.1-lin.tar.gzfile. If present, this file is used instead of downloading from bintray atnpm installtime.papandreou commentedon Nov 17, 2015
@lovell That worked, yay! PR here: #307
lovell commentedon Nov 18, 2015
I've managed to locally reproduce the heap corruption problem affecting Node v4 and v5 on the Windows CI environment. I think it's something to do with thread switching but I haven't figured it out yet. Here's the stacktrace should anyone else have any ideas:
lovell commentedon Nov 21, 2015
Windows problems finally fixed with commit 3dbedf1 - there was a mismatched malloc/free - see https://ci.appveyor.com/project/lovell/sharp/build/269
lovell commentedon Nov 22, 2015
The
lookbranch has now been merged to themasterbranch pending release.lovell commentedon Nov 22, 2015
The forthcoming v0.12.0 release will provide pre-compiled binaries for 64-bit Windows and Linux. I've moved the work to investigate the best way to support OS X (and ARM) to #312.
Thank you very much to everyone on this thread for all your suggestions, help and testing during the last year and a half!
I'm closing+locking this issue now - please open a new issue if you're having any problems with the pre-compiled binaries or have further thoughts.
lovell commentedon Nov 23, 2015
v0.12.0 now available via npm - tell all your friends!