Code Monkey home page Code Monkey logo

Comments (20)

Jan-E avatar Jan-E commented on July 22, 2024

Recompilation with older build tools needs some tricks. For instance, prepending the %path% with the path of the older cl.exe and link.exe. In the end I replaced everything in the environment of my VS16 prompt with a reference to 14.22. In my case that was for x64:

@set path=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.20.27508\bin\HostX64\x64;%path%
@set PHP_SDK_VC_TOOLSET_VER=14.20.27508
@set IFCPATH=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.20.27508\ifc\x64
@set INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.20.27508\ATLMFC\include;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.20.27508\include;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.7.2\include\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared;C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt
@set LIB=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.20.27508\ATLMFC\lib\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.20.27508\lib\x64;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.7.2\lib\um\x64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64;
@set LIBPATH=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.20.27508\ATLMFC\lib\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.20.27508\lib\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.20.27508\lib\x86\store\references;C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.18362.0;C:\Program Files (x86)\Windows Kits\10\References\10.0.18362.0;C:\Windows\Microsoft.NET\Framework64\v4.0.30319;
@set VCToolsInstallDir=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.20.27508\
@set VCToolsRedistDir=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Redist\MSVC\14.20.27508\
@set VCToolsVersion=14.20.27508
@set UCRTVersion=10.0.17134.0

And for x86:

@set path=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.20.27508\bin\HostX86\x86;%path%
@set PHP_SDK_VC_TOOLSET_VER=14.20.27508
@set IFCPATH=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.20.27508\ifc\x86
@set INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.20.27508\ATLMFC\include;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.20.27508\include;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.7.2\include\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared;C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt
@set LIB=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.20.27508\ATLMFC\lib\x86;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.20.27508\lib\x86;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.7.2\lib\um\x86;C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x86;
@set LIBPATH=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.20.27508\ATLMFC\lib\x86;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.20.27508\lib\x86;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.20.27508\lib\x86\store\references;C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.18362.0;C:\Program Files (x86)\Windows Kits\10\References\10.0.18362.0;C:\Windows\Microsoft.NET\Framework64\v4.0.30319;
@set VCToolsInstallDir=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.20.27508\
@set VCToolsRedistDir=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Redist\MSVC\14.20.27508\
@set VCToolsVersion=14.20.27508
@set UCRTVersion=10.0.17134.0

from libiconv.

Jan-E avatar Jan-E commented on July 22, 2024

I did something comparable with the 14.21 build tools after I had re-installed them:

vs16

from libiconv.

Jan-E avatar Jan-E commented on July 22, 2024

After the whole operation I tested the recompiled libiconv_a.lib with 14.20, 14.21 and 14.22. Everything went smooth.

Note: before I recompiled libiconv_a.lib I also recompiled edit_a.lib with the 14.20 build tools, because of this issue: winlibs/wineditline#5
Maybe that is needed as well.

In general, it seems best to me to compile all dependencies with an 'old' version of the build tools. I will use 14.20 for that, but maybe you should use the version of the latest PHP 7.4 QA release.

from libiconv.

Jan-E avatar Jan-E commented on July 22, 2024

BTW for @weltling : the XmlDIFF extension did compile with VS 16.1, but does not compile anymore with VS 16.2. Example error:

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\include\xtree(1730): error C3848: expression having type 'const std::less' would lose some const-volatile qualifiers in order to call 'bool std::less::operator ()(const xmlNsPtr &,const xmlNsPtr &)' (compiling source file ext\xmldiff\diffmark\lib\compare.cc)

from libiconv.

cmb69 avatar cmb69 commented on July 22, 2024

Ugh, that's ugly. libiconv-1.16-vs16-x64 has been built with 14.21, so it can't be used for 14.20 builds. However, libiconv-1.15-3-vs16-x64 has been built with 14.20, so can't be used for 14.22 PGO builds (and also not for 14.21 PGO builds, which is why we shipped libiconv-1.15-4-vs16-x64). And indeed, any extension built with 14.22 can't be loaded into a 14.21 PHP build.

In general, it seems best to me to compile all dependencies with an 'old' version of the build tools. I will use 14.20 for that, but maybe you should use the version of the latest PHP 7.4 QA release.

The latter is what we're basically doing. 7.4.0beta1 has been built with 14.21 and currently 7.4 snapshots are build with 14.21 as well, but we're planning to upgrade to 14.22 before 7.4.0beta2. At least new dependency builds will then use 14.22 as well, but of course, that means that extension builds relying on windows.php.net dependency packages may have to use 14.22, too.

So anybody who wants to build a PHP extension with dependencies from window.php.net may have to use the exact same VC minor version that is used for the current PHP 7.4 builds (older VC may not build, newer VC will not load). And that may even cause issues with the official PECL builds: if these use the same VC version as the current 7.4, it's not possible to use them with older 7.4 builds, but building the PECL extensions with an older VC version, would require dependencies built with the older VC version, but these dependencies may not be usable for PGO enabled PHP builds. Maybe we should alleviate the load time link version check. @weltling, thoughts?

from libiconv.

Jan-E avatar Jan-E commented on July 22, 2024

However, libiconv-1.15-3-vs16-x64 has been built with 14.20, so can't be used for 14.22 PGO builds (and also not for 14.21 PGO builds, which is why we shipped libiconv-1.15-4-vs16-x64).

Ah, I did not know PGO builds required the exact same VC minor version.

So anybody who wants to build a PHP extension with dependencies from window.php.net may have to use the exact same VC minor version that is used for the current PHP 7.4 builds (older VC may not build, newer VC will not load).

Is it documented somewhere which VC minor version is used for the current PHP 7.4 builds? If the minor version is that important it should be mentioned at https://windows.php.net/qa/

from libiconv.

cmb69 avatar cmb69 commented on July 22, 2024

Ah, I did not know PGO builds required the exact same VC minor version.

Not necessarily, though. While 14.21 PGO builds required to rebuild some of the dependencies, 14.22 worked fine with the 14.21 deps.

Is it documented somewhere which VC minor version is used for the current PHP 7.4 builds? If the minor version is that important it should be mentioned at https://windows.php.net/qa/

ACK. Not sure how to do this. Since the page is auto-generated, the info would have to be available somewhere. And anyway, the info would also be relevant for the snapshot builds and the release builds (when they'll be available).

from libiconv.

Jan-E avatar Jan-E commented on July 22, 2024

ACK. Not sure how to do this.

Maybe the announcements on @Internals and on php.net would be a good place for the releases. If somebody wants to be in sync with the official builds there will only be a delay of max 2 weeks.

Just curious: 7.4.0 beta 2 will probably be tagged tomorrow. Are you already over to the 14.222 tools?

from libiconv.

cmb69 avatar cmb69 commented on July 22, 2024

7.4.0beta2 has been built with 14.22.27905.0.

We're discussing how we can handle this best.

from libiconv.

Jan-E avatar Jan-E commented on July 22, 2024

OK. I stiil used 14.21.27702 for my own builds. Just to be on the safe side.

from libiconv.

cmb69 avatar cmb69 commented on July 22, 2024

Note that I just committed php/php-src@886be26, which relaxes the compatibility check. It should now be possible to, say, load an extension built with 14.22 into a PHP built with 14.21. Only the tens of the minor have to match (14.2x).

from libiconv.

Jan-E avatar Jan-E commented on July 22, 2024

@weltling @cmb69
Any idea why 7.4.0beta4 is compiled with VC15?
See https://windows.php.net/downloads/qa/

from libiconv.

cmb69 avatar cmb69 commented on July 22, 2024

Partially, because of this ticket. I have just committed a respective news article which is supposed to show up on https://windows.php.net/ in about an hour. Thanks.

from libiconv.

Jan-E avatar Jan-E commented on July 22, 2024

OK, if I understand this correctly, this commit has to be changed as well:
microsoft/php-sdk-binary-tools@76ede8f

from libiconv.

cmb69 avatar cmb69 commented on July 22, 2024

Hmm, I don't think so, since this commit is rather a general change (mostly about VC16 renaming to VS16).

from libiconv.

Jan-E avatar Jan-E commented on July 22, 2024

But it has the side effect that the zips, built within a VS16 SDK environment, will have names like php-7.4.0beta4-nts-Win32-vs16-x64.zip

from libiconv.

Jan-E avatar Jan-E commented on July 22, 2024

And in a VC15 SDK environment it will use the 14.16 toolset:

C:\>where cl
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin
\Hostx64\x64\cl.exe

from libiconv.

cmb69 avatar cmb69 commented on July 22, 2024

Both is desired. If you build in an VS 16 environment, the zip should be named accordingly (and yes, at least for now PHP 7.4 VS 16 are fully supported). And in a VC15 environment using a 14.15/14.16 toolset is desired as well (14.15 <= toolset < 14.20 corresponds to VS 2017, aka. VC 15).

from libiconv.

Jan-E avatar Jan-E commented on July 22, 2024

I just noticed the revision of the Wiki:
https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2?do=revisions

2019/08/21 11:37 internals:windows:stepbystepbuild_sdk_2 – PHP 7.4 builds should use VS 2017 now cmb -2 B (current)

So you really changed to building PHP 7.4 with VC15

from libiconv.

cmb69 avatar cmb69 commented on July 22, 2024

So you really changed to building PHP 7.4 with VC15

Yes, see https://windows.php.net/#news-2019-08-21-1.

from libiconv.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.