From 409e5174bb52b79cf05a2ab3ed89b0ea71475fae Mon Sep 17 00:00:00 2001 From: Lovell Fuller Date: Wed, 19 Feb 2020 21:44:13 +0000 Subject: [PATCH] Add support for 32-bit Windows (win32-ia32) --- README.md | 2 +- appveyor.yml | 13 ++++++++++--- binding.gyp | 6 ++++++ docs/README.md | 2 +- docs/changelog.md | 3 +++ docs/install.md | 2 +- install/libvips.js | 5 +---- 7 files changed, 23 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index f9052427..ae09853b 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Lanczos resampling ensures quality is not sacrificed for speed. As well as image resizing, operations such as rotation, extraction, compositing and gamma correction are available. -Most modern 64-bit macOS, Windows and Linux systems running Node.js v10.16.0+ +Most modern macOS, Windows and Linux systems running Node.js v10.16.0+ do not require any additional install or runtime dependencies. ## Examples diff --git a/appveyor.yml b/appveyor.yml index 3d9f7ffe..3b9b6107 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,15 +1,22 @@ os: Visual Studio 2017 version: "{build}" build: off -platform: x64 environment: matrix: - nodejs_version: "10" + platform: x86 + - nodejs_version: "10" + platform: x64 - nodejs_version: "12" + platform: x86 + - nodejs_version: "12" + platform: x64 - nodejs_version: "13" + platform: x86 + - nodejs_version: "13" + platform: x64 install: - - ps: Update-NodeJsInstallation (Get-NodeJsLatestBuild $env:nodejs_version) x64 - - npm install -g npm@6 + - ps: Update-NodeJsInstallation (Get-NodeJsLatestBuild $env:nodejs_version) $env:platform - npm install test_script: - npm test diff --git a/binding.gyp b/binding.gyp index bea68e2d..4e472cc6 100644 --- a/binding.gyp +++ b/binding.gyp @@ -30,6 +30,9 @@ 'msvs_settings': { 'VCCLCompilerTool': { 'ExceptionHandling': 1 + }, + 'VCLinkerTool': { + 'ImageHasSafeExceptionHandlers': 'false' } }, 'msvs_disabled_warnings': [ @@ -194,6 +197,9 @@ 'msvs_settings': { 'VCCLCompilerTool': { 'ExceptionHandling': 1 + }, + 'VCLinkerTool': { + 'ImageHasSafeExceptionHandlers': 'false' } }, 'msvs_disabled_warnings': [ diff --git a/docs/README.md b/docs/README.md index ef58907c..3f423054 100644 --- a/docs/README.md +++ b/docs/README.md @@ -16,7 +16,7 @@ Lanczos resampling ensures quality is not sacrificed for speed. As well as image resizing, operations such as rotation, extraction, compositing and gamma correction are available. -Most modern 64-bit macOS, Windows and Linux systems running Node.js v10.16.0+ +Most modern macOS, Windows and Linux systems running Node.js v10.16.0+ do not require any additional install or runtime dependencies. [![Test Coverage](https://coveralls.io/repos/lovell/sharp/badge.png?branch=master)](https://coveralls.io/r/lovell/sharp?branch=master) diff --git a/docs/changelog.md b/docs/changelog.md index 4606dd7c..392c3ad1 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -11,6 +11,9 @@ Requires libvips v8.9.1 * Migrate internals to N-API. [#1282](https://github.com/lovell/sharp/issues/1282) +* Add support for 32-bit Windows. + [#2088](https://github.com/lovell/sharp/issues/2088) + ## v0.24 - "*wit*" Requires libvips v8.9.0. diff --git a/docs/install.md b/docs/install.md index 92cf37a2..8fdbd22c 100644 --- a/docs/install.md +++ b/docs/install.md @@ -19,7 +19,7 @@ Node.js v10.16.0+ (N-API v4) on the most common platforms: * macOS x64 (>= 10.13) * Linux x64 (glibc >= 2.17, musl >= 1.1.24) -* Windows x64 with 64-bit `node.exe` +* Windows A ~10MB tarball containing libvips and its most commonly used dependencies is downloaded via HTTPS and stored within `node_modules/sharp/vendor` during `npm install`. diff --git a/install/libvips.js b/install/libvips.js index 69704b71..8128f838 100644 --- a/install/libvips.js +++ b/install/libvips.js @@ -57,10 +57,7 @@ try { // Is this arch/platform supported? const arch = process.env.npm_config_arch || process.arch; const platformAndArch = platform(); - if (platformAndArch === 'win32-ia32') { - throw new Error('Windows x86 (32-bit) node.exe is not supported'); - } - if (arch === 'ia32') { + if (arch === 'ia32' && !platformAndArch.startsWith('win32')) { throw new Error(`Intel Architecture 32-bit systems require manual installation of libvips >= ${minimumLibvipsVersion}`); } if (platformAndArch === 'freebsd-x64' || platformAndArch === 'openbsd-x64' || platformAndArch === 'sunos-x64') {