From 5be36c2deb735577fc76fa52242836d40df276bd Mon Sep 17 00:00:00 2001 From: Lovell Fuller Date: Wed, 4 Jan 2023 21:11:21 +0000 Subject: [PATCH] Install: log Rosetta detection, improve related docs --- docs/install.md | 3 ++- install/libvips.js | 4 ---- lib/libvips.js | 1 + 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/docs/install.md b/docs/install.md index 8291f4df8..99de5df31 100644 --- a/docs/install.md +++ b/docs/install.md @@ -115,7 +115,8 @@ and that it can be located using `pkg-config --modversion vips-cpp`. For help compiling libvips and its dependencies, please see [building libvips from source](https://www.libvips.org/install.html#building-libvips-from-source). -The use of a globally-installed libvips is unsupported on Windows. +The use of a globally-installed libvips is unsupported on Windows +and on macOS when running Node.js under Rosetta. ## Building from source diff --git a/install/libvips.js b/install/libvips.js index a70b9db56..88f82e2e5 100644 --- a/install/libvips.js +++ b/install/libvips.js @@ -128,9 +128,6 @@ try { if (arch === 'ia32' && !platformAndArch.startsWith('win32')) { throw new Error(`Intel Architecture 32-bit systems require manual installation of libvips >= ${minimumLibvipsVersion}`); } - if (platformAndArch === 'darwin-arm64') { - throw new Error("Please run 'brew install vips' to install libvips on Apple M1 (ARM64) systems"); - } if (platformAndArch === 'freebsd-x64' || platformAndArch === 'openbsd-x64' || platformAndArch === 'sunos-x64') { throw new Error(`BSD/SunOS systems require manual installation of libvips >= ${minimumLibvipsVersion}`); } @@ -153,7 +150,6 @@ try { if (!semverSatisfies(process.versions.node, supportedNodeVersion)) { handleError(new Error(`Expected Node.js version ${supportedNodeVersion} but found ${process.versions.node}`)); } - // Download to per-process temporary file const tarFilename = ['libvips', minimumLibvipsVersionLabelled, platformAndArch].join('-') + '.tar.br'; const tarPathCache = path.join(libvips.cachePath(), tarFilename); diff --git a/lib/libvips.js b/lib/libvips.js index d0bcaca60..231a76c65 100644 --- a/lib/libvips.js +++ b/lib/libvips.js @@ -115,6 +115,7 @@ const useGlobalLibvips = function () { } /* istanbul ignore next */ if (isRosetta()) { + log('Detected Rosetta, skipping search for globally-installed libvips'); return false; } const globalVipsVersion = globalLibvipsVersion();