How to require specific libraries dependencies #294
Replies: 5 comments
-
Indeed, Composer supports the |
Beta Was this translation helpful? Give feedback.
-
Checking library for composer packages (runtime) is very different than checking development header needed by C extension (buildtime) The check is usually done in config.m4, don't know if a duplicated check is really needed Common usage is pkg-config, so a check relying on this may be a simple solution
OR, checking minimal version
So something like
Other usage is checking header availability (.h) or/and shared library (.so) |
Beta Was this translation helpful? Give feedback.
-
The goal of listing the library is to check if the development package is installed on Linux or to download the library on Windows. For Windows, each library is built separately from the extension and stored here: https://downloads.php.net/~windows/pecl/deps/ If pie can check if library development is installed, on Windows it can download the library from the repository defined in the configuration (the URL must be changed without an upgrade needed). The building command of the PHP extension on Windows is the same (exclude some exceptions) as Linux when using phpize. @remicollet, IMHO this syntax is too complex: "require": {
"php": ">=8.0",
"command(pkg-config)": "*",
"pkgconfig(libzip)": ">=1.0.0"
} |
Beta Was this translation helpful? Give feedback.
-
@macintoshplus note that PIE does not support building extensions on Windows at the moment, it will ONLY download prebuilt binaries at the moment (see docs: https://github.com/php/pie/blob/main/docs/extension-maintainers.md#windows-support ) so Windows isn't really a consideration at the moment. What Remi said about pkg-config is correct; and this is currently what |
Beta Was this translation helpful? Give feedback.
-
Hi @asgrim, The goal of adding library dependencies is multiple:
For this reason, the library dependencies constraints must be more system agnostic. The real check must be implemented by Pie or another program (e.g., a Pie plugin). |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I think it would be interesting to specify in the required elements of the
composer.json
file the libraries needed for the extension. Like extension, the prefixlib-
can be used.These dependencies would allow us to check for security vulnerabilities and during compilation, retrieve the source code or binary/SDK automatically.
Exemple:
For
openssl
the tag used areopenssl-3.0.8
oropenssl-3.0.15.pl1
or newer.Beta Was this translation helpful? Give feedback.
All reactions