Skip to content

Conversation

@mlocati
Copy link
Owner

@mlocati mlocati commented Jun 13, 2025

For example:

  • install-php-extensions oci8
    will install the bundled oci8 extension
  • install-php-extensions php/pecl-database-oci8@7aa106119c671c9132162b9775e154aeae9ef485
    will install the oci8 extension downloading it from github

PS: I only tested zip (from PECL), oci8 (from github), pdo_oci (from github)

PPS: Close #1112

@mlocati mlocati force-pushed the override-bundled-extensions branch 3 times, most recently from 713c2cd to 090a935 Compare June 13, 2025 12:03
@mlocati mlocati force-pushed the override-bundled-extensions branch from 090a935 to 64e39ca Compare June 13, 2025 12:05
@mlocati mlocati merged commit 9159d0c into master Jun 13, 2025
45 checks passed
@mlocati mlocati deleted the override-bundled-extensions branch June 13, 2025 12:12
@mvorisek
Copy link
Contributor

This is great, thank you a lot 🤩

@mvorisek
Copy link
Contributor

Might I know if this really works?

image

In the log, I see multiple paths.

The issue is, the install-php-extensions php/pecl-database-pdo_oci@ffd759828b command should install the ext. incl. php/pecl-database-pdo_oci@e4d0d8e fix, but based on our CI results, it seems some different version is installed, as it seems the fix is not included.

@mlocati
Copy link
Owner Author

mlocati commented Jun 14, 2025

If you turn on output debugging (by setting the IPE_DEBUG environment variable to 1), we can see the command being executed (the lines starting with + ):

  (installing version 1.1.0 from /tmp/src/tmp.BDJOLO/pecl-database-pdo_oci-ffd759828b)
+ installPeclPackage pdo_oci 1.1.0  /tmp/src/tmp.BDJOLO/pecl-database-pdo_oci-ffd759828b
+ test -f /tmp/configure-options
+ getPeclModuleName pdo_oci
+ normalizePHPModuleName_name=pdo_oci
+ printf '%s' pdo_oci
+ installPeclPackage_name=pdo_oci
+ test -z 1.1.0
+ installPeclPackage_fullname=pdo_oci-1.1.0
+ installPeclPackage_path=/tmp/src/tmp.BDJOLO/pecl-database-pdo_oci-ffd759828b
+ test -z /tmp/src/tmp.BDJOLO/pecl-database-pdo_oci-ffd759828b
+ test 0 -eq 0
+ test -n /tmp/src/tmp.BDJOLO/pecl-database-pdo_oci-ffd759828b
+ test -f /tmp/src/tmp.BDJOLO/pecl-database-pdo_oci-ffd759828b/package2.xml
+ installPeclPackage_path=/tmp/src/tmp.BDJOLO/pecl-database-pdo_oci-ffd759828b/package.xml
+ cat /tmp/configure-options
+ getCompilationProcessorCount pdo_oci
+ getProcessorCount
+ test -n 
+ command -v nproc
+ nproc
+ MAKE='make -j8' CPPFLAGS= pecl install /tmp/src/tmp.BDJOLO/pecl-database-pdo_oci-ffd759828b/package.xml
7 source files, building
running: phpize
Configuring for:
PHP Version:             8.4
PHP Api Version:         20240924
Zend Module Api No:      20240924
Zend Extension Api No:   420240924
Please provide the path to the ORACLE_HOME directory. Use 'instantclient,/path/to/instant/client/lib' if you're compiling with Oracle Instant Client [autodetect] : building in /tmp/pear/temp/pear-build-defaultuser4bu95v6u5rcq5jpchnA/pdo_oci-1.1.0
running: /tmp/pear/temp/pdo_oci/configure --with-php-config=/usr/local/bin/php-config --with-pdo-oci=instantclient,/usr/lib/oracle/21.1/client64/lib
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E

As you can see from this line:

+ MAKE='make -j8' CPPFLAGS= pecl install /tmp/src/tmp.BDJOLO/pecl-database-pdo_oci-ffd759828b/package.xml

we are calling pecl install passing if the path of the archive downloaded from github.

I don't know if pecl does something strange.

@mvorisek
Copy link
Contributor

Very weird.

It seems like stable 1.1.0 version is installed but that is not what the logs shows.

So for debugging purposes I created ghcr.io/mvorisek/image-php:8.3-debug-without-pdo_oci docker image that is built without pdo_oci ext.

Then https://github.com/atk4/data/tree/repro_oracle_83_segfault branch can be used tp reproduce the problem.

In the HEAD-1 commit you can see the build passes when the bundled ext is used.

The build passes because of php/php-src#18495 included in the latest stable PHP 8.3.

However, https://github.com/php/pecl-database-pdo_oci includes this fix as well. I did diff against ext/pdo_oci and I can confirm minimal and unrelated diff.

So the https://github.com/atk4/data/blob/repro_oracle_83_segfault/.github/workflows/test-unit.yml#L53 should install fixed ext.

@mlocati do you have an idea what is goiing on?

@mlocati
Copy link
Owner Author

mlocati commented Jun 16, 2025

I did an experiment:

  1. I forked https://github.com/php/pecl-database-oci8 to https://github.com/mlocati-forks/pecl-database-oci8
  2. I incremented the extension version to 3.4.1 with 52d1cd6e2286d40d18462bdc635c2ad11b12d567
  3. I run
    install-php-extensions mlocati-forks/pecl-database-oci8@52d1cd6e2286d40d18462bdc635c2ad11b12d567

Now if I run php --ri oci8 I have

/ # php --ri oci8

oci8

[...]
OCI8 Version => 3.4.1
[...]

So, it seems that install-php-extensions and pecl correctly compile the code from GitHub and not from /usr/src/php/ext/oci8 or pecl.

About extension-specific issues I'm sorry I don't have the time to provide (free) support for every PHP extension that install-php-extensions can install.

@mvorisek
Copy link
Contributor

mvorisek commented Jun 16, 2025

Thank you.

I investigated this more and there is something weird goiing on.

minimal repro: atk4/data@cd2093a...da0520a

On Alpine, these conditions are 0/no. This is php/php-src#8197 / #523 (comment) issue and php/pecl-database-pdo_oci#1 seems to be wrong even if the build (and all ext tests) pass.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

oci8 and pdo_oci upgrade

2 participants