-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
uwsgi with php plugin doesn't compile #97352
Description
Describe the bug
when enabling the php plugin in the uwsgi package the compile of the plugin fails.
To Reproduce
Steps to reproduce the behavior:
nix-build -E 'with import <nixpkgs> {}; uwsgi.override { plugins=[ "php" ]; }'
Screenshots
*** uWSGI is ready, launch it with ./uwsgi ***
using profile: buildconf/nixos.ini
detected include path: ['/nix/store/vb1fh8zqdcs7n3hvn8awlrpdfnic6zjg-gcc-9.3.0/lib/gcc/x86_64-unknown-linux-gnu/9.3.0/include', '/nix/store/vb1fh8zqdcs7n3hvn8awlrpdfnic6zjg-gcc-9.3.0/include', '/nix/store/vb1fh8zqdcs7n3hvn8awlrpdfnic6zjg-gcc-9.3.0/lib/gcc/x86_64-unknown-linux-gnu/9.3.0/include-fixed', '/nix/store/vbs3xx1b5i5bzf1sjkz2lkmz7b8cy92y-glibc-2.30-dev/include']
*** uWSGI building and linking plugin plugins/php ***
/bin/sh: php-config: not found
/bin/sh: php-config: not found
/bin/sh: php-config: not found
/bin/sh: php-config: not found
[gcc] /nix/store/yjg3pdnwgynl1sz9rkc5gyjcgjamgfi9-uwsgi-2.0.18/lib/uwsgi/php_plugin.so
In file included from plugins/php/php_plugin.c:1:
plugins/php/common.h:1:10: fatal error: php.h: No such file or directory
1 | #include "php.h"
| ^~~~~~~
compilation terminated.
In file included from plugins/php/session.c:1:
plugins/php/common.h:1:10: fatal error: php.h: No such file or directory
1 | #include "php.h"
| ^~~~~~~
compilation terminated.
*** unable to build php plugin ***
Additional context
The uwsgi build system tries to invoke php-config to get the include paths for the compile, but php-config is not in the path (it's in the php.dev package). This can be fixed by setting the UWSGICONFIG_PHPDIR = "${php-embed.unwrapped.dev}"; environment variable. uwsgi then finds php.h, but fails on #include "ext/session/php_session.h" which is in extensions.session.dev, and under a different path in the store.
https://github.com/unbit/uwsgi/blob/master/plugins/php/common.h
https://github.com/unbit/uwsgi/blob/master/plugins/php/uwsgiplugin.py
I'll try to find a better solution next.
Notify maintainers
@abbradar @schneefux @globin
Metadata
Maintainer information:
- system: `"x86_64-linux"`
- host os: `Linux 5.8.7-arch1-1, Alpine Linux, noversion`
- multi-user?: `yes`
- sandbox: `no`
- version: `nix-env (Nix) 2.3.6`
- channels(root): `"nixpkgs-20.09pre228453.dcb64ea42e6"`
- nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixpkgs`