rfc:pickle

PHP RFC: Pickle

Proposes a new extension manager

https://github.com/pierrejoye/pickle

Introduction

This RFC proposes a new installer for PHP extensions.

Proposal

Main goals:

  • Make extension packaging and installing less error prone.
  • Composer compatibility
  • Windows Support

The current PEAR/PECL installer is not used anymore. BC could be kept by converting the package.xml before running the installer. However there is no plan yet to support PEAR/PECL channels support.

A packagist-like system will be implemented in pecl.php.net. We are still discussing this with the composer developers.

Concept

One of the main goal is to reduce meta data duplication, making the whole extension release process less error prone.

To achieve that, the existing information will be used. package.xml won't be used anymore (except if conversion is required). New files are introduced for the release changelogs. The naming format of the release changelog is RELEASE-x.y.z, where x.y.z is the actual version (should work fine with the TZ package, 20140611). Other existing files will be used for the rest of the meta information:

  • Use of CREDITS file to generate authors
  • Use of the PHP header to generate the version information for the package

(API information still need to be done manually, but we could drop this info as it is only used by PEAR so far)

  • Include automatically all files in the release, relying on .gitignore for the ignore list

The CREDITS file will require some changes, email and the actual pecl/php.net handle as well as the homepage. We may implement something to fetch this information at packaging time from php.net, but that will prevent offline packaging.

A minimal json definition:

{
    "name": "apcu",
    "type": "extension",
    "extra": {
        "configure-options": {
            "enable-apc-bc": {
                "default": "yes",
                "prompt": "Enable full APC compatibility"
            },
            "enable-apcu-debug": {
                "default": "no",
                "prompt": "Enable internal debugging in APCu"
            }
        }
    }
}

Any other information will be added automatically on packaging:

{
    "name": "apcu",
    "type": "extension",
    "extra": {
        "configure-options": {
            "enable-apc-bc": {
                "default": "yes",
                "prompt": "Enable full APC compatibility"
            },
            "enable-apcu-debug": {
                "default": "no",
                "prompt": "Enable internal debugging in APCu"
            }
        }
    },
    "version": "4.0.4",
    "state": "beta",
    "authors": [
        {
            "name": "Joe",
            "handle": "Watkins",
            "email": "krakjoe",
            "homepage": "krakjoe@php.net"
        },
        {
            "name": "Anatol",
            "handle": "Belski",
            "email": "ab",
            "homepage": "ab@php.net"
        }
    ]
}

Pacakges support

It will also possible to install an extension using a release archive, a git repository URL or directly from the source tree. Packaging and conversion already works using the source tree.

If someone likes to add git/http/etc support, it would be awesome, as this feature will remain no matter which other changes may happen in other part of the tool.

Backward Incompatible Changes

Everyone relying on the pecl command will have to migrate to pickle.

Proposed PHP Version(s)

Next PHP release once the new system is stable enough (TBD).

Todos (unordered)

  • Add tests for the conversion tool, using existing PECL extension and existing tests in PEAR's pecl installer
  • Document the APIs
  • Finish the port of the src installer
  • Finish the port of the binary installer
  • server side, packagist-like system
  • Improve the m4/w32 ARG_* parser to fetch the configure option default values automatically, detect path options and the likes

References

rfc/pickle.txt · Last modified: 2014/06/14 06:44 by pajoye