Skip to content

Commit 2d56907

Browse files
committed
Fix PIE pre-packaged source implementation
Correct the PIE implementation based on testing: - Use 'download-url-method' instead of 'source-method' - Tarball naming: {extension-name}-v{version}.tgz (with 'v' prefix) - Files must be at root level (no parent directories) - Create tarball from within ext/ directory using 'tar * ' Verified working with PIE 1.2.1 - extension builds and installs successfully.
1 parent 26d3720 commit 2d56907

File tree

2 files changed

+22
-18
lines changed

2 files changed

+22
-18
lines changed

dev-bin/release.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -177,14 +177,15 @@ $notes"
177177
# Create pre-packaged source tarball for PIE
178178
# PIE needs this because it doesn't handle git submodules automatically
179179
echo "Creating pre-packaged source tarball for PIE..."
180-
pie_tarball="php_maxminddb-${version}-src.tgz"
180+
pie_tarball="maxminddb-${tag}.tgz"
181181

182-
# Create tarball from the ext directory in the submodule
183-
tar -czf "$pie_tarball" \
184-
--transform "s|^MaxMind-DB-Reader-php/ext|php_maxminddb-${version}|" \
185-
MaxMind-DB-Reader-php/ext/
182+
# Create tarball with files at root level (PIE requirement)
183+
# Note: naming must be {extension-name}-v{version}.tgz
184+
pushd MaxMind-DB-Reader-php/ext > /dev/null
185+
tar -czf "../../$pie_tarball" *
186+
popd > /dev/null
186187

187-
if [ $? -ne 0 ]; then
188+
if [ ! -f "$pie_tarball" ]; then
188189
echo "ERROR: Failed to create source tarball"
189190
popd > /dev/null
190191
exit 1

plan.md

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ Set up a new extension repository (`MaxMind-DB-Reader-php-ext`) that uses this r
77

88
PIE downloads source code as ZIP archives from Composer/GitHub, which don't include git submodule contents. To work around this limitation, we use PIE's built-in support for **pre-packaged source archives**:
99

10-
- Set `"source-method": "pre-packaged-source"` in the `php-ext` section of composer.json
11-
- The release script creates a tarball: `php_maxminddb-{version}-src.tgz`
12-
- This tarball includes the full ext/ directory from the submodule
10+
- Set `"download-url-method": "pre-packaged-source"` in the `php-ext` section of composer.json
11+
- The release script creates a tarball: `maxminddb-v{version}.tgz`
12+
- Naming must be: `{extension-name}-v{version}.tgz` (with the `v` prefix)
13+
- Files must be at root level (no parent directories)
1314
- It's uploaded as a GitHub release asset
1415
- PIE automatically detects and uses this pre-packaged source instead of the ZIP archive
1516

@@ -51,8 +52,7 @@ Initial files needed:
5152
"priority": 50,
5253
"support-zts": true,
5354
"support-nts": true,
54-
"source-method": "pre-packaged-source",
55-
"build-path": "MaxMind-DB-Reader-php/ext",
55+
"download-url-method": "pre-packaged-source",
5656
"configure-options": [
5757
{
5858
"name": "with-maxminddb",
@@ -237,14 +237,15 @@ $notes"
237237
# Create pre-packaged source tarball for PIE
238238
# PIE needs this because it doesn't handle git submodules automatically
239239
echo "Creating pre-packaged source tarball for PIE..."
240-
pie_tarball="php_maxminddb-${version}-src.tgz"
240+
pie_tarball="maxminddb-${tag}.tgz"
241241

242-
# Create tarball from the ext directory in the submodule
243-
tar -czf "$pie_tarball" \
244-
--transform "s|^MaxMind-DB-Reader-php/ext|php_maxminddb-${version}|" \
245-
MaxMind-DB-Reader-php/ext/
242+
# Create tarball with files at root level (PIE requirement)
243+
# Note: naming must be {extension-name}-v{version}.tgz
244+
pushd MaxMind-DB-Reader-php/ext > /dev/null
245+
tar -czf "../../$pie_tarball" *
246+
popd > /dev/null
246247

247-
if [ $? -ne 0 ]; then
248+
if [ ! -f "$pie_tarball" ]; then
248249
echo "ERROR: Failed to create source tarball"
249250
popd > /dev/null
250251
exit 1
@@ -306,7 +307,9 @@ echo "3. Announce release"
306307
- Ensures on main branch
307308
- Verifies tag checkout succeeds
308309
- Only commits if there are changes
309-
- Creates pre-packaged source tarball with naming convention: `php_maxminddb-{version}-src.tgz`
310+
- Creates pre-packaged source tarball with naming convention: `maxminddb-v{version}.tgz`
311+
- Files at root level (no parent directories)
312+
- Uses `{extension-name}-v{version}.tgz` pattern required by PIE
310313
- Uploads tarball as GitHub release asset for PIE
311314
- Cleans up tarball after upload
312315
- Handles push/release failures gracefully

0 commit comments

Comments
 (0)