From 0d86aa34a70dd7ce170dc9ad1911e31abe9c9793 Mon Sep 17 00:00:00 2001 From: Leo Singer Date: Tue, 9 Jan 2024 19:59:42 -0500 Subject: [PATCH] Allow pip to intall source packages if there are no binaries Remove the `--only-binary=:all:` flag from the `pip install` command. This option prevents pip from installing _any_ packages from binary wheels, even those packages that only have source distributions or that lack binary wheels for the target platform. Note that with this change there _is_ a risk that when hydrating for a foreign architecture (e.g. when hydrating for aarch64 deployment on an i86_64 system) that pip may build wheels for the wrong architecture if compilers are not properly configured for cross-compilation. However, with this change it is at _least_ possible to build packages from source when necessary and when the host and target archs match. For concreteness, we encountered the bug that this patch fixes when we were trying to hydrate a package that depends on [logbook 1.7.0](https://pypi.org/project/Logbook/1.7.0.post0/#files) for aarch64, because that package has no aarch64 wheels at all. --- src/actions/install-update.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/actions/install-update.js b/src/actions/install-update.js index e57e5ab..c420f69 100644 --- a/src/actions/install-update.js +++ b/src/actions/install-update.js @@ -116,7 +116,7 @@ module.exports = function hydrator (params, callback) { // https://docs.aws.amazon.com/linux/al2023/ug/compare-with-al2.html#glibc-gcc-and-binutils let arch = lambda.config.architecture === 'arm64' ? 'manylinux2014_aarch64' : 'manylinux2014_x86_64' let ver = lambda.config.runtime.split('python')[1] - flags = '--only-binary=:all: ' + + flags = '--no-binary=:none: ' + `--platform=${arch} ` + `--python-version ${ver} ` // Reset flags if installing from Sandbox