Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 502516 - dev-lang/php[systemd]: links to systemd libraries without using pkg-config
Summary: dev-lang/php[systemd]: links to systemd libraries without using pkg-config
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 8 votes (vote)
Assignee: PHP Bugs
URL: https://bugs.php.net/bug.php?id=67635
Whiteboard:
Keywords:
: 505986 507320 512440 (view as bug list)
Depends on:
Blocks: 502522
  Show dependency tree
 
Reported: 2014-02-26 09:55 UTC by Michał Górny
Modified: 2015-06-27 13:08 UTC (History)
25 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build log (build.log,43.91 KB, text/x-log)
2014-02-26 09:55 UTC, Michał Górny
Details
php-5.5.11-systemd.patch (php-5.5.11-systemd.patch,2.80 KB, patch)
2014-04-27 07:01 UTC, Account removed
Details | Diff
php-5.5.11 systemd fpm patch (systemd-fpm.patch,896 bytes, patch)
2014-04-27 15:50 UTC, PhobosK
Details | Diff
php-fpm-systemd-pkg-config.patch (php-fpm-systemd-pkg-config.patch,1.14 KB, patch)
2014-06-04 22:54 UTC, Ed Catmur
Details | Diff
php-fpm-systemd-pkg-config.patch (php-fpm-systemd-pkg-config.patch,1.41 KB, patch)
2014-06-05 22:10 UTC, Ed Catmur
Details | Diff
Fix dev-lang/php:5.4 and new systemd support (Fix-dev-lang-php-5.4-systemd-support.patch,2.44 KB, patch)
2015-04-21 12:47 UTC, Radoslav Kirilov
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-02-26 09:55:38 UTC
Created attachment 371328 [details]
build log

Long story short, in systemd-209 the libsystemd-* libraries were removed and replaced with single libsystemd. We install compatibility libsystemd-*.pc pkg-config files, so apps using pkg-config are not affected (yet :)).

Since this package tries to link libsystemd-daemon directly, it fails terribly with >=systemd-209.

The possibilities are:

1. use pkg-config to query libsystemd-daemon -- compatible with all versions but at some point we will be removing compat pkg-config files,

2. use pkg-config to query libsystemd, fallback to querying libsystemd-daemon -- future- and backwards-compatible,

3. just use libsystemd, and dep on >=systemd-210 in the ebuild (we didn't add -209).

Preferably, always use pkg-config :).

If you need any help, please let us know.
Comment 1 Brian Evans (RETIRED) gentoo-dev 2014-04-01 14:25:33 UTC
*** Bug 505986 has been marked as a duplicate of this bug. ***
Comment 2 Andreas Oehler 2014-04-02 06:58:39 UTC
Hi,

i think i do not get what the actual "solution" is - do i understand correctly, that as long as this bug is not fixed in one way ore the other of what Michal suggests, i have to either mask the new systemd version or not use php (with systemd-useflag - whatever that implies). Is that correct?

Thanks
Comment 3 Markus Rathgeb 2014-04-02 07:58:15 UTC
You could use the patch in the duplicate bug #505986.
This should use the possibility number three.
Comment 4 Account removed 2014-04-27 07:01:12 UTC
Created attachment 375824 [details, diff]
php-5.5.11-systemd.patch
Comment 5 PhobosK 2014-04-27 15:50:09 UTC
Created attachment 375862 [details, diff]
php-5.5.11 systemd fpm patch

There is no need to patch the ./configure file , especially in this particular case, 'cause portage does autoreconf and all the changes would be lost.

So the right patch should be done on the ./sapi/fpm/config.m4 file.

I upload the correct patch...
Comment 6 Account removed 2014-04-28 15:15:10 UTC
true, patching configure isn't required, but it also doesn't hurt.
but nice to see that my
"do what you want with it - at least better than nothing patch"
at least resulted in an upload just a few hours later
with a "correct" patch in a 2 months bug... :}
Comment 7 PhobosK 2014-04-28 16:49:28 UTC
:)

@Marcel, I apologize if you felt somewhat insulted by my upload... I didn't want it to sound this way... 

Anyway...
The patch is just a temporary workaround... it is not the correct way to fix php with fpm and systemd (from portage point of view :) )
And yes it doesn't hurt to patch ./configure too... but it just makes the patch a kinda bloated... so if it ends in portage some day, it's best to be as short and targeted as possible :)

BTW I think @Michał Górny stated the possibilities for a fix quite well... 
If I have to choose it would be #2... but yet I am not a developer here nor a proxy maintainer of the package... so let's really hope someone from the PHP team here will fix this before the bug hits the third month ...
Comment 8 Markus Rathgeb 2014-05-02 14:11:55 UTC
IMHO there are some duplicates:
https://bugs.gentoo.org/show_bug.cgi?id=505986
https://bugs.gentoo.org/show_bug.cgi?id=507320

Could someone mark them as duplicate of this?
Comment 9 Mike Gilbert gentoo-dev 2014-05-02 14:47:54 UTC
*** Bug 507320 has been marked as a duplicate of this bug. ***
Comment 10 Juergen Rose 2014-05-07 04:16:11 UTC
Now, php-5.5.12 fails with the same issue. Is there any patch for php-5.5.12?
Comment 11 Markus Rathgeb 2014-05-07 15:15:23 UTC
It is always the same workaround / patch.
Comment 12 Juergen Rose 2014-05-10 11:47:59 UTC
(In reply to Markus Rathgeb from comment #11)
> It is always the same workaround / patch.

I did:
root@lynx2:/usr/local/portage/dev-lang/php(6)# cp files/php-5.5.11_w_systemd-212.patch files/php-5.5.12_w_systemd-212.patch

root@lynx2:/usr/local/portage/dev-lang/php(7)# cp /usr/portage/dev-lang/php/php-5.5.12.ebuild php-5.5.12.ebuild_orig

root@lynx2:/usr/local/portage/dev-lang/php(8)# cp php-5.5.12.ebuild_orig php-5.5.12.ebuild

root@lynx2:/usr/local/portage/dev-lang/php(19)# diff -u3 php-5.5.11.ebuild_orig php-5.5.11.ebuild > php-5.5.11.ebuild.patch

root@lynx2:/usr/local/portage/dev-lang/php(21)# sed "s/5.5.11/5.5.12/g" php-5.5.11.ebuild.patch > php-5.5.12.ebuild.patch

root@lynx2:/usr/local/portage/dev-lang/php(22)# patch < php-5.5.12.ebuild.patch
patching file php-5.5.12.ebuild

root@lynx2:/usr/local/portage/dev-lang/php(24)# sed -i  "s/5.5.11/5.5.12/g" files/php-5.5.12_w_systemd-212.patch
root@lynx2:/usr/local/portage/dev-lang/php(28)# ll
total 456
-rw-r--r-- 1 root root  24476 Apr 24 12:40 ChangeLog
-rw-r--r-- 1 root root 108488 Apr 24 12:40 ChangeLog-2012
drwxr-xr-x 2 root root   4096 May 10 11:12 files/
-rw-r--r-- 1 root root  15577 Apr 24 12:40 Manifest
-rw-r--r-- 1 root root   1547 Apr 24 12:40 metadata.xml
-rw-r--r-- 1 root root  21921 Apr 24 12:40 php-5.3.28.ebuild
-rw-r--r-- 1 root root  22250 Apr 24 12:40 php-5.3.28-r3.ebuild
-rw-r--r-- 1 root root  22305 Apr 24 12:40 php-5.4.26.ebuild
-rw-r--r-- 1 root root  22319 Apr 24 12:40 php-5.4.27.ebuild
-rw-r--r-- 1 root root  22154 Apr 24 12:40 php-5.5.10.ebuild
-rw-r--r-- 1 root root  22216 Apr 24 12:40 php-5.5.11.ebuild
-rw-r--r-- 1 root root  22168 Apr 24 12:40 php-5.5.11.ebuild_orig
-rw-r--r-- 1 root root    301 May 10 11:10 php-5.5.11.ebuild.patch
-rw-r--r-- 1 root root  22216 May 10 11:11 php-5.5.12.ebuild
-rw-r--r-- 1 root root  22168 May 10 11:17 php-5.5.12.ebuild_orig
-rw-r--r-- 1 root root    301 May 10 11:11 php-5.5.12.ebuild.patch
-rw-r--r-- 1 root root    476 May 10 11:04 php-5.5.patch
-rw-r--r-- 1 root root  21868 Apr 24 12:40 php-5.6.0_alpha1.ebuild
-rw-r--r-- 1 root root  22176 Apr 24 12:40 php-5.6.0_alpha1-r1.ebuild
-rw-r--r-- 1 root root  22176 Apr 24 12:40 php-5.6.0_beta1.ebuild

root@lynx2:/usr/local/portage/dev-lang/php(29)# ebuild php-5.5.12.ebuild digest
>>> Creating Manifest for /usr/local/portage/dev-lang/php

root@lynx2:/usr/local/portage/dev-lang/php(30)# emerge -uvND world

The last command was successful.
Comment 13 Juergen Rose 2014-05-31 05:50:57 UTC
And now there is the same issue with php-5.5.13.
Comment 14 Juergen Rose 2014-05-31 08:09:49 UTC
I did:

root@caiman:/usr/local/portage/dev-lang/php(17)# cp files/php-5.5.12_w_systemd-212.patch files/php-5.5.13_w_systemd-212.patch 
root@caiman:/usr/local/portage/dev-lang/php(18)# cp /usr/portage/dev-lang/php/php-5.5.13.ebuild  .
root@caiman:/usr/local/portage/dev-lang/php(19)# cp php-5.5.13.ebuild php-5.5.13.ebuild_orig
root@caimaroot@caiman:/usr/local/portage/dev-lang/php(17)# cp files/php-5.5.12_w_systemd-212.patch files/php-5.5.13_w_systemd-212.patch 
root@caiman:/usr/local/portage/dev-lang/php(20)# diff -u3 php-5.5.12.ebuild_orig php-5.5.12.ebuild > php-5.5.12.ebuild.patch
root@caiman:/usr/local/portage/dev-lang/php(21)# sed "s/5.5.12/5.5.13/g" php-5.5.12.ebuild.patch > php-5.5.13.ebuild.patch
root@caiman:/usr/local/portage/dev-lang/php(22)# patch <  php-5.5.13.ebuild.patch 
patching file php-5.5.13.ebuild
root@caiman:/usr/local/portage/dev-lang/php(23)# sed -i  "s/5.5.12/5.5.13/g" files/php-5.5.13_w_systemd-212.patch
root@caiman:/usr/local/portage/dev-lang/php(24)# ebuild php-5.5.13.ebuild digest
>>> Creating Manifest for /usr/local/portage/dev-lang/php

and 

root@caiman:/usr/local/portage/dev-lang/php(26)# emerge -uvDN --exclude yacas world

which at least emerge successfully emerged php-5.5.13.


Is there an easier way?
Comment 15 Steffen Weber 2014-05-31 08:46:29 UTC
Place the .patch file at /etc/portage/patches/dev-lang/php/gentoo-bug-505986.patch (file name is arbitrary but must end with .patch).

And remember to remove this file when the ebuild gets fixed.
Comment 16 Ole Markus With (RETIRED) gentoo-dev 2014-05-31 09:02:46 UTC
This patch only sort of does suggestion 3, right?

I have no plans on fixing this outside of upstream, but that should not be a problem as they have added all the patches I have sent that way before. I doubt that they will accept a patch without fallback though.
Comment 17 Nolan Eakins 2014-06-03 17:54:37 UTC
Since you're going to wait for upstream, can you fix php's DEPENDS to block on newer systemd versions then? I prefer not making one off exceptions.
Comment 18 Mike Gilbert gentoo-dev 2014-06-03 18:01:13 UTC
(In reply to Nolan Eakins from comment #17)
> Since you're going to wait for upstream, can you fix php's DEPENDS to block
> on newer systemd versions then? I prefer not making one off exceptions.

Please don't. The problem is quite simple to work around with a symlink for the missing lib, and we do that in systemd-212-r5.

For systemd-213+, you'll just me making this workaround harder to apply.
Comment 19 Mike Gilbert gentoo-dev 2014-06-03 18:08:08 UTC
(In reply to Ole Markus With from comment #16)
> This patch only sort of does suggestion 3, right?

Attachment 375862 [details, diff] implements mgorny's third suggestion, yes.
Comment 20 Ed Catmur 2014-06-04 22:54:04 UTC
Created attachment 378288 [details, diff]
php-fpm-systemd-pkg-config.patch

Patch; should be suitable for upstream.  First uses pkg-config to check for systemd.pc and then falls back to current method, so should be fully backward and forward compatible.
Comment 21 Ed Catmur 2014-06-04 22:56:07 UTC
Note that we can't use pkg-config --libs, --includes etc. as systemd.pc doesn't include any of the standard information.
Comment 22 Mike Gilbert gentoo-dev 2014-06-05 00:35:09 UTC
(In reply to Ed Catmur from comment #21)
> Note that we can't use pkg-config --libs, --includes etc. as systemd.pc
> doesn't include any of the standard information.

That's because you are using the wrong package name.

% pkg-config --libs libsystemd
-lsystemd
Comment 23 Mike Gilbert gentoo-dev 2014-06-05 00:39:20 UTC
*** Bug 512440 has been marked as a duplicate of this bug. ***
Comment 24 Mike Gilbert gentoo-dev 2014-06-05 00:41:56 UTC
The optimal solution here is mgorny's suggestion #2. If someone would suggest that to upstream, or implement a proper patch, that would be wonderful.
Comment 25 Ed Catmur 2014-06-05 22:10:39 UTC
Created attachment 378348 [details, diff]
php-fpm-systemd-pkg-config.patch

Well, huh.  This uses libsystemd.pc.  Still falls back to the current method - no way I'm going to write a patch that risks losing backwards compatibility.
Comment 26 Mike Gilbert gentoo-dev 2014-06-05 23:07:15 UTC
(In reply to Ed Catmur from comment #25)

That looks nicer, thanks!
Comment 27 David Carlos Manuelda 2014-06-07 03:58:23 UTC
Is a bug opened upstream about this?
Comment 28 Juergen Rose 2014-06-29 04:50:14 UTC
And now we have the same issue php-5.5.14.
Comment 29 Pacho Ramos gentoo-dev 2014-07-19 17:22:24 UTC
tha patch was accepted by upstream :D

If anyone could help in bug 502530 that would be nice as it's the only remaining broken app :)
Comment 30 Sviatoslav @webknjaz Sydorenko #StandWithUkraine 2014-08-02 08:35:59 UTC
Hi,

the issue still exists for 5.5.15
Comment 31 Pacho Ramos gentoo-dev 2014-09-24 11:14:21 UTC
5.5.16 and newer fixed it on upstream side
Comment 32 Patrick ALLAERT 2015-03-24 10:14:44 UTC
Looks like this issues still exists with dev-lang/php-5.4.38.
Comment 33 Radoslav Kirilov 2015-04-21 12:47:27 UTC
Created attachment 401736 [details, diff]
Fix dev-lang/php:5.4 and new systemd support

Since dev-lang/php:5.4 never got the fix from this bug, the only suitable choice for people who need php-5.4 and systemd is to use the attached patch.

Just place it in the file "/etc/portage/dev-lang/php:5.4/Fix-dev-lang-php-5.4-systemd-support.patch". This way it gets applied for php-5.4 only.
Comment 34 Vasilis Lourdas 2015-06-27 13:08:04 UTC
(In reply to Radoslav Kirilov from comment #33)
> Just place it in the file
> "/etc/portage/dev-lang/php:5.4/Fix-dev-lang-php-5.4-systemd-support.patch".
> This way it gets applied for php-5.4 only.

This actually should be:

/etc/portage/patches/dev-lang/php:5.4/Fix-dev-lang-php-5.4-systemd-support.patch