-
Notifications
You must be signed in to change notification settings - Fork 78
Unable to compile PHP 7.2 using Visual Studio 2017 #13
Comments
Thanks for the report. To use the versions from git, just checkout the corresponding branch or tag. The bison issue is likely caused by the erroneous environment. Please check also the pitfalls section in the readme, especially the presence of Cygwin, MingW, etc. Unfortunately there's no clarity about this bug yet, despite it seems to be also have been showing up in the old SDK, as the ML link witnesses. It is currently not reproducible on clean environments and with Appveyor, fe https://ci.appveyor.com/project/php/php-src/build/master.build.2697/job/lgdjglnto6fch2e1#L493. Thanks. |
@yitam i've an idea how you can debug this. Please fetch procmon and set a filter to see anything related to bison.exe. In particular of the interest are all the file related calls, like paths where dependents are loaded from, or the skeleton path. Some registry keys or env vars might affect these behaviors, too. Thanks. |
Thanks @weltling for your prompt reply and suggestions. I'll try this in a clean vm today. So this sounds like we can't compile both PHP 7.1 and PHP 7.2 in the same environment even though Visual Studio 15 and 17 could coexist? Or have I misunderstood? |
Hi @weltling |
I have the same problem on my machine with only VS2017 installed. I can compile PHP 7.0 with the legacy SDK + VS2017 without a problem, but with this version I have this problem. |
@yitam thanks for the update. Yeah, if bison isn't invoked, that makes the thing even more unclear. I kinda expected a new VM with only dedicated things on it to do the job. @dktapps unfortunately this issue is not reproduceable neither on build hosts, nor on AppVeyor, etc. It has to be something on the given environment that causes it, without having the environment it's just shooting in the sky. Were you up to debug what bison does when you nmake? The issue is long standing, so any additional information is valuable. Thanks. |
@weltling I'm not sure how to debug what bison is up to, but I noticed today that if I download a zip of the SDK from releases, that works perfectly, but a git clone has problems. I believe this is something to do with the line endings. The release archives have LF line endings, but the git repo seems to have CRLF, which appears to be causing problems with the binary tools. Maybe consider adding a .gitattributes? |
Indeed the only difference between my git clone and the release archive I download from github is the line endings. I'm almost 100% sure this is the problem. |
@dktapps to debug what bison does, an option could be checking the system calls it does in procmon. With EOLs, yeah - I was mentioning that else where as well, but unfortunately had no feedback. LF in the only sensible options, especially it for sure can affect bison as it depends on the skeletons. I couldn't think we could control that behavior from within the repository. Would it be not overridden by the global ~/.gitconfig still? I'd happily merge a patch, if you got one that solves it on your side. Thanks. |
The gitconfig |
@weltling |
@yitam check your gitconfig, automatic line ending conversion won't happen if |
Thank you all for the help. I can now build php7.2 in my existing environment (although I must say I've removed VS 2015 since I reported this issue). All the best. |
Looks like we're done here :) |
I followed the steps outlined in Basic usage example, trying to compile PHP. I have Visual Studio 2017 (v15.0) installed, and I've used Developer Prompt to run the starter batch (tested with both phpsdk-vc15-x86 and phpsdk-vc15-x64).
When I ran
configure
I sawPHP Version: 7.3.0-dev
, which is not what I want.Therefore, I downloaded php-7.2.0-beta1-src.zip today and simply tried
phpsdk_deps -u
.The SDK was downloaded into
deps
, but when trying the last stepbuildconf && configure --enable-cli && nmake
, I have the same issue as described in http://news.php.net/php.pecl.dev/11459.An excerpt of the output of nmake:
I also did the followings:
where bison.exe
this returns
c:\php-sdk\msys2\usr\bin\bison.exe
but when I ran bison.exe against
Zend\zend_language_parser.y
I got the following errorc:\php-sdk\phpmaster\vc15\x86\php-src\Zend\zend_language_parser.y: fatal error: invalid @ in skeleton: @
I also have Visual Studio 2015 installed in the same PC, and I never had problems with php 7.0.* or php 7.1.* using Visual Studio native prompts
Forgot to mention that I did try version 2.0.0, 2.0.7 and the latest (2.0.8-dev) in this step:
git checkout php-sdk-2.0.0 or later
The text was updated successfully, but these errors were encountered: