Skip to content

Commit

Permalink
Support python not being symlinked to python2
Browse files Browse the repository at this point in the history
Historically the Ubuntu `python2.7` package has symlinked `python` to
`python2`. However starting in Ubuntu 20.04, this symlink is no longer
created, and one must explicitly call `python2` (or `python3`) instead.

Unfortunately we cannot just `s/python/python2/` throughout, since this
buildpack aims to also support OS X for local development workflows, and
on OS X system Python (which is Python 2) is only available as `python`
and not also as `python2`. Whilst homebrew Python does have `python{2,3}`
binaries, we don't want to require use of it.

As such, for the scripts that may be run locally (`bin/heroku_*`), they
must now check for the presence of either `python2` or `python`.

This change is a no-op for current stacks, but is landing now to reduce
the size of the Heroku-20 support PR.

In the future we'll want to convert these usages to Python 3, however
we are explicitly not doing so for now, since:
* this work is holding up the Heroku-20 release, and a no-op change is
  safer to land quickly than changing version
* Python 3 is not available out of the box on OS X, so we'd still have to
  use Python 2 there, which would mean needing to test against multiple
  Python versions in CI to ensure continued Python 2 compatibility. This
  is doable, but should not be on the critical path for releasing
  Heroku-20.

Refs W-7491249.
  • Loading branch information
edmorley authored and dzuelke committed May 18, 2020
1 parent bf3c496 commit 04c5e14
Show file tree
Hide file tree
Showing 24 changed files with 57 additions and 37 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
- PHP/7.3.18 [David Zuelke]
- PHP/7.4.6 [David Zuelke]

### CHG

- Support `python` not being symlinked to `python2` [Ed Morley]

## v174 (2020-04-30)

### ADD
Expand Down
18 changes: 9 additions & 9 deletions bin/compile
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ composer_lock_parse_error=$(

# a bunch of sanity checks first
if [[ -s "$COMPOSER" ]]; then
cat "$COMPOSER" | python -mjson.tool &> /dev/null || {
cat "$COMPOSER" | python2 -mjson.tool &> /dev/null || {
mcount "failures.composer_json.lint"
error <<-EOF
Basic validation for '$COMPOSER' failed!
Expand All @@ -112,7 +112,7 @@ if [[ -s "$COMPOSER" ]]; then
EOF
}
if [[ ! -f "$COMPOSER_LOCK" ]]; then
cat "$COMPOSER" | python -c 'import sys, json; sys.exit(bool(json.load(sys.stdin).get("require", {})))' 2> /dev/null || {
cat "$COMPOSER" | python2 -c 'import sys, json; sys.exit(bool(json.load(sys.stdin).get("require", {})))' 2> /dev/null || {
mcount "failures.composer_lock.missing"
error <<-EOF
No '$COMPOSER_LOCK' found!
Expand Down Expand Up @@ -144,7 +144,7 @@ if [[ -s "$COMPOSER" ]]; then
EOF
}
else
cat "$COMPOSER_LOCK" | python -mjson.tool &> /dev/null || {
cat "$COMPOSER_LOCK" | python2 -mjson.tool &> /dev/null || {
mcount "failures.composer_lock.lint"
error "$composer_lock_parse_error"
}
Expand Down Expand Up @@ -310,7 +310,7 @@ composer validate --no-plugins --no-check-publish --no-check-all --quiet "$COMPO
}

# if prefer-stable is false and minimum-stability is not stable, warn about potential unstable platform installs
[[ ! -f "$COMPOSER_LOCK" ]] || minimum_stability=$(cat "$COMPOSER_LOCK" | python -c 'import sys, json; l = json.load(sys.stdin); print(l.get("minimum-stability")); sys.exit(l.get("minimum-stability", "stable") != "stable" and l.get("prefer-stable", False) == False);' 2> /dev/null) || {
[[ ! -f "$COMPOSER_LOCK" ]] || minimum_stability=$(cat "$COMPOSER_LOCK" | python2 -c 'import sys, json; l = json.load(sys.stdin); print(l.get("minimum-stability")); sys.exit(l.get("minimum-stability", "stable") != "stable" and l.get("prefer-stable", False) == False);' 2> /dev/null) || {
possible_stabilities="dev, alpha, beta, or RC"
case $minimum_stability in
alpha)
Expand Down Expand Up @@ -639,7 +639,7 @@ unset COMPOSER_GITHUB_OAUTH_TOKEN

# install dependencies unless composer.json is completely empty (in which case it'd talk to packagist.org which may be slow and is unnecessary)
export_env_dir "$env_dir" '^[A-Z_][A-Z0-9_]*$' '^(HOME|PATH|GIT_DIR|CPATH|CPPATH|LD_PRELOAD|LIBRARY_PATH|LD_LIBRARY_PATH|STACK|REQUEST_ID|IFS|HEROKU_PHP_INSTALL_DEV|BPLOG_PREFIX|BUILDPACK_LOG_FILE|PHP_INI_SCAN_DIR)$'
if cat "$COMPOSER" | python -c 'import sys,json; sys.exit(not json.load(sys.stdin));'; then
if cat "$COMPOSER" | python2 -c 'import sys,json; sys.exit(not json.load(sys.stdin));'; then
install_log=$(mktemp -t heroku-buildpack-php-composer-install-log-XXXX)
composer install ${HEROKU_PHP_INSTALL_DEV-"--no-dev"} --prefer-dist --optimize-autoloader --no-interaction 2>&1 | tee "$install_log" | indent || {
code=$?
Expand Down Expand Up @@ -697,7 +697,7 @@ fi
# log number of installed dependencies
mmeasure "dependencies.count" $(composer show --installed 2> /dev/null | wc -l)

if cat "$COMPOSER" | python -c 'import sys,json; sys.exit("compile" not in json.load(sys.stdin).get("scripts", {}));'; then
if cat "$COMPOSER" | python2 -c 'import sys,json; sys.exit("compile" not in json.load(sys.stdin).get("scripts", {}));'; then
status "Running 'composer compile'..."
composer run-script ${HEROKU_PHP_INSTALL_DEV-"--no-dev"} --no-interaction compile 2>&1 | indent || {
mcount "failures.compile_step"
Expand Down Expand Up @@ -725,15 +725,15 @@ status "Preparing runtime environment..."
# TODO: warn if require-dev has the package using a different branch
shopt -u dotglob # we don't want .git, .gitignore et al
# figure out the package dir name to write to and copy to it
hbpdir="$composer_vendordir/$(cat $bp_dir/composer.json | python -c 'import sys, json; print(json.load(sys.stdin)["name"])')"
hbpdir="$composer_vendordir/$(cat $bp_dir/composer.json | python2 -c 'import sys, json; print(json.load(sys.stdin)["name"])')"
mkdir -p "$build_dir/$hbpdir"
cp -r "$bp_dir"/* "$build_dir/$hbpdir/"
# make bin dir, just in case
mkdir -p "$build_dir/$composer_bindir"
# figure out shortest relative path from vendor/heroku/heroku-buildpack-php to vendor/bin (or whatever the bin dir is)
relbin=$(python -c "import os.path; print(os.path.relpath('$hbpdir', '$composer_bindir'))")
relbin=$(python2 -c "import os.path; print(os.path.relpath('$hbpdir', '$composer_bindir'))")
# collect bin names from composer.json
relbins=$(cat $bp_dir/composer.json | python -c 'from __future__ import print_function; import sys, json; { print(sys.argv[1]+"/"+bin) for bin in json.load(sys.stdin)["bin"] }' $relbin)
relbins=$(cat $bp_dir/composer.json | python2 -c 'from __future__ import print_function; import sys, json; { print(sys.argv[1]+"/"+bin) for bin in json.load(sys.stdin)["bin"] }' $relbin)
# link to bins
cd $build_dir/$composer_bindir
ln -fs $relbins .
Expand Down
6 changes: 5 additions & 1 deletion bin/heroku-hhvm-apache2
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ if ! type -p "realpath" > /dev/null; then
# readlink is not an option because BSD readlink does not have the GNU -f option
# must be a function so subshells, including $(…), can use it
realpath() {
python -c 'import os,sys; print(os.path.realpath(sys.argv[1]))' "$@"
# Required since OS X's Python 2 binary is named `python` not `python2`,
# and on newer Ubuntu `python` no longer exists.
python_bin=$(command -v python2 python) || { echo "This program requires 'python2' or 'python' to be on \$PATH." >&2; exit 1; }
python_bin=$(head -n1 <<< "$python_bin") # Only use the first path if both were present
"$python_bin" -c 'import os,sys; print(os.path.realpath(sys.argv[1]))' "$@"
}
fi

Expand Down
6 changes: 5 additions & 1 deletion bin/heroku-hhvm-nginx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ if ! type -p "realpath" > /dev/null; then
# readlink is not an option because BSD readlink does not have the GNU -f option
# must be a function so subshells, including $(…), can use it
realpath() {
python -c 'import os,sys; print(os.path.realpath(sys.argv[1]))' "$@"
# Required since OS X's Python 2 binary is named `python` not `python2`,
# and on newer Ubuntu `python` no longer exists.
python_bin=$(command -v python2 python) || { echo "This program requires 'python2' or 'python' to be on \$PATH." >&2; exit 1; }
python_bin=$(head -n1 <<< "$python_bin") # Only use the first path if both were present
"$python_bin" -c 'import os,sys; print(os.path.realpath(sys.argv[1]))' "$@"
}
fi

Expand Down
6 changes: 5 additions & 1 deletion bin/heroku-php-apache2
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ if ! type -p "realpath" > /dev/null; then
# readlink is not an option because BSD readlink does not have the GNU -f option
# must be a function so subshells, including $(…), can use it
realpath() {
python -c 'import os,sys; print(os.path.realpath(sys.argv[1]))' "$@"
# Required since OS X's Python 2 binary is named `python` not `python2`,
# and on newer Ubuntu `python` no longer exists.
python_bin=$(command -v python2 python) || { echo "This program requires 'python2' or 'python' to be on \$PATH." >&2; exit 1; }
python_bin=$(head -n1 <<< "$python_bin") # Only use the first path if both were present
"$python_bin" -c 'import os,sys; print(os.path.realpath(sys.argv[1]))' "$@"
}
fi

Expand Down
6 changes: 5 additions & 1 deletion bin/heroku-php-nginx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ if ! type -p "realpath" > /dev/null; then
# readlink is not an option because BSD readlink does not have the GNU -f option
# must be a function so subshells, including $(…), can use it
realpath() {
python -c 'import os,sys; print(os.path.realpath(sys.argv[1]))' "$@"
# Required since OS X's Python 2 binary is named `python` not `python2`,
# and on newer Ubuntu `python` no longer exists.
python_bin=$(command -v python2 python) || { echo "This program requires 'python2' or 'python' to be on \$PATH." >&2; exit 1; }
python_bin=$(head -n1 <<< "$python_bin") # Only use the first path if both were present
"$python_bin" -c 'import os,sys; print(os.path.realpath(sys.argv[1]))' "$@"
}
fi

Expand Down
2 changes: 1 addition & 1 deletion support/build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ For example, the Apache HTTPD web server is built roughly as follows:
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_PROVIDE" "$MANIFEST_EXTRA" > $dep_manifest
python2 $(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")"

Expand Down
2 changes: 1 addition & 1 deletion support/build/_util/mkrepo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ if $upload || [[ -t 1 ]]; then
fi

# sort so that packages with the same name and version (e.g. ext-memcached 2.2.0) show up with their hhvm or php requirement in descending order - otherwise a Composer limitation means that a simple "ext-memcached: * + php: ^5.5.17" request would install 5.5.latest and not 5.6.latest, as it finds the 5.5.* requirement extension first and sticks to that instead of 5.6. For packages with identical names and versions (but different e.g. requirements), Composer basically treats them as equal and picks as a winner whatever it finds first. The requirements have to be written like "x.y.*" for this to work of course.
python -c 'import sys, json; from distutils import version; json.dump({"packages": [ sorted([json.load(open(item)) for item in sys.argv[1:] if json.load(open(item)).get("type", "") != "heroku-sys-package"], key=lambda package: version.LooseVersion(package.get("require", {}).get("heroku-sys/hhvm", package.get("require", {}).get("heroku-sys/php", "0.0.0"))), reverse=True) ] }, sys.stdout, sort_keys=True)' $manifests
python2 -c 'import sys, json; from distutils import version; json.dump({"packages": [ sorted([json.load(open(item)) for item in sys.argv[1:] if json.load(open(item)).get("type", "") != "heroku-sys-package"], key=lambda package: version.LooseVersion(package.get("require", {}).get("heroku-sys/hhvm", package.get("require", {}).get("heroku-sys/php", "0.0.0"))), reverse=True) ] }, sys.stdout, sort_keys=True)' $manifests

# restore stdout
# note that 'exec >$(tty)' does not work as FD 1 may have been a pipe originally and not a tty
Expand Down
2 changes: 1 addition & 1 deletion support/build/_util/remove.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ echo "" >&2
remove_files=()
for manifest in "${manifests[@]}"; do
echo "Removing $(basename $manifest ".composer.json"):" >&2
if filename=$(cat $manifests_tmp/$(basename $manifest) | python <(cat <<-'PYTHON' # beware of single quotes in body
if filename=$(cat $manifests_tmp/$(basename $manifest) | python2 <(cat <<-'PYTHON' # beware of single quotes in body
import sys, json, re;
manifest=json.load(sys.stdin)
url=manifest.get("dist",{}).get("url","").partition("https://"+sys.argv[1]+"."+sys.argv[2]+".amazonaws.com/"+sys.argv[3])
Expand Down
8 changes: 4 additions & 4 deletions support/build/_util/sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ echo "" >&2

# this mkrepo.sh call won't actually download, but use the given *.composer.json, and echo a generated packages.json
# we use this to compare to the downloaded packages.json
$here/mkrepo.sh $src_bucket $src_prefix ${src_tmp}/*.composer.json 2>/dev/null | python -c 'import sys, json; sys.exit(json.load(open(sys.argv[1])) != json.load(sys.stdin))' ${src_tmp}/packages.json || {
$here/mkrepo.sh $src_bucket $src_prefix ${src_tmp}/*.composer.json 2>/dev/null | python2 -c 'import sys, json; sys.exit(json.load(open(sys.argv[1])) != json.load(sys.stdin))' ${src_tmp}/packages.json || {
cat >&2 <<-EOF
WARNING: packages.json from source does not match its list of manifests!
You should run 'mkrepo.sh' to update, or ask the bucket maintainers to do so.
Expand All @@ -113,7 +113,7 @@ update_manifests=()
ignore_manifests=()
for filename in $common; do
result=0
python <(cat <<-'PYTHON' # beware of single quotes in body
python2 <(cat <<-'PYTHON' # beware of single quotes in body
from __future__ import print_function
import sys, json, os, datetime
# for python 2+3 compat
Expand Down Expand Up @@ -204,7 +204,7 @@ echo "" >&2
copied_files=()
for manifest in $add_manifests ${update_manifests[@]:-}; do
echo "Copying ${manifest%.composer.json}:" >&2
if filename=$(cat ${src_tmp}/${manifest} | python <(cat <<-'PYTHON' # beware of single quotes in body
if filename=$(cat ${src_tmp}/${manifest} | python2 <(cat <<-'PYTHON' # beware of single quotes in body
import sys, json;
manifest=json.load(sys.stdin)
url=manifest.get("dist",{}).get("url","").partition("https://"+sys.argv[1]+"."+sys.argv[2]+".amazonaws.com/"+sys.argv[3])
Expand Down Expand Up @@ -239,7 +239,7 @@ done
remove_files=()
for manifest in $remove_manifests; do
echo "Removing ${manifest%.composer.json}:" >&2
if filename=$(cat ${dst_tmp}/${manifest} | python <(cat <<-'PYTHON' # beware of single quotes in body
if filename=$(cat ${dst_tmp}/${manifest} | python2 <(cat <<-'PYTHON' # beware of single quotes in body
import sys, json;
manifest=json.load(sys.stdin)
url=manifest.get("dist",{}).get("url","").partition("https://"+sys.argv[1]+"."+sys.argv[2]+".amazonaws.com/"+sys.argv[3])
Expand Down
2 changes: 1 addition & 1 deletion support/build/apache
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,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_PROVIDE" "$MANIFEST_EXTRA" > $dep_manifest
python2 $(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")"
2 changes: 1 addition & 1 deletion support/build/composer
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ mkdir -p ${OUT_PREFIX}/bin

mv composer.phar ${OUT_PREFIX}/bin/composer

python $(dirname $BASH_SOURCE)/_util/include/manifest.py "heroku-sys-package" "heroku-sys/pkg-${dep_name}" "$dep_version" "${dep_formula}.tar.gz" > $dep_manifest
python2 $(dirname $BASH_SOURCE)/_util/include/manifest.py "heroku-sys-package" "heroku-sys/pkg-${dep_name}" "$dep_version" "${dep_formula}.tar.gz" > $dep_manifest

print_or_export_manifest_cmd "$(generate_manifest_cmd "$dep_manifest")"
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ 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_PROVIDE" "$MANIFEST_EXTRA" > $dep_manifest
python2 $(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
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,6 @@ MANIFEST_REPLACE="${MANIFEST_REPLACE:-"{}"}"
MANIFEST_PROVIDE="${MANIFEST_PROVIDE:-"{}"}"
MANIFEST_EXTRA="${MANIFEST_EXTRA:-"{\"config\":\"etc/php/conf.d/newrelic.ini-dist\",\"profile\":\"bin/profile.newrelic.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_PROVIDE" "$MANIFEST_EXTRA" > $dep_manifest
python2 $(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")"
2 changes: 1 addition & 1 deletion support/build/extensions/no-debug-non-zts-20121212/phalcon
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ case "$dep_version" in
esac
MANIFEST_CONFLICT="${MANIFEST_CONFLICT:-"{\"heroku-sys/hhvm\":\"*\"}"}"

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" > $dep_manifest
python2 $(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" > $dep_manifest

print_or_export_manifest_cmd "$(generate_manifest_cmd "$dep_manifest")"
2 changes: 1 addition & 1 deletion support/build/extensions/no-debug-non-zts-20151012/apcu
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,6 @@ MANIFEST_REPLACE="${MANIFEST_REPLACE:-"{\"heroku-sys/ext-apc\":\"self.version\"}
MANIFEST_PROVIDE="${MANIFEST_PROVIDE:-"{}"}"
MANIFEST_EXTRA="${MANIFEST_EXTRA:-"{\"config\":\"etc/php/conf.d/apcu-apc.ini-dist\"}"}"

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
python2 $(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")"
2 changes: 1 addition & 1 deletion support/build/extensions/pecl
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ MANIFEST_REPLACE="${MANIFEST_REPLACE:-"{}"}"
MANIFEST_PROVIDE="${MANIFEST_PROVIDE:-"{}"}"
MANIFEST_EXTRA="${MANIFEST_EXTRA:-"{}"}"

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
python2 $(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")"
4 changes: 2 additions & 2 deletions support/build/hhvm
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ curl -sS https://getcomposer.org/installer | hhvm --php

MANIFEST_REQUIRE="${MANIFEST_REQUIRE:-"{}"}"
MANIFEST_CONFLICT="${MANIFEST_CONFLICT:-"{\"heroku-sys/php\":\"*\"}"}"
MANIFEST_REPLACE=$(hhvm --php composer.phar show --platform | grep -E '^(ext-\S+|php-64bit\b|php\b)' | tr -s " " | cut -d " " -f1,2 | sed -e "s/ $dep_version\$/ self.version/" -e 's/^/heroku-sys\//' | python -c 'import sys, json; json.dump(dict(item.split() for item in sys.stdin), sys.stdout)')
MANIFEST_REPLACE=$(hhvm --php composer.phar show --platform | grep -E '^(ext-\S+|php-64bit\b|php\b)' | tr -s " " | cut -d " " -f1,2 | sed -e "s/ $dep_version\$/ self.version/" -e 's/^/heroku-sys\//' | python2 -c 'import sys, json; json.dump(dict(item.split() for item in sys.stdin), sys.stdout)')
MANIFEST_PROVIDE="${MANIFEST_PROVIDE:-"{}"}"
MANIFEST_EXTRA="${MANIFEST_EXTRA:-"{\"export\":\"bin/export.hhvm.sh\",\"profile\":\"bin/profile.hhvm.sh\"}"}"

Expand All @@ -95,6 +95,6 @@ composer() { hhvm $(which composer) "$@"; }
export -f composer
EOF

python $(dirname $BASH_SOURCE)/_util/include/manifest.py "heroku-sys-hhvm" "heroku-sys/${dep_name}" "$dep_version" "${dep_formula}.tar.gz" "$MANIFEST_REQUIRE" "$MANIFEST_CONFLICT" "$MANIFEST_REPLACE" "$MANIFEST_PROVIDE" "$MANIFEST_EXTRA" > $dep_manifest
python2 $(dirname $BASH_SOURCE)/_util/include/manifest.py "heroku-sys-hhvm" "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")"
Loading

0 comments on commit 04c5e14

Please sign in to comment.