Skip to content
Snippets Groups Projects
Commit df7f8f35 authored by Ed Morley's avatar Ed Morley Committed by Kenneth Reitz
Browse files

Skip vendoring libffi/libmemcached on Heroku-16 (#465)

* Add a test for the cryptography (cffi) compile step

Since it's currently untested.

* Skip vendoring libffi/libmemcached on Heroku-16

Unlike for Cedar-14, Heroku-16 comes with these packages pre-installed:
https://github.com/heroku/stack-images/blob/5a341970cfc1f201014262ad64c3b3e47514f663/heroku-16/installed-packages.txt#L111
https://github.com/heroku/stack-images/blob/5a341970cfc1f201014262ad64c3b3e47514f663/heroku-16/installed-packages.txt#L172

As such the build scripts had already been made a no-op on Heroku-16:
https://github.com/heroku/heroku-buildpack-python/blob/fedae5ceda5a42f594012f911c3808dd5dc6fd9e/builds/libraries/vendor/libffi#L6-L9
https://github.com/heroku/heroku-buildpack-python/blob/fedae5ceda5a42f594012f911c3808dd5dc6fd9e/builds/libraries/vendor/libmemcache#L6-L9

...meaning the Heroku-16 archives for them on S3 contain zero files.

However until now, the buildpack was still unnecessarily downloading
and extracting these empty archives - and not just on the first compile
(like on cedar-14), but every compile since the directory check will
never succeed.
parent 312a468c
No related branches found
No related tags found
No related merge requests found
# Python Buildpack Changelog
# Unreleased
The libffi/libmemcached vendoring step is now skipped on Heroku-16 (since they are installed in the base image).
# 115
Revert a pull request.
......
#!/usr/bin/env bash
# This script serves as the Cryptography build step of the
# This script serves as the cffi build step of the
# [**Python Buildpack**](https://github.com/heroku/heroku-buildpack-python)
# compiler.
#
......@@ -9,6 +9,11 @@
#
# This script is invoked by [`bin/compile`](/).
if [[ "$STACK" == "heroku-16" ]]; then
# libffi is pre-installed in the stack image so there is no need to vendor it.
return 0
fi
# The location of the pre-compiled libffi binary.
VENDORED_LIBFFI="https://lang-python.s3.amazonaws.com/$STACK/libraries/vendor/libffi.tar.gz"
......
......@@ -9,6 +9,11 @@
#
# This script is invoked by [`bin/compile`](/).
if [[ "$STACK" == "heroku-16" ]]; then
# libmemcached is pre-installed in the stack image so there is no need to vendor it.
return 0
fi
# The location of the pre-compiled libmemcached binary.
VENDORED_MEMCACHED="https://lang-python.s3.amazonaws.com/$STACK/libraries/vendor/libmemcache.tar.gz"
......@@ -16,7 +21,6 @@ VENDORED_MEMCACHED="https://lang-python.s3.amazonaws.com/$STACK/libraries/vendor
# shellcheck source=bin/utils
source "$BIN_DIR/utils"
# If pylibmc exists within requirements, use vendored libmemcached.
if (pip-grep -s requirements.txt pylibmc &> /dev/null) then
......
cffi
......@@ -47,6 +47,12 @@ testPsycopg2() {
assertCapturedSuccess
}
testCffi() {
compile "cffi"
assertCaptured "cffi"
assertCapturedSuccess
}
testPylibmc() {
compile "pylibmc"
assertCaptured "pylibmc"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment