Skip to content

Commit

Permalink
Allow pip to intall source packages if there are no binaries
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
lpsinger committed Jan 10, 2024
1 parent 6292682 commit 0d86aa3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/actions/install-update.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0d86aa3

Please sign in to comment.