vcpkg integration

Discuss anything ZDoom-related that doesn't fall into one of the other categories.
dpJudas
 
 
Posts: 3134
Joined: Sat May 28, 2016 1:01 pm

Re: vcpkg integration

Post by dpJudas »

GZDoom master branch doesn't work for me right now. It gives me this error:

Code: Select all

1> CMake generation started for configuration: 'x64-debug'.
1> Environment settings:
1>     CommandPromptType=Native
1>     DevEnvDir=C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\
1>     ExtensionSdkDir=C:\Program Files (x86)\Microsoft SDKs\Windows Kits\10\ExtensionSDKs
1>     EXTERNAL_INCLUDE=C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.37.32822\include;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.37.32822\ATLMFC\include;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include;C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\shared;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\winrt;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\cppwinrt;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um
1>     Framework40Version=v4.0
1>     FrameworkDir=C:\Windows\Microsoft.NET\Framework64\
1>     FrameworkDir64=C:\Windows\Microsoft.NET\Framework64\
1>     FrameworkVersion=v4.0.30319
1>     FrameworkVersion64=v4.0.30319
1>     FSHARPINSTALLDIR=C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\FSharp\Tools
1>     INCLUDE=C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.37.32822\include;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.37.32822\ATLMFC\include;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include;C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\shared;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\winrt;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\cppwinrt;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um
1>     LIB=C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.37.32822\ATLMFC\lib\x64;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.37.32822\lib\x64;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.22621.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\\lib\10.0.22621.0\\um\x64
1>     LIBPATH=C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.37.32822\ATLMFC\lib\x64;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.37.32822\lib\x64;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.37.32822\lib\x86\store\references;C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.22621.0;C:\Program Files (x86)\Windows Kits\10\References\10.0.22621.0;C:\Windows\Microsoft.NET\Framework64\v4.0.30319
1>     NETFXSDKDir=C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\
1>     Path=C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.37.32822\bin\HostX64\x64;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\VC\VCPackages;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer;C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\bin\Roslyn;C:\Program Files\Microsoft Visual Studio\2022\Community\Team Tools\Performance Tools\x64;C:\Program Files\Microsoft Visual Studio\2022\Community\Team Tools\Performance Tools;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools\vs2019\\x64;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools\vs2019\;C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64\;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\FSharp\Tools;C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\\x64;C:\Program Files (x86)\Windows Kits\10\bin\\x64;C:\Program Files\Microsoft Visual Studio\2022\Community\\MSBuild\Current\Bin\amd64;C:\Windows\Microsoft.NET\Framework64\v4.0.30319;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\Tools\;C:\Development\Environment\VulkanSDK\1.3.236.0\Bin;C:\Development\Environment\VulkanSDK\1.3.204.1\Bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\PuTTY\;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Development\v8\depot_tools;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\TortoiseGit\bin;C:\Program Files\Git\cmd;C:\Program Files\dotnet\;C:\Development\musicplayer\Thirdparty\emsdk;C:\Development\musicplayer\Thirdparty\emsdk\node\12.18.1_64bit\bin;C:\Development\musicplayer\Thirdparty\emsdk\python\3.7.4-pywin32_64bit;C:\Development\musicplayer\Thirdparty\emsdk\java\8.152_64bit\bin;C:\Development\musicplayer\Thirdparty\emsdk\upstream\emscripten;C:\Users\mbn\AppData\Local\Microsoft\WindowsApps;C:\Users\mbn\.dotnet\tools;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\VC\Linux\bin\ConnectionManagerExe
1>     PROMPT=$P$G
1>     UCRTVersion=10.0.22621.0
1>     UniversalCRTSdkDir=C:\Program Files (x86)\Windows Kits\10\
1>     VCIDEInstallDir=C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\VC\
1>     VCINSTALLDIR=C:\Program Files\Microsoft Visual Studio\2022\Community\VC\
1>     VCToolsInstallDir=C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.37.32822\
1>     VCToolsRedistDir=C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Redist\MSVC\14.36.32532\
1>     VCToolsVersion=14.37.32822
1>     VS170COMNTOOLS=C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\Tools\
1>     VSCMD_ARG_app_plat=Desktop
1>     VSCMD_ARG_HOST_ARCH=x64
1>     VSCMD_ARG_no_logo=1
1>     VSCMD_ARG_TGT_ARCH=x64
1>     VSCMD_DEBUG=5 
1>     VSCMD_VER=17.7.0
1>     VSINSTALLDIR=C:\Program Files\Microsoft Visual Studio\2022\Community\
1>     WindowsLibPath=C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.22621.0;C:\Program Files (x86)\Windows Kits\10\References\10.0.22621.0
1>     WindowsSdkBinPath=C:\Program Files (x86)\Windows Kits\10\bin\
1>     WindowsSdkDir=C:\Program Files (x86)\Windows Kits\10\
1>     WindowsSDKLibVersion=10.0.22621.0\
1>     WindowsSdkVerBinPath=C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\
1>     WindowsSDKVersion=10.0.22621.0\
1>     WindowsSDK_ExecutablePath_x64=C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64\
1>     WindowsSDK_ExecutablePath_x86=C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\
1>     __DOTNET_ADD_64BIT=1
1>     __DOTNET_PREFERRED_BITNESS=64
1>     __VSCMD_PREINIT_PATH=C:\Development\Environment\VulkanSDK\1.3.236.0\Bin;C:\Development\Environment\VulkanSDK\1.3.204.1\Bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\PuTTY\;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Development\v8\depot_tools;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\TortoiseGit\bin;C:\Program Files\Git\cmd;C:\Program Files\dotnet\;C:\Development\musicplayer\Thirdparty\emsdk;C:\Development\musicplayer\Thirdparty\emsdk\node\12.18.1_64bit\bin;C:\Development\musicplayer\Thirdparty\emsdk\python\3.7.4-pywin32_64bit;C:\Development\musicplayer\Thirdparty\emsdk\java\8.152_64bit\bin;C:\Development\musicplayer\Thirdparty\emsdk\upstream\emscripten;C:\Users\mbn\AppData\Local\Microsoft\WindowsApps;C:\Users\mbn\.dotnet\tools
1>     SystemDrive=C:
1>     ProgramFiles(x86)=C:\Program Files (x86)
1>     ProgramW6432=C:\Program Files
1>     PROCESSOR_IDENTIFIER=AMD64 Family 25 Model 33 Stepping 0, AuthenticAMD
1>     TMP=C:\Users\mbn\AppData\Local\Temp
1>     PROCESSOR_ARCHITECTURE=AMD64
1>     vs2019_install=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
1>     ThreadedWaitDialogDpiContext=-4
1>     PkgDefApplicationConfigFile=C:\Users\mbn\AppData\Local\Microsoft\VisualStudio\17.0_d8d118c9\devenv.exe.config
1>     PROCESSOR_REVISION=2100
1>     ServiceHubLogSessionKey=1E440707
1>     FPS_BROWSER_APP_PROFILE_STRING=Internet Explorer
1>     FPS_BROWSER_USER_PROFILE_STRING=Default
1>     LOGONSERVER=\\NEVADA
1>     TEMP=C:\Users\mbn\AppData\Local\Temp
1>     VCPKG_ROOT=C:\Development\Environment\vcpkg
1>     USERNAME=mbn
1>     SystemRoot=C:\WINDOWS
1>     VSSKUEDITION=Community
1>     DEPOT_TOOLS_WIN_TOOLCHAIN=0
1>     VULKAN_SDK=C:\Development\Environment\VulkanSDK\1.3.236.0
1>     OneDrive=C:\Users\mbn\OneDrive
1>     USERDOMAIN_ROAMINGPROFILE=NEVADA
1>     CommonProgramFiles=C:\Program Files\Common Files
1>     VisualStudioDir=C:\Users\mbn\Documents\Visual Studio 2022
1>     ProgramData=C:\ProgramData
1>     VS_Perf_Session_GCHeapCount=2
1>     VSAPPIDDIR=C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\
1>     HOMEPATH=\Users\mbn
1>     EFC_7536=1
1>     COMPUTERNAME=NEVADA
1>     ALLUSERSPROFILE=C:\ProgramData
1>     CommonProgramW6432=C:\Program Files\Common Files
1>     AMDRMPATH=C:\Program Files\AMD\RyzenMaster\
1>     VisualStudioEdition=Microsoft Visual Studio Community 2022
1>     GCExpConfigUsedInSession=1
1>     SignInWithHomeTenantOnly=False
1>     SESSIONNAME=Console
1>     DriverData=C:\Windows\System32\Drivers\DriverData
1>     HOMEDRIVE=C:
1>     VK_SDK_PATH=C:\Development\Environment\VulkanSDK\1.3.236.0
1>     windir=C:\WINDOWS
1>     NUMBER_OF_PROCESSORS=32
1>     OS=Windows_NT
1>     ProgramFiles=C:\Program Files
1>     ComSpec=C:\WINDOWS\system32\cmd.exe
1>     PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
1>     VSLANG=1033
1>     PSModulePath=C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
1>     APPDATA=C:\Users\mbn\AppData\Roaming
1>     USERDOMAIN=NEVADA
1>     PROCESSOR_LEVEL=25
1>     USERPROFILE=C:\Users\mbn
1>     LOCALAPPDATA=C:\Users\mbn\AppData\Local
1>     VisualStudioVersion=17.0
1>     CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
1>     PUBLIC=C:\Users\Public
1>     VSAPPIDNAME=devenv.exe
1>     MSBuildLoadMicrosoftTargetsReadOnly=true
1> Command line: "C:\WINDOWS\system32\cmd.exe" /c "%SYSTEMROOT%\System32\chcp.com 65001 >NUL && "C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\2022\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe"  -G "Ninja"  -DCMAKE_C_COMPILER:STRING="cl.exe" -DCMAKE_CXX_COMPILER:STRING="cl.exe" -DCMAKE_TOOLCHAIN_FILE:FILEPATH="C:\Development\Environment\vcpkg/scripts/buildsystems/vcpkg.cmake" -DCMAKE_BUILD_TYPE:STRING="Debug" -DCMAKE_INSTALL_PREFIX:PATH="C:/Development/gzdoom/Install/x64-debug"   -DCMAKE_MAKE_PROGRAM="C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\2022\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\Ninja\ninja.exe" "C:\Development\gzdoom" 2>&1"
1> Working directory: C:/Development/gzdoom/Build/x64-debug
1> [CMake] -- Running vcpkg install
1> [CMake] error: while checking out baseline from commit '9d47b24eacbd1cd94f139457ef6cd35e5d92cc84', failed to `git show` versions/baseline.json. This may be fixed by fetching commits with `git fetch`.
1> [CMake] error: git failed with exit code: (128).
1> [CMake] fatal: path 'versions/baseline.json' exists on disk, but not in '9d47b24eacbd1cd94f139457ef6cd35e5d92cc84'
1> [CMake] 
1> [CMake] You can use the current commit as a baseline, which is:
1> [CMake] 	"builtin-baseline": "7f52deab66689f912da6d04de105c457d8ba671e"
1> [CMake] -- Running vcpkg install - failed
1> [CMake] CMake Error at C:/Development/Environment/vcpkg/scripts/buildsystems/vcpkg.cmake:893 (message):
1> [CMake]   vcpkg install failed.  See logs for more information:
1> [CMake]   C:\Development\gzdoom\Build\x64-debug\vcpkg-manifest-install.log
1> [CMake] Call Stack (most recent call first):
1> [CMake]   C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.26/Modules/CMakeDetermineSystem.cmake:148 (include)
1> [CMake]   CMakeLists.txt:36 (project)
1> [CMake] -- Configuring incomplete, errors occurred!
1> 'C:\WINDOWS\system32\cmd.exe' '/c "%SYSTEMROOT%\System32\chcp.com 65001 >NUL && "C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\2022\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe"  -G "Ninja"  -DCMAKE_C_COMPILER:STRING="cl.exe" -DCMAKE_CXX_COMPILER:STRING="cl.exe" -DCMAKE_TOOLCHAIN_FILE:FILEPATH="C:\Development\Environment\vcpkg/scripts/buildsystems/vcpkg.cmake" -DCMAKE_BUILD_TYPE:STRING="Debug" -DCMAKE_INSTALL_PREFIX:PATH="C:/Development/gzdoom/Install/x64-debug"   -DCMAKE_MAKE_PROGRAM="C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\2022\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\Ninja\ninja.exe" "C:\Development\gzdoom" 2>&1"' execution failed with error: ''C:\WINDOWS\system32\cmd.exe' '/c "%SYSTEMROOT%\System32\chcp.com 65001 >NUL && "C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\2022\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe"  -G "Ninja"  -DCMAKE_C_COMPILER:STRING="cl.exe" -DCMAKE_CXX_COMPILER:STRING="cl.exe" -DCMAKE_TOOLCHAIN_FILE:FILEPATH="C:\Development\Environment\vcpkg/scripts/buildsystems/vcpkg.cmake" -DCMAKE_BUILD_TYPE:STRING="Debug" -DCMAKE_INSTALL_PREFIX:PATH="C:/Development/gzdoom/Install/x64-debug"   -DCMAKE_MAKE_PROGRAM="C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\2022\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\Ninja\ninja.exe" "C:\Development\gzdoom" 2>&1"' returned with exit code: 1'.
Btw., if you are going to use vcpkg with cmake, maybe we should include a CMakePresets.json file as well? The one I tested with looks like this:

Code: Select all

{
  "version": 3,
  "configurePresets": [
    {
      "name": "windows-base",
      "description": "Target Windows with the Visual Studio development environment.",
      "hidden": true,
      "binaryDir": "${sourceDir}/Build/${presetName}",
      "installDir": "${sourceDir}/Install/${presetName}",
      "cacheVariables": {
        "CMAKE_C_COMPILER": "cl.exe",
        "CMAKE_CXX_COMPILER": "cl.exe",
        "CMAKE_TOOLCHAIN_FILE": {
          "value": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
          "type": "FILEPATH"
        }
      },
      "condition": {
        "type": "equals",
        "lhs": "${hostSystemName}",
        "rhs": "Windows"
      }
    },
    {
      "name": "x64-debug",
      "displayName": "x64 Debug",
      "description": "Target Windows (64-bit) with the Visual Studio development environment. (Debug)",
      "inherits": "windows-base",
      "architecture": {
        "value": "x64",
        "strategy": "external"
      },
      "cacheVariables": { "CMAKE_BUILD_TYPE": "Debug" }
    },
    {
      "name": "x64-release",
      "displayName": "x64 Release",
      "description": "Target Windows (64-bit) with the Visual Studio development environment. (RelWithDebInfo)",
      "inherits": "x64-debug",
      "cacheVariables": { "CMAKE_BUILD_TYPE": "Release" }
    }
  ]
}
dpJudas
 
 
Posts: 3134
Joined: Sat May 28, 2016 1:01 pm

Re: vcpkg integration

Post by dpJudas »

Just a quick update on that error I pasted. Seems that was vcpkg that needed a 'git pull' before it would work again. So when you will see an error that just looks totally cryptic in the future, try do a pull of vcpkg.

Edit: just tested with a recent visual studio update, and it seems that if you use CMake-GUI instead of the built-in CMake integration in Visual Studio then it doesn't rebuild dependencies. In fact, in this case I'm not even sure how to force it to do a rebuild. :) In any case, that removes the main thing I had against using vcpkg - I can live with the other quirks.
User avatar
Rachael
Posts: 13793
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her

Re: vcpkg integration

Post by Rachael »

I'm thinking of putting a build script directly inside the GZDoom repo for both Windows and bash that basically do the same thing - sets up vcpkg for you and then links your cmake directly to it. I have been talking w/ Nash about it and his difficulties with it and I don't see much harm in using a more in-house solution that automatically sets everything up for people to make the build process less frustrating and less confusing. The recipe to do it is fairly straightforward - you just need to clone it, bootstrap it, and then point your cmake toolchain setting to the script inside the vcpkg folder. Of course - me saying that, and someone else understanding it - are two completely different things.
User avatar
Nash
 
 
Posts: 17465
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: vcpkg integration

Post by Nash »

Using CMake GUI is fine as long as instructions are perfectly clear (previously it wasn't).

Here, this should be as newbie-friendly as it gets.
Professor Hastig
Posts: 255
Joined: Mon Jan 09, 2023 2:02 am
Graphics Processor: nVidia (Modern GZDoom)

Re: vcpkg integration

Post by Professor Hastig »

Nash wrote: Tue Aug 22, 2023 10:29 pm Using CMake GUI is fine as long as instructions are perfectly clear (previously it wasn't).

More like, previously there were no instructions to begin with. Hardly surprising for one day after its instruction, actually...
dpJudas
 
 
Posts: 3134
Joined: Sat May 28, 2016 1:01 pm

Re: vcpkg integration

Post by dpJudas »

CMake has always been one of those things that is pretty terrible, but if you use it in just the right way then it does work and solves a lot of problems. The Visual Studio integration is so poorly done you still have to totally avoid it, which is a real shame. Maybe one day they'll figure out how to do it properly so you don't need to use cmake-gui anymore, which I've always found to be something visual studio should just be able to do out-of-box.
Iluin
Posts: 3
Joined: Tue Aug 22, 2023 6:05 am

Re: vcpkg integration

Post by Iluin »

> I never said anything about MSBuild. I was specifically talking about opening the project as a folder. The official CMake integration built in Visual Studio.

That wasn't clear from the context since it suggested a vcpkg related context. It is a bit strange since the CMake Integration in VS Code definitely shows the vcpkg progress, however, that requires a CMake version greater than 3.18 (since the ECHO_ params to execute_process wasn't added before that).

> So you are suggesting I do something that isn't recommended? So the recommendation is to wait an hour every 2 week? That's the kind of thinking that makes me feel it isn't mature enough yet. Now don't get me wrong, I like the general principle of vcpkg, but so far it isn't something I would choose to use in a production environment just yet.

The suggestion was to learn about influencing factors on the ABI hash vcpkg uses to detect required rebuilds. If your compiler changes it is a sure bet that you probably require a rebuild since even minor version changes can e.g. break ABI with LTO. If you don't want that perfectly safe behavior, however, you are free to opt out of that.

> The way they wanted you to do it IMO made it a nightmare to manage. Luckily it seems they themselves also realized it was terrible and changed tactics with the manifest mode.

Manifest mode was mainly introduced to support versioning which simply isn't feasible in classic mode. "nightmare to manage" -> you can use classic mode like manifest mode if you take control over where vcpkg installs to. There is really no magic behind manifest mode (or you can call the magic "--x-install-root=${CMAKE_BINARY_DIR}/vcpkg_installed" if you want). "The way they wanted you to do it" -> "wanted" is really the wrong word here and it hasn't really changed with manifest mode. The suggestion was always to have separate vcpkg folders per project. You can use a global vcpkg instance, however, you needed to take manual control over the install location if you wanted it to be per project in classic mode. What mainly changed is that due to manifest mode the vcpkg toolchain can automatically call vcpkg to install your dependencies into the right location so that you get a hands off experience with it.

> if you are going to use vcpkg with cmake, maybe we should include a CMakePresets.json file as well

using presets is always a good idea

> try do a pull of vcpkg.

If you pull don't forget to bootstrap again. Pulls are sometimes requires since MSYS packages are not kept for eternity and their downloads vanish over time.
Professor Hastig
Posts: 255
Joined: Mon Jan 09, 2023 2:02 am
Graphics Processor: nVidia (Modern GZDoom)

Re: vcpkg integration

Post by Professor Hastig »

While the vcpkg automation works fine for me there is something odd I noticed with other projects:

Building the dependencies of FluidSynth takes almost half an hour for me. All the rest goes really fast but this library must have some dependencies with absolutely horrible setups. Can somebody explain why this one is such a hassle to get using?
Is this the reason why ZMusic contains the source directly and doesn't use the external library?
dpJudas
 
 
Posts: 3134
Joined: Sat May 28, 2016 1:01 pm

Re: vcpkg integration

Post by dpJudas »

Iluin wrote: Wed Aug 23, 2023 7:16 am The suggestion was to learn about influencing factors on the ABI hash vcpkg uses to detect required rebuilds.
...
The suggestion was always to have separate vcpkg folders per project.
...
If you pull don't forget to bootstrap again. Pulls are sometimes requires since MSYS packages are not kept for eternity and their downloads vanish over time.
I have 32 github repositories. Add on top of that things where I did not create a permanent backup of the project, and the projects I work on professionally for companies. I also have 4 different machines I use for development, depending on the situation. The classic mode simply does not scale properly for people like me. Asking me to have in the ballpark of 40 separate vcpkg folders on my computer is not a serious solution IMHO. It would also burn over 100 gigabytes of disk space and demand me to build up my own scripts for working with projects.

I think you and I simply have different standards to what we consider production grade tooling. To me, if I'm required to learn about ABI hashing just to pull in packages, then the tool has failed me and it is the tool that needs to improve itself. The same thing applies to how it handles its packages breaking. Even if I can learn the quirks of such things myself, I have coworkers that are 9-5 developers. They expect a .msi installer and click next next next and be done with it.

Now, with all that said, vcpkg paired with cmake-gui does seem to be working enough for me now to not be against using it. I do want a better package management for C++ and vcpkg to succeed. But I still insist that, to me, vcpkg is at the very edge of what I'd consider a usable tool. The visual studio integration (the Open Folder feature) is downright useless in its current state. Microsoft should be ashamed of shipping that.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49183
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: vcpkg integration

Post by Graf Zahl »

Professor Hastig wrote: Wed Aug 30, 2023 12:08 am While the vcpkg automation works fine for me there is something odd I noticed with other projects:

Building the dependencies of FluidSynth takes almost half an hour for me. All the rest goes really fast but this library must have some dependencies with absolutely horrible setups. Can somebody explain why this one is such a hassle to get using?
Is this the reason why ZMusic contains the source directly and doesn't use the external library?
Yes, this is essentially why ZMusic includes the source. Actually, there's a second reason, i.e. FluidSynth is not just the synth, the library contains an entire MIDI player and the whole setup of the library is piss-poor, i.e. you cannot initialize just the parts you need but only everything at once.
The main dependency of FluidSynth is glib which is a truly ugly meta-library wrapping countless other stuff in a unified API. As a result it pulls in 10 or so secondary dependencies and this is virtually all hardcore Linux style, i.e. autotools rules, no decent setup scripts etc. Yes that takes time to build.
Any responsible library developer would avoid such a dependency.
As a result of all this I decided top put a stripped down version of FluidSynth directly into ZMusic, replacing glib with a wrapper Randi wrote, so that it can be done without running in that piece of dependency hell.
Professor Hastig
Posts: 255
Joined: Mon Jan 09, 2023 2:02 am
Graphics Processor: nVidia (Modern GZDoom)

Re: vcpkg integration

Post by Professor Hastig »

Interesting.

The project I noticed this on was Woof, which pulls in quite a few dependencies for its music playback.
With Fluidsynth being active the whole thing needed a whopping 35 minutes to configure itself, and it did it twice because I installed an MSVC update yesterday.
After disabling FluidSynth and regenerating the project from scratch the whole thing finished in 6 minutes.

I've read some old stories about FluidSynth being hard to compile but now I finally understand why. :?
Having this as a dependency isn't nice, even with vcpkg installed.

Return to “General”