-
Notifications
You must be signed in to change notification settings - Fork 7.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix phar make paths #2955
Fix phar make paths #2955
Conversation
ext/phar/Makefile.frag
Outdated
@@ -1,5 +1,5 @@ | |||
$(srcdir)/phar_path_check.c: $(srcdir)/phar_path_check.re | |||
@(cd $(top_srcdir); $(RE2C) --no-generation-date -b -o ext/phar/phar_path_check.c ext/phar/phar_path_check.re) | |||
@(cd $(top_srcdir); $(RE2C) --no-generation-date -b -o phar_path_check.c phar_path_check.re) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Were it not more reliable to use the full path here?
Thanks.
@weltling updated to full paths |
The same pattern is used for a bunch of other re2c invocations we use (https://github.com/php/php-src/search?p=1&q=top_srcdir&type=&utf8=%E2%9C%93). The cd $top_srcdir seems like the part that should make this work correctly. Are you building phar out-of-tree? |
I was just checking more, too. It seems a relative path is used explicitly to avoid diffs in the generated file. @csandanov perhps you could post a configure command, so one could check what happens behind the scenes? In the makefile, there are several vars declared after the configure, that were to evaluate. Thanks. |
I use |
@csandanov thanks for the link. It is clear now what happens - here it switches into the extension directory and uses phpize in the configure script. This seems, well, unusual :) The extensions in the core are actually not foreseen for phpize. It might occasionally work this way, though, but only by luck. The issue is, that the extensions in the core are supposed to have It can also have unexpected effects. As phpize is installed on the system, so the php dev packages are, obviously. Now, extensions from the source checkout can look for some includes, which are possibly going to be from the actual source checkout and not from the installed php dev package. If such config.m4 needs to work under both phpize and regular source compilation, it needs to somehow tell whether phpize is used. I'm not sure yet, how to handle this, as it still won't fix the include issues, at least. Clearly, the Docker script tries to do the quick compilation, but the way it is done is questionable. Need to check more or perhaps someone yet could have better idea. Thanks. |
Apologies for the unorthodox method of building extensions! (I can take at least partial blame for all that) See docker-library/php#39 (comment) for some of the discussion that led us down that road, and docker-library/php#41 for the initial PR which added said scripts. We've actually found that the majority of modules compile just fine this way, and there are only a few exceptions (such as odbc, although we found a reasonable workaround for folks who need that: docker-library/php#103 (comment)). Some of the other issues we run into often are that Debian likes to keep header files in odd places, and PHP's configure scripts won't always pick them up properly (the Debian PHP package has patches for exactly these sorts of things). Regarding whether We try to keep the base itself as minimal as possible since unlike a normal package manager, folks can't really pick and choose bits of their base image very easily in order to install extensions afterwards, so when we found that most extensions would compile fine after-the-fact with Hopefully that's some useful history on why we do this, and makes it a little easier to understand, even if it's no easier to find it to be anything less than absolutely insane. 😇 ❤️ |
@weltling I think that https://github.com/php/php-src/blob/69affa985c653d4884afe7272134bd8cc6c6a13a/ext/json/Makefile.frag https://github.com/bukka/php-jsond/blob/b411e73a381e805b2c9c488edbee39b6bd5b3bc1/Makefile.frag So think this PR should be fine to merge unless I missed some phar specific bit... |
@bukka yeah, you use Thanks. |
Ah yeah good catch. I don't use debugging symbols for re2c because I find better to debug the actual generated code which is much more useful IMHO! |
* PHP-7.1: Allow pecl like usage in ext/phar, closes #2955
* PHP-7.2: Allow pecl like usage in ext/phar, closes #2955
* 'master' of git.php.net:/php-src: Allow pecl like usage in ext/phar, closes #2955
Shouldn't we also apply this to 7.0? |
* PHP-7.1: Allow pecl like usage in ext/pdo, refs #2955
* PHP-7.2: Allow pecl like usage in ext/pdo, refs #2955
I guess no one noticed this error because the source
phar_path_check.c
normally never remade but if you get a different timestamp (older) than the targetphar_path_check.re
(as a result of source archive unpacking), you'll get this error:Tries to look for
ext/phar/phar_path_check.re
from/usr/src/php/ext/phar/
.https://bugs.php.net/bug.php?id=75587