From 2d05804fc344fbc5eebc0db899eb943448a4ca8d Mon Sep 17 00:00:00 2001 From: Lovell Fuller Date: Thu, 11 Feb 2016 20:33:21 +0000 Subject: [PATCH] Add cache recommendations for use with Alpine/musl #354 Prevent Windows EBUSY errors during tests --- .jshintrc | 3 +-- docs/changelog.md | 2 +- docs/install.md | 4 ++++ test/unit/clone.js | 4 ++-- test/unit/io.js | 4 ++-- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.jshintrc b/.jshintrc index 8d8bdb70..cd29999d 100644 --- a/.jshintrc +++ b/.jshintrc @@ -4,9 +4,8 @@ "maxparams": 4, "maxcomplexity": 13, "globals": { - "before": true, "beforeEach": true, - "after": true, + "afterEach": true, "describe": true, "it": true } diff --git a/docs/changelog.md b/docs/changelog.md index 8ec4d2d1..90a669dd 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -37,7 +37,7 @@ [#351](https://github.com/lovell/sharp/pull/351) [@joelmukuthu](https://github.com/joelmukuthu) -* Check for glibc before downloading pre-compiled binaries. +* Improve support for musl libc systems e.g. Alpine Linux. [#354](https://github.com/lovell/sharp/issues/354) [@download13](https://github.com/download13) diff --git a/docs/install.md b/docs/install.md index 9bf8862e..390839d9 100644 --- a/docs/install.md +++ b/docs/install.md @@ -41,6 +41,10 @@ the following command as a user with `sudo` access curl -s https://raw.githubusercontent.com/lovell/sharp/master/preinstall.sh | sudo bash - ``` +For Linux-based operating systems such as Alpine that use musl libc, +the smaller stack size means libvips' cache should be disabled +via `sharp.cache(false)` to avoid a stack overflow. + ### Mac OS [![OS X 10.9.5 Build Status](https://travis-ci.org/lovell/sharp-osx-ci.png?branch=master)](https://travis-ci.org/lovell/sharp-osx-ci) diff --git a/test/unit/clone.js b/test/unit/clone.js index 42dbd7ce..e145423e 100644 --- a/test/unit/clone.js +++ b/test/unit/clone.js @@ -8,10 +8,10 @@ var fixtures = require('../fixtures'); describe('Clone', function() { - before(function() { + beforeEach(function() { sharp.cache(false); }); - after(function() { + afterEach(function() { sharp.cache(true); }); diff --git a/test/unit/io.js b/test/unit/io.js index 307b57e9..4ae2de36 100644 --- a/test/unit/io.js +++ b/test/unit/io.js @@ -8,10 +8,10 @@ var fixtures = require('../fixtures'); describe('Input/output', function() { - before(function() { + beforeEach(function() { sharp.cache(false); }); - after(function() { + afterEach(function() { sharp.cache(true); });