Skip to content

Fix ignored configureoptions in pecl install due to incorrect argument order #2502

@qingxuanrk

Description

@qingxuanrk

Hi,

I noticed an issue with how pecl install is called for Redis and Memcached in Dockerfile-alpine.template.

The Problem
Currently, the arguments are passed in the wrong order. This triggers errors during the build process, causing the --configureoptions to be treated as invalid package names. Consequently, these options are ignored, and the extensions are installed without the intended features (like igbinary or zstd support), although the build process itself does not fail.

Relevant Code

pecl install memcached-%%MEMCACHED_VERSION%% \
--configureoptions 'enable-memcached-igbinary="yes"'; \
pecl install redis-%%REDIS_VERSION%% \
--configureoptions 'enable-redis-igbinary="yes" enable-redis-zstd="yes" enable-redis-lz4="yes"'; \

Error Log

=> # invalid package name/package file "enable-redis-igbinary="yes" enable-redis-zstd="yes" enable-redis-lz4="yes""
=> # invalid package name/package file "--configureoptions"
=> # parsePackageName(): only one version/state delimiter "-" is allowed in "enable-redis-igbinary="yes" enable-redis-zstd="yes" enable-redis-lz4="yes""

Root Cause
The pecl command is strict about argument parsing. As seen in pecl help install, the options must be placed before the package name:

pecl install [options] [channel/]<package> ...

Proposed Solution
Moving the --configureoptions flags before the package name resolves the parsing errors and ensures the extensions are built with the correct configuration.

I can submit a PR for this if needed.

#Bug

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions