Skip to content

Persist the pear/install-pear-nozlib.phar file - #23634

Open
DanielEScherzer wants to merge 2 commits into
php:PHP-8.2from
DanielEScherzer:commit-install-pear
Open

DanielEScherzer wants to merge 2 commits into
php:PHP-8.2from
DanielEScherzer:commit-install-pear

Conversation

@DanielEScherzer

@DanielEScherzer DanielEScherzer commented Sep 9, 2026 •

Copy link
Copy Markdown
Member

Rather than downloading it as part of the makedist script, add the script to the project's version control. The installation instructions are updated to indicate that the needed phar script is always present, and the only thing needed is to become the superuser and run make install-pear.

The phar is currently marked as binary in the git attributes since it is not entirely text, it is committed from running the build script and can be cleaned up in future commits.

This also fixes the installation process when previously the installation would try to fallback to the fetch.php helper - it seems that the https stream wrapper is not included in PHP by default. Now that the phar is committed to version control, the fetch.php helper script is no longer needed. After this patch, ./configure --with-pear --enable-xml allows installing pear with make without additional manual actions.

Also includes a cherry-pick of #14216 to update the instructions in pear/install-pear.txt.

@Girgias

Girgias commented Sep 9, 2026

Copy link
Copy Markdown
Member

Why? We are trying to get rid of PEAR.

@DanielEScherzer

Copy link
Copy Markdown
Member Author

CC @ashnazg - I see that you are still a bit active in updating https://github.com/pear/pear-core. This would switch from always bundling the latest version of the install-pear-nozlib.phar file (by downloading it at release time) to using a fixed, static version.


Why? We are trying to get rid of PEAR.

No objections to that, but currently we (release managers who run makedist, and anyone building from source) download the latest file directly from https://pear.php.net/install-pear-nozlib.phar without any validation, and this ensures that we still have the phar in case the pear site goes down or has issues

@Girgias

Girgias commented Sep 9, 2026

Copy link
Copy Markdown
Member

Why? We are trying to get rid of PEAR.

No objections to that, but currently we (release managers who run makedist, and anyone building from source) download the latest file directly from https://pear.php.net/install-pear-nozlib.phar without any validation, and this ensures that we still have the phar in case the pear site goes down or has issues

Right, okay didn't know that RMs downloaded the file rather than building it locally.

@mcdruid

mcdruid commented Sep 10, 2026

Copy link
Copy Markdown

+1 to this.

One thing to note is that the current phar includes Archive_Tar 1.6.0 which is a minor release behind (see: pear/Archive_Tar#62 (comment) ) and is likely to cause problems with PHP 8.6 (see: pear/Archive_Tar#61 ).

So we might want to build a new phar that includes a newer Archive_Tar before committing it. I don't know how to do that off the top of my head, but could hopefully figure it out.

@mcdruid

mcdruid commented Sep 10, 2026

Copy link
Copy Markdown

One thing to note is that the current phar includes Archive_Tar 1.6.0 which is a minor release behind (see: pear/Archive_Tar#62 (comment) ) and is likely to cause problems with PHP 8.6 (see: pear/Archive_Tar#61 ).

Actually the problems are deprecations rather than fatals, and it looks like there are more of those in the phar which have not been fixed in the upstream PEAR packages. I suppose that provides a good target for complete removal.

@DanielEScherzer

Copy link
Copy Markdown
Member Author

Even if we removed it for master, it is still part of all new releases from previous release branches, and we shouldn't remove pear support from older branches now

@ashnazg

ashnazg commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Are we saying we want a new phar generated that has all the latest package components bundled in it, and staged on the PEAR site?

@mcdruid

mcdruid commented Sep 15, 2026

Copy link
Copy Markdown

I'm not sure we need a new phar just for the PHP 8.6 deprecations, unless it's going to be included in the PHP 8.6 release bundles?

Although actually looking in more detail, the deprecations in PEAR and Structures_Graph affect PHP 8.5 as well.

How about we work on fixing those problems in the different packages and then provide an updated phar to be committed to php-src?

I don't think that needs to necessarily block this change; committing the existing phar would be an improvement regardless of the deprecations it contains.

There was once install-su Makefile rule, now the install-pear can be
used instead.

(cherry picked from commit 9aee546)
Rather than downloading it as part of the `makedist` script, add the script to
the project's version control. The installation instructions are updated to
indicate that the needed phar script is always present, and the only thing
needed is to become the superuser and run `make install-pear`.

The phar is currently marked as binary in the git attributes since it is not
entirely text, it is committed as-is from running the build script and can be
cleaned up in future commits.

This also fixes the installation process when previously the installation would
try to fallback to the `fetch.php` helper - it seems that the https stream
wrapper is not included in PHP by default. Now that the phar is committed to
version control, the `fetch.php` helper script is no longer needed. After this
patch, `./configure --with-pear --enable-xml` allows installing pear with
`make` without additional manual actions.
@DanielEScherzer

Copy link
Copy Markdown
Member Author

Validated with https://github.com/pear/pear-core/blob/101831aa341164fb954b2b0d8291b6f1ee5008d8/build-release.sh, PHP 8.2 1b8d390, built with pear and xml, ran pear channel-update pear.php.net, then sh ./build-release.sh, that failed

Warning: require_once(PHP/Archive/Creator.php): Failed to open stream: No such file or directory in /var/www/pear-core/make-gopear-phar.php on line 68

Fatal error: Uncaught Error: Failed opening required 'PHP/Archive/Creator.php' (include_path='/usr/local/lib/php') in /var/www/pear-core/make-gopear-phar.php:68
Stack trace:
#0 {main}
  thrown in /var/www/pear-core/make-gopear-phar.php on line 68

looks like this is looking for https://github.com/pear/PHP_Archive/blob/master/Archive/Creator.php. I updated the build script to include PHP_Archive, that failed with

Failed to download pear/PHP_Archive within preferred state "stable", latest release is version 0.14.0, stability "alpha", use "channel://pear.php.net/PHP_Archive-0.14.0" to install

so instead I had it download as PHP_Archive-alpha, but then things were downloaded with to the wrong directory (named PHP_Archive-0.14.0 rather than just PHP). Reverted the changes, and ran pear install PHP_Archive-alpha to install globally(?) and then the build script worked

The version I created locally has a different sha256 hash from the one I downloaded, diff suggests that the changes are minor I think they relate to system differences, but either way I'll use the version I built locally

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants