Skip to content

Commit

Permalink
Merge pull request heroku#238 from heroku/develop
Browse files Browse the repository at this point in the history
v123
  • Loading branch information
dzuelke authored Sep 7, 2017
2 parents 82b6fbf + 8236b82 commit 821cb8d
Show file tree
Hide file tree
Showing 92 changed files with 224 additions and 448 deletions.
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# heroku-buildpack-php CHANGELOG

## v123 (2017-09-07)

### ADD

- ext-mongo/1.6.16 [David Zuelke]
- ext-newrelic/7.5.0.199 [David Zuelke]
- ext-cassandra/1.3.2 [David Zuelke]
- ext-rdkafka/3.0.4 [David Zuelke]
- ext-phalcon/3.2.2 [David Zuelke]
- PHP/7.1.9 [David Zuelke]
- PHP/7.0.23 [David Zuelke]
- ext-mongodb/1.2.10 [David Zuelke]

### CHG

- Support "heroku-sys-library" package type in platform installer [David Zuelke]
- Add new argument for "provide" platform package manifest entry to `manifest.py` [David Zuelke]
- Move libcassandra to its own package, installed as a dependency by platform installer [David Zuelke]
- Move libmemcached to its own package, installed as a dependency by platform installer (if the platform doesn't already provide it) [David Zuelke]
- Move librdkafka to its own package, installed as a dependency by platform installer [David Zuelke]
- libcassandra/2.7.0 [David Zuelke]
- librdkafka/0.11.0 [David Zuelke]
- Composer/1.5.1 [David Zuelke]

## v122 (2017-08-03)

### ADD
Expand Down
2 changes: 1 addition & 1 deletion bin/compile
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ fi
mkdir -p $build_dir/.heroku/php-min
ln -s $build_dir/.heroku/php-min /app/.heroku/php-min

curl_retry_on_18 --fail --silent --location -o $build_dir/.heroku/php-min.tar.gz "${s3_url}php-min-7.0.22.tar.gz" || error "Failed to download minimal PHP for bootstrapping.
curl_retry_on_18 --fail --silent --location -o $build_dir/.heroku/php-min.tar.gz "${s3_url}php-min-7.0.23.tar.gz" || error "Failed to download minimal PHP for bootstrapping.
Please try again, or contact support if this problem persists."
tar xzf $build_dir/.heroku/php-min.tar.gz -C $build_dir/.heroku/php-min
rm $build_dir/.heroku/php-min.tar.gz
Expand Down
6 changes: 5 additions & 1 deletion support/build/_util/include/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
require = json.loads(sys.argv[5]) if len(sys.argv) > 5 else {}
stack=re.match("^([^-]+)(?:-([0-9]+))?$", os.getenv("STACK", "cedar-14"))
require["heroku-sys/"+stack.group(1)] = "^{}.0.0".format(stack.group(2) or "1")

require["heroku/installer-plugin"] = "^1.2.0"
if sys.argv[1] == 'heroku-sys-library':
require["heroku/installer-plugin"] = "^1.3.0"

manifest = {
"type": sys.argv[1],
Expand All @@ -16,7 +19,8 @@
"require": require,
"conflict": json.loads(sys.argv[6]) if len(sys.argv) > 6 else {},
"replace": json.loads(sys.argv[7]) if len(sys.argv) > 7 else {},
"extra": json.loads(sys.argv[8]) if len(sys.argv) > 8 else {},
"provide": json.loads(sys.argv[8]) if len(sys.argv) > 8 else {},
"extra": json.loads(sys.argv[9]) if len(sys.argv) > 9 else {},
"time": datetime.datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S")
}

Expand Down
6 changes: 6 additions & 0 deletions support/build/_util/include/manifest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,9 @@ print_or_export_manifest_cmd() {
generate_manifest_cmd() {
echo "s3cmd --ssl${AWS_ACCESS_KEY_ID+" --access_key=\$AWS_ACCESS_KEY_ID"}${AWS_SECRET_ACCESS_KEY+" --secret_key=\$AWS_SECRET_ACCESS_KEY"} --acl-public -m application/json put $(pwd)/${1} s3://${S3_BUCKET}/${S3_PREFIX}${1}"
}

soname_version() {
soname=$(objdump -p $1 | grep SONAME | awk '{ printf $2; }')
file=$(basename $1)
echo "${soname#${file}.}"
}
2 changes: 1 addition & 1 deletion support/build/_util/sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ if [[ $# -gt 2 ]]; then
else
dst_region="s3"
fi
echo "$@"

src_bucket=${1:-$S3_BUCKET}; shift || true
src_prefix=${1:-$S3_PREFIX}; shift || true
if [[ $# == "1" ]]; then
Expand Down
5 changes: 3 additions & 2 deletions support/build/apache
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ rm -rf ${OUT_PREFIX}/man ${OUT_PREFIX}/share/apache2/manual

MANIFEST_REQUIRE="${MANIFEST_REQUIRE:-"{}"}"
MANIFEST_CONFLICT="${MANIFEST_CONFLICT:-"{}"}"
MANIFEST_EXTRA="${MANIFEST_EXTRA:-"{\"export\":\"bin/export.apache2.sh\",\"profile\":\"bin/profile.apache2.sh\"}"}"
MANIFEST_REPLACE="${MANIFEST_REPLACE:-"{}"}"
MANIFEST_PROVIDE="${MANIFEST_PROVIDE:-"{}"}"
MANIFEST_EXTRA="${MANIFEST_EXTRA:-"{\"export\":\"bin/export.apache2.sh\",\"profile\":\"bin/profile.apache2.sh\"}"}"

mkdir -p ${OUT_PREFIX}/etc/apache2
cp $(dirname $BASH_SOURCE)/_conf/apache2/httpd.conf ${OUT_PREFIX}/etc/apache2/httpd.conf
Expand All @@ -67,6 +68,6 @@ cat > ${OUT_PREFIX}/bin/profile.apache2.sh <<'EOF'
export PATH="$HOME/.heroku/php/bin:$HOME/.heroku/php/sbin:$PATH"
EOF

python $(dirname $BASH_SOURCE)/_util/include/manifest.py "heroku-sys-webserver" "heroku-sys/${dep_name}" "$dep_version" "${dep_formula}.tar.gz" "$MANIFEST_REQUIRE" "$MANIFEST_CONFLICT" "$MANIFEST_REPLACE" "$MANIFEST_EXTRA" > $dep_manifest
python $(dirname $BASH_SOURCE)/_util/include/manifest.py "heroku-sys-webserver" "heroku-sys/${dep_name}" "$dep_version" "${dep_formula}.tar.gz" "$MANIFEST_REQUIRE" "$MANIFEST_CONFLICT" "$MANIFEST_REPLACE" "$MANIFEST_PROVIDE" "$MANIFEST_EXTRA" > $dep_manifest

print_or_export_manifest_cmd "$(generate_manifest_cmd "$dep_manifest")"
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/php/
# Build Deps: php-min-7.0.22
# Build Deps: php-min-7.0.23

source $(dirname $0)/composer
5 changes: 3 additions & 2 deletions support/build/extensions/no-debug-non-zts-20121212/blackfire
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,11 @@ EOF

MANIFEST_REQUIRE="${MANIFEST_REQUIRE:-"{\"heroku-sys/php\":\"${series}.*\"}"}"
MANIFEST_CONFLICT="${MANIFEST_CONFLICT:-"{\"heroku-sys/hhvm\":\"*\"}"}"
MANIFEST_EXTRA="${MANIFEST_EXTRA:-"{\"config\":\"etc/php/conf.d/blackfire.ini-dist\",\"profile\":\"bin/profile.blackfire.sh\"}"}"
MANIFEST_REPLACE="${MANIFEST_REPLACE:-"{}"}"
MANIFEST_PROVIDE="${MANIFEST_PROVIDE:-"{}"}"
MANIFEST_EXTRA="${MANIFEST_EXTRA:-"{\"config\":\"etc/php/conf.d/blackfire.ini-dist\",\"profile\":\"bin/profile.blackfire.sh\"}"}"

python $(dirname $BASH_SOURCE)/../../_util/include/manifest.py "heroku-sys-php-extension" "heroku-sys/ext-${dep_name}" "$dep_version" "${dep_formula}.tar.gz" "$MANIFEST_REQUIRE" "$MANIFEST_CONFLICT" "$MANIFEST_REPLACE" "$MANIFEST_EXTRA" > $dep_manifest
python $(dirname $BASH_SOURCE)/../../_util/include/manifest.py "heroku-sys-php-extension" "heroku-sys/ext-${dep_name}" "$dep_version" "${dep_formula}.tar.gz" "$MANIFEST_REQUIRE" "$MANIFEST_CONFLICT" "$MANIFEST_REPLACE" "$MANIFEST_PROVIDE" "$MANIFEST_EXTRA" > $dep_manifest

print_or_export_manifest_cmd "$(generate_manifest_cmd "$dep_manifest")"

Expand Down
49 changes: 16 additions & 33 deletions support/build/extensions/no-debug-non-zts-20121212/cassandra
Original file line number Diff line number Diff line change
@@ -1,45 +1,28 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/php/

# fail hard
set -o pipefail
# fail harder
set -eu
# we need libgmp-dev
needed=( libgmp-dev )
missing=$(comm -1 -3 <(dpkg-query -W -f '${package}\n' | sort) <(IFS=$'\n'; echo "${needed[*]}" | sort))
if [[ "$missing" ]]; then
apt-get update -qq || { echo "Failed to 'apt-get update'. You must build this formula using Docker."; exit 1; }
apt-get install -q -y $missing
fi

source $(dirname $BASH_SOURCE)/../../_util/include/manifest.sh
dep_name=$(basename $BASH_SOURCE)

OUT_PREFIX=$1
export PATH=${OUT_PREFIX}/bin:${PATH}

ZEND_MODULE_API_VERSION=$(basename $(dirname $0))
ZEND_MODULE_API_VERSION=${ZEND_MODULE_API_VERSION#no-debug-non-zts-}

# we need to declare the required version of libcassandra
dep_formula=${0#$WORKSPACE_DIR/}
dep_name=$(basename $BASH_SOURCE)
dep_version=${dep_formula##*"/${dep_name}-"}
dep_package=ext-${dep_name}-${dep_version}
case ${ZEND_MODULE_API_VERSION} in
20121212)
series=5.5
;;
20131226)
series=5.6
;;
20151012)
series=7.0
;;
20160303)
series=7.1
series=$(php-config --version | cut -d. -f1,2) # get "5.5", "5.6", "7.0" etc for the php requirement in the manifest
case "$dep_version" in
*)
MANIFEST_REQUIRE="${MANIFEST_REQUIRE:-"{\"heroku-sys/php\":\"${series}.*\",\"heroku-sys/libcassandra\":\"^2.7.0\",\"heroku-sys/libcassandra-abi\":\"^2\"}"}"
;;
esac
dep_manifest=${dep_package}_php-$series.composer.json

echo "-----> Merging dependencies..."

MANIFEST_REQUIRE="${MANIFEST_REQUIRE:-"{\"heroku-sys/php\":\"${series}.*\"}"}"
MANIFEST_CONFLICT="${MANIFEST_CONFLICT:-"{\"heroku-sys/hhvm\":\"*\"}"}"
MANIFEST_EXTRA="${MANIFEST_EXTRA:-"{}"}"
MANIFEST_REPLACE="${MANIFEST_REPLACE:-"{}"}"

python $(dirname $BASH_SOURCE)/../../_util/include/manifest.py "heroku-sys-php-extension" "heroku-sys/ext-${dep_name}" "$dep_version" "${dep_formula}.tar.gz" "$MANIFEST_REQUIRE" "$MANIFEST_CONFLICT" "$MANIFEST_REPLACE" "$MANIFEST_EXTRA" > $dep_manifest
CONFIGURE_EXTRA="--with-cassandra=${OUT_PREFIX}"

print_or_export_manifest_cmd "$(generate_manifest_cmd "$dep_manifest")"
source $(dirname $BASH_SOURCE)/../pecl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/php/
# Build Deps: extensions/no-debug-non-zts-20121212/cassandra-bare-1.2.2, libraries/libcassandra-2.6.0
# Build Deps: php-5.5.38, libraries/libcassandra-2.7.0

source $(dirname $0)/cassandra
55 changes: 0 additions & 55 deletions support/build/extensions/no-debug-non-zts-20121212/cassandra-bare

This file was deleted.

This file was deleted.

95 changes: 56 additions & 39 deletions support/build/extensions/no-debug-non-zts-20121212/memcached
Original file line number Diff line number Diff line change
@@ -1,51 +1,68 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/php/

# fail hard
set -o pipefail
# fail harder
set -eu

source $(dirname $BASH_SOURCE)/../../_util/include/manifest.sh
dep_name=$(basename $BASH_SOURCE)

OUT_PREFIX=$1
export PATH=${OUT_PREFIX}/bin:${PATH}

ZEND_MODULE_API_VERSION=$(basename $(dirname $0))
ZEND_MODULE_API_VERSION=${ZEND_MODULE_API_VERSION#no-debug-non-zts-}
# can't build without this
needed=( libsasl2-2 )
missing=$(comm -1 -3 <(dpkg-query -W -f '${package}\n' | sort) <(IFS=$'\n'; echo "${needed[*]}" | sort))
if [[ "$missing" ]]; then
echo "Error! Missing libraries: $missing"
exit 1
fi

dep_formula=${0#$WORKSPACE_DIR/}
dep_name=$(basename $BASH_SOURCE)
dep_version=${dep_formula##*"/${dep_name}-"}
dep_package=ext-${dep_name}-${dep_version}
case ${ZEND_MODULE_API_VERSION} in
20121212)
series=5.5
;;
20131226)
series=5.6
;;
20151012)
series=7.0
;;
20160303)
series=7.1
;;
esac
dep_manifest=${dep_package}_php-$series.composer.json

echo "-----> Merging dependencies..."
# let's see if libmemcached is there, if not then we have to use the vendored one
needed=( libmemcached11 )
missing=$(comm -1 -3 <(dpkg-query -W -f '${package}\n' | sort) <(IFS=$'\n'; echo "${needed[*]}" | sort))
if [[ "$missing" ]]; then
echo "Using vendored libmemcached..."
# use vendored libmcrypt
CONFIGURE_EXTRA="--with-libmemcached-dir=${OUT_PREFIX}"

# we need to declare the required version of libmemcached
dep_formula=${0#$WORKSPACE_DIR/}
dep_version=${dep_formula##*"/${dep_name}-"}
series=$(php-config --version | cut -d. -f1,2) # get "5.5", "5.6", "7.0" etc for the php requirement in the manifest
case "$dep_version" in
*)
MANIFEST_REQUIRE="${MANIFEST_REQUIRE:-"{\"heroku-sys/php\":\"${series}.*\",\"heroku-sys/libmemcached\":\"^1.0.18\",\"heroku-sys/libmemcached-abi\":\"^11\"}"}"
;;
esac

else
echo "Using system libmemcached..."
# use system libmemcached
CONFIGURE_EXTRA=
# but do we need headers?
needed=( libmemcached-dev )
missing=$(comm -1 -3 <(dpkg-query -W -f '${package}\n' | sort) <(IFS=$'\n'; echo "${needed[*]}" | sort))
if [[ "$missing" ]]; then
apt-get update -qq || { echo "Failed to 'apt-get update'. You must build this formula using Docker."; exit 1; }
apt-get install -q -y $missing
fi
fi

# we need libsasl2-dev for ext-memcached
needed=( libsasl2-dev )
missing=$(comm -1 -3 <(dpkg-query -W -f '${package}\n' | sort) <(IFS=$'\n'; echo "${needed[*]}" | sort))
if [[ "$missing" ]]; then
apt-get update -qq || { echo "Failed to 'apt-get update'. You must build this formula using Docker."; exit 1; }
apt-get install -q -y $missing
fi

MANIFEST_EXTRA="${MANIFEST_EXTRA:-"{\"config\":\"etc/php/conf.d/memcached.ini-dist\"}"}"

source $(dirname $BASH_SOURCE)/../pecl

mkdir -p ${OUT_PREFIX}/etc/php/conf.d
cat > ${OUT_PREFIX}/etc/php/conf.d/memcached.ini-dist <<'EOF'
extension = memcached.so
EOF
if [[ $dep_version == 2.* ]]; then
# this setting is gone in v3; SASL gets initialized on demand
cat >> ${OUT_PREFIX}/etc/php/conf.d/memcached.ini-dist <<'EOF'
memcached.use_sasl = 1
EOF

MANIFEST_REQUIRE="${MANIFEST_REQUIRE:-"{\"heroku-sys/php\":\"${series}.*\"}"}"
MANIFEST_CONFLICT="${MANIFEST_CONFLICT:-"{\"heroku-sys/hhvm\":\"*\"}"}"
MANIFEST_EXTRA="${MANIFEST_EXTRA:-"{\"config\":\"etc/php/conf.d/memcached.ini-dist\"}"}"
MANIFEST_REPLACE="${MANIFEST_REPLACE:-"{}"}"

python $(dirname $BASH_SOURCE)/../../_util/include/manifest.py "heroku-sys-php-extension" "heroku-sys/ext-${dep_name}" "$dep_version" "${dep_formula}.tar.gz" "$MANIFEST_REQUIRE" "$MANIFEST_CONFLICT" "$MANIFEST_REPLACE" "$MANIFEST_EXTRA" > $dep_manifest

print_or_export_manifest_cmd "$(generate_manifest_cmd "$dep_manifest")"
fi
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/php/
# Build Deps: extensions/no-debug-non-zts-20121212/memcached-bare-2.2.0, libraries/libmemcached-1.0.18

# That's it - we're combining the dep build and the extension build here
# Build Deps: php-5.5.38, libraries/libmemcached-1.0.18

source $(dirname $0)/memcached
Loading

0 comments on commit 821cb8d

Please sign in to comment.