poco icon indicating copy to clipboard operation
poco copied to clipboard

buildwin.ps1 failed to build x64

Open KevDi opened this issue 3 years ago • 4 comments

Describe the bug Building the Poco Libraries with the buildWin.ps1 script failed if -platform x64 is used.

To Reproduce This is the command that was used: .\BuildWin.ps1' -poco_base . -vs 160 -action build -linkmode shared -config both -platform x64 -samples -tests -omit 'Crypto;NetSSL_OpenSSL;Data/ODBC;Data/MySQL;Data/PostgreSQL;JWT;MongoDB'

Expected behavior Complete build of the Poco Library.

Logs This is the Output from the Command above:

VS160COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\Tools\
**********************************************************************
** Visual Studio 2019 Developer Command Prompt v16.11.15
** Copyright (c) 2021 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'
Build configuration:
--------------------
Poco Base:               .
Version:                          160
Action:                          build
Link Mode:                shared
Configuration: both
Platform:                        x64
Tests:                            True
Samples:                         True
Build Tool: msbuild
Omit:                                Crypto;NetSSL_OpenSSL;Data/ODBC;Data/MySQL;Data/PostgreSQL;JWT;MongoDB
OpenSSL:                        $poco_base\openssl
+------------------------------------------------------------------
| VS project .\CppUnit_x64_vs160.vcxproj not found, skipping.
+------------------------------------------------------------------

The Issue is that in the end of the Powershell Script these lines are executed:

if ($platform -eq 'x64')           { $platformName = '_x64' }
elseif ($platform -eq 'WinCE') { $platformName = '_CE' } 

If these two lines are commented out the build works without any problems. It seems this is a left over from the time when there where different vcproj files for x64 and win32. If you want i can create a PR and remove these two lines.

Please add relevant environment information:

  • Windows 10 & Visual Studio 2019 Professional
  • Poco Version 1.12.1

KevDi avatar Aug 11 '22 10:08 KevDi

Yes, create a PR to devel branch, please. We can also try to add a CI build

aleks-f avatar Aug 11 '22 10:08 aleks-f

I just stumbled upon another problem. I have for example Visual Studio 2022 installed and also the Build Tools for Visual Studio 2019. If i run the script it gave me an error because it is unable to detect the 2019 Build tools. This problem is caused by the Get-VSSetupInstance | Select-VSSetupInstance command. It seems like per default it only looks for complete Visual Studio Installations. (https://github.com/microsoft/vssetup.powershell/issues/58). If i added the -product * option the build succeeded.

Should i also leave it there? I successfully tried it with VS160 (Buildtools) and VS170(Complete VS Installation)

KevDi avatar Aug 12 '22 05:08 KevDi

Do what you feel makes most sense, just document it.

The idea behind that script was to replace the horrible batch build script, but it's been scarcely used and maintained. I think it's still a worthy goal - batch scripts are a horrible tool for any complex functionality.

aleks-f avatar Aug 13 '22 16:08 aleks-f

@aleks-f i mostly used the batch script but in the last weeks i really liked the powershell one especially because you can provide the packages you want to exclude via the -omit button and did not need to edit the textfile. I will add the Pull Request with those two changes then and describe it in the PR itself.

KevDi avatar Aug 13 '22 19:08 KevDi

This issue is stale because it has been open for 365 days with no activity.

github-actions[bot] avatar Aug 19 '23 02:08 github-actions[bot]

This issue was closed because it has been inactive for 60 days since being marked as stale.

github-actions[bot] avatar Oct 18 '23 02:10 github-actions[bot]