Skip to content

Commit f11fce9

Browse files
authored
Merge pull request #795 from heroku/post-heroku-20-cleanups
Post-heroku-20 cleanups
2 parents 9dda1ef + 292239f commit f11fce9

File tree

12 files changed

+14
-188
lines changed

12 files changed

+14
-188
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ env:
2222
HATCHET_BUILDPACK_BRANCH: ${{ github.head_ref || github.ref_name }}
2323
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
2424
HEROKU_API_USER: ${{ secrets.HEROKU_API_USER }}
25-
S5CMD_VERSION: 2.2.2
26-
S5CMD_HASH: "392c385320cd5ffa435759a95af77c215553d967e4b1c0fffe52e4f14c29cf85 s5cmd_2.2.2_linux_amd64.deb"
2725

2826
jobs:
2927
integration-test:
@@ -50,16 +48,13 @@ jobs:
5048
with:
5149
php-version: "8.3"
5250
tools: "composer:2.8"
53-
- name: Install packages from requirements.txt, plus s5cmd (for some tests)
51+
- name: Install packages from requirements.txt (for some tests in platform_spec.rb that run mkrepo.sh which needs natsort)
5452
run: |
5553
export VIRTUAL_ENV=$HOME/.venv
5654
python3 -m venv "$VIRTUAL_ENV"
5755
export PATH=$VIRTUAL_ENV/bin:$PATH
5856
pip install -r requirements.txt
59-
curl -sSLO https://github.com/peak/s5cmd/releases/download/v${S5CMD_VERSION}/s5cmd_${S5CMD_VERSION}_linux_amd64.deb
60-
echo "$S5CMD_HASH" | shasum -c -
61-
dpkg -x "s5cmd_${S5CMD_VERSION}_linux_amd64.deb" .
62-
echo "$HOME/usr/bin:$VIRTUAL_ENV/bin" >> "$GITHUB_PATH"
57+
echo "$VIRTUAL_ENV/bin" >> "$GITHUB_PATH"
6358
- name: Hatchet setup
6459
run: bundle exec hatchet ci:setup
6560
- name: Export HEROKU_PHP_PLATFORM_REPOSITORIES to …${{env.src_path_suffix}} (since we are not building main or a tag)

support/build/extensions/no-debug-non-zts-20210902/amqp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env bash
22

3+
dep_name=$(basename $BASH_SOURCE)
4+
35
# let's see if librabbitmq is there
46
needed=( librabbitmq4 )
57
missing=$(comm -1 -3 <(dpkg-query -W -f '${package}\n' | sort) <(IFS=$'\n'; echo "${needed[*]}" | sort))
@@ -15,6 +17,4 @@ if [[ "$missing" ]]; then
1517
apt-get install -q -y $missing
1618
fi
1719

18-
dep_name=$(basename $BASH_SOURCE)
19-
2020
source $(dirname $BASH_SOURCE)/../pecl
Lines changed: 1 addition & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,5 @@
11
#!/usr/bin/env bash
22

3-
# fail hard
4-
set -o pipefail
5-
# fail harder
6-
set -eu
7-
8-
source $(dirname $BASH_SOURCE)/../../_util/include/manifest.sh
9-
10-
OUT_PREFIX=$1
11-
12-
export PATH=${OUT_PREFIX}/bin:${PATH}
13-
14-
dep_formula=${0#$WORKSPACE_DIR/}
153
dep_name=$(basename $BASH_SOURCE)
16-
dep_version=${dep_formula##*"/${dep_name}-"}
17-
dep_package=ext-${dep_name}-${dep_version}
18-
dep_dirname=${dep_name}-${dep_version}
19-
dep_archive_name=${dep_dirname}.tgz
20-
dep_url=https://pecl.php.net/get/${dep_archive_name}
21-
series=$(php-config --version | cut -d. -f1,2) # get "7.3", "7.4", "8.0" etc for the php requirement in the manifest
22-
dep_manifest=${dep_package}_php-$series.composer.json
23-
24-
echo "-----> Building ${dep_package} (from PECL)..."
25-
26-
curl -L ${dep_url} | tar xz
27-
28-
pushd ${dep_dirname}
29-
phpize
30-
./configure \
31-
--prefix=${OUT_PREFIX} \
32-
${CONFIGURE_EXTRA:-}
33-
make -s -j $(($(nproc)+1))
34-
35-
# php was a build dep, and it's in $OUT_PREFIX; we only want our build results in the final archive, and no build deps
36-
# the easiest way is to nuke $OUT_PREFIX and running "make install", but extensions built for PHP 8.1+ need PHP headers during linking
37-
# so instead we use the extension Makefile's INSTALL_ROOT variable to prefix the install destination path name, and then move that back to $OUT_PREFIX
38-
tmpdest=$(mktemp -d)
39-
40-
# install apcu ext
41-
echo "-----> Installing into clean ${tmpdest}..."
42-
make INSTALL_ROOT=$tmpdest install -s
43-
echo "-----> Moving install result from ${tmpdest}${OUT_PREFIX} to $OUT_PREFIX..."
44-
rm -rf $OUT_PREFIX # remove $OUT_PREFIX first (otherwise we'd move things *into* it)
45-
mv ${tmpdest}${OUT_PREFIX} $OUT_PREFIX # move from /tmp/foobarz/app/.heroku/php to /app/.heroku/php
46-
popd
47-
48-
mkdir -p ${OUT_PREFIX}/etc/php/conf.d
49-
cat > ${OUT_PREFIX}/etc/php/conf.d/apcu.ini-dist <<'EOF'
50-
extension=apcu.so
51-
EOF
52-
53-
# cleanup
54-
strip --strip-unneeded ${OUT_PREFIX}/lib/php/extensions/*/*.so
55-
56-
MANIFEST_REQUIRE="${MANIFEST_REQUIRE:-"{\"heroku-sys/php\":\"${series}.*\"}"}"
57-
MANIFEST_CONFLICT="${MANIFEST_CONFLICT:-"{}"}"
58-
MANIFEST_REPLACE="${MANIFEST_REPLACE:-"{}"}"
59-
MANIFEST_PROVIDE="${MANIFEST_PROVIDE:-"{}"}"
60-
MANIFEST_EXTRA="${MANIFEST_EXTRA:-"{\"config\":\"etc/php/conf.d/apcu.ini-dist\"}"}"
61-
62-
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
634

64-
print_or_export_manifest_cmd "$(generate_manifest_cmd "$dep_manifest")"
5+
source $(dirname $BASH_SOURCE)/../pecl

support/build/extensions/no-debug-non-zts-20210902/memcached

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
dep_name=$(basename $BASH_SOURCE)
44

55
OUT_PREFIX=$1
6-
export PATH=${OUT_PREFIX}/bin:${PATH}
76

87
# can't build without this
98
needed=( libsasl2-2 )

support/build/extensions/no-debug-non-zts-20210902/oauth

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,4 @@
22

33
dep_name=$(basename $BASH_SOURCE)
44

5-
# ext-oauth <=2.0.7 configure checks for this, but does not actually link against libpcre3
6-
# https://github.com/php/pecl-web_services-oauth/commit/2e02631fa424639b10d105ff47e9cf650403cef7
7-
# https://github.com/php/pecl-web_services-oauth/issues/28
8-
touch /usr/include/pcre.h
9-
105
source $(dirname $BASH_SOURCE)/../pecl
Lines changed: 1 addition & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,5 @@
11
#!/usr/bin/env bash
22

3-
# fail hard
4-
set -o pipefail
5-
# fail harder
6-
set -eu
7-
8-
source $(dirname $BASH_SOURCE)/../../_util/include/manifest.sh
9-
10-
OUT_PREFIX=$1
11-
12-
export PATH=${OUT_PREFIX}/bin:${PATH}
13-
14-
dep_formula=${0#$WORKSPACE_DIR/}
153
dep_name=$(basename $BASH_SOURCE)
16-
dep_version=${dep_formula##*"/${dep_name}-"}
17-
dep_package=ext-${dep_name}-${dep_version}
18-
dep_dirname=phalcon-${dep_version}
19-
dep_url=releases/download/v${dep_version}/phalcon-pecl.tgz
20-
dep_url=https://github.com/phalcon/cphalcon/${dep_url}
21-
series=$(php-config --version | cut -d. -f1,2) # get "7.3", "7.4", "8.0" etc for the php requirement in the manifest
22-
dep_manifest=${dep_package}_php-$series.composer.json
23-
24-
echo "-----> Building ${dep_package}..."
25-
26-
curl -L ${dep_url} | tar xz
27-
28-
pushd ${dep_dirname}
29-
phpize
30-
./configure \
31-
--prefix=${OUT_PREFIX} \
32-
${CONFIGURE_EXTRA:-}
33-
make -s -j $(($(nproc)+1))
34-
35-
# php was a build dep, and it's in $OUT_PREFIX; we only want our build results in the final archive, and no build deps
36-
# the easiest way is to nuke $OUT_PREFIX and running "make install", but extensions built for PHP 8.1+ need PHP headers during linking
37-
# so instead we use the extension Makefile's INSTALL_ROOT variable to prefix the install destination path name, and then move that back to $OUT_PREFIX
38-
tmpdest=$(mktemp -d)
39-
echo "-----> Installing into clean ${tmpdest}..."
40-
make INSTALL_ROOT=$tmpdest install -s
41-
echo "-----> Moving install result from ${tmpdest}${OUT_PREFIX} to $OUT_PREFIX..."
42-
rm -rf $OUT_PREFIX # remove $OUT_PREFIX first (otherwise we'd move things *into* it)
43-
mv ${tmpdest}${OUT_PREFIX} $OUT_PREFIX # move from /tmp/foobarz/app/.heroku/php to /app/.heroku/php
44-
strip --strip-unneeded ${OUT_PREFIX}/lib/php/extensions/*/*.so
45-
popd
46-
47-
MANIFEST_REQUIRE="${MANIFEST_REQUIRE:-"{\"heroku-sys/php\":\"${series}.*\"}"}"
48-
MANIFEST_CONFLICT="${MANIFEST_CONFLICT:-"{}"}"
49-
MANIFEST_REPLACE="${MANIFEST_REPLACE:-"{}"}"
50-
MANIFEST_PROVIDE="${MANIFEST_PROVIDE:-"{}"}"
51-
MANIFEST_EXTRA="${MANIFEST_EXTRA:-"{}"}"
52-
53-
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
544

55-
print_or_export_manifest_cmd "$(generate_manifest_cmd "$dep_manifest")"
5+
source $(dirname $BASH_SOURCE)/../pecl

support/build/extensions/no-debug-non-zts-20210902/pq

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ export PATH=${OUT_PREFIX}/bin:${PATH}
99
echo 'extension=raphf.so' > ${OUT_PREFIX}/etc/php/conf.d/raphf.ini
1010

1111
# we need to declare the right version of raphf as required
12-
dep_formula=${0#$WORKSPACE_DIR/}
13-
dep_version=${dep_formula##*"/${dep_name}-"}
1412
series=$(php-config --version | cut -d. -f1,2) # get "7.3", "7.4", "8.0" etc for the php requirement in the manifest
1513
MANIFEST_REQUIRE="${MANIFEST_REQUIRE:-"{\"heroku-sys/php\":\"${series}.*\",\"heroku-sys/ext-raphf\":\">=2.0.0\",\"heroku-sys/ext-json\":\"*\",\"heroku-sys/ext-spl\":\"*\"}"}"
1614

support/build/extensions/no-debug-non-zts-20210902/rdkafka

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ OUT_PREFIX=$1
66
export PATH=${OUT_PREFIX}/bin:${PATH}
77

88
# we need to declare the required version of librdkafka
9-
dep_formula=${0#$WORKSPACE_DIR/}
10-
dep_version=${dep_formula##*"/${dep_name}-"}
119
series=$(php-config --version | cut -d. -f1,2) # get "7.3", "7.4", "8.0" etc for the php requirement in the manifest
1210
MANIFEST_REQUIRE="${MANIFEST_REQUIRE:-"{\"heroku-sys/php\":\"${series}.*\",\"heroku-sys/librdkafka\":\"^1.0.0 | ^2.0.0\",\"heroku-sys/librdkafka-abi\":\"^1\"}"}"
1311

support/build/libraries/libcassandra

Lines changed: 0 additions & 46 deletions
This file was deleted.

support/build/libraries/libcassandra-2.16.0

Lines changed: 0 additions & 4 deletions
This file was deleted.

test/spec/devcenter_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
expected_markdown = File.read("#{devcenter_fixtures_subdir}/changelog/changelog.md")
2424
# the expected markdown contains "%B %Y" strftime directives at the top
2525
expected_markdown = Time.now.utc.strftime(expected_markdown)
26-
expect(expected_markdown).to eq(generated_markdown)
26+
expect(generated_markdown).to eq(expected_markdown)
2727
end
2828
it "produces a near-empty document if there are no additions" do
2929
cmd = "cat #{devcenter_fixtures_subdir}/changelog/sync-nothingnew.log | #{devcenter_tooling_subdir}/changelog.php"
@@ -35,7 +35,7 @@
3535
expected_markdown = File.read("#{devcenter_fixtures_subdir}/changelog/changelog-nothingnew.md")
3636
# the expected markdown contains "%B %Y" strftime directives at the top
3737
expected_markdown = Time.now.utc.strftime(expected_markdown)
38-
expect(expected_markdown).to eq(generated_markdown)
38+
expect(generated_markdown).to eq(expected_markdown)
3939
end
4040
end
4141

@@ -48,7 +48,7 @@
4848
expect(status.exitstatus).to eq(0), "generate.php exited with status #{status.exitstatus}; stderr: #{stderr}, stdout: #{stdout}"
4949

5050
expected_markdown = File.read("#{devcenter_fixtures_subdir}/generator/php-support.md")
51-
expect(expected_markdown).to eq(generated_markdown)
51+
expect(generated_markdown).to eq(expected_markdown)
5252

5353
expect(stderr).to include("NOTICE: whitelisted runtime series not found in input: 7.3")
5454
end

test/spec/platform_spec.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@
156156
end
157157
end
158158

159-
describe "combined with a custom repository installs packages from that repo according to the priority given", :focused => true do
159+
describe "combined with a custom repository installs packages from that repo according to the priority given" do
160160
Dir.glob("composer-*.json", base: priorities_fixtures_subdir) do |testcase|
161161
it "in case #{testcase}" do
162162
Dir.chdir(priorities_fixtures_subdir) do |cwd|
@@ -206,13 +206,13 @@
206206

207207
cmd = "S3_BUCKET=OURS3BUCKET S3_PREFIX=OURS3PREFIX/ #{bp_root}/support/build/_util/mkrepo.sh *.composer.json"
208208
stdout, stderr, status = Open3.capture3("bash -c #{Shellwords.escape(cmd)}")
209-
209+
210210
expect(status.exitstatus).to eq(0), "mkrepo.sh failed, stdout: #{stdout}, stderr: #{stderr}"
211-
211+
212212
expected_json = JSON.parse(File.read("expected_packages.json"))
213213
generated_json = JSON.parse(stdout)
214-
215-
expect(expected_json).to eq(generated_json)
214+
215+
expect(generated_json).to eq(expected_json)
216216
end
217217
end
218218
end

0 commit comments

Comments
 (0)