PazerOP / tf2_bot_detector

Automatically detects and votekicks cheaters/bots in TF2 casual.
MIT License
404 stars 56 forks source link

Help building from source #421

Closed TheLazySquid closed 9 months ago

TheLazySquid commented 9 months ago

Hey! I've been trying to build TF2BD from source to try to make some changes for personal use. However, I've run into a few problems. Right now, I'm using the batch script that the compiling page says to use. However, this runs into an error:

Error message (vcpkg install failed)
``` Error: Failed to download from mirror set: https://repo.msys2.org/mingw/i686/mingw-w64-i686-pkg-config-0.29.2-2-any.pkg.tar.zst: failed: status code 404 https://www2.futureware.at/~nickoe/msys2-mirror/mingw/i686/mingw-w64-i686-pkg-config-0.29.2-2-any.pkg.tar.zst: failed: status code 404 https://mirror.yandex.ru/mirrors/msys2/mingw/i686/mingw-w64-i686-pkg-config-0.29.2-2-any.pkg.tar.zst: failed: status code 404 https://mirrors.tuna.tsinghua.edu.cn/msys2/mingw/i686/mingw-w64-i686-pkg-config-0.29.2-2-any.pkg.tar.zst: failed: status code 404 https://mirrors.ustc.edu.cn/msys2/mingw/i686/mingw-w64-i686-pkg-config-0.29.2-2-any.pkg.tar.zst: failed: status code 404 https://mirror.bit.edu.cn/msys2/mingw/i686/mingw-w64-i686-pkg-config-0.29.2-2-any.pkg.tar.zst: WinHttpSendRequest() failed: 12007 https://mirror.selfnet.de/msys2/mingw/i686/mingw-w64-i686-pkg-config-0.29.2-2-any.pkg.tar.zst: failed: status code 404 https://mirrors.sjtug.sjtu.edu.cn/msys2/mingw/i686/mingw-w64-i686-pkg-config-0.29.2-2-any.pkg.tar.zst: failed: status code 404 [DEBUG] C:\a\1\s\src\vcpkg\base\downloads.cpp(626) [DEBUG] Exiting after 10636116 us (10629455 us) CMake Error at scripts/cmake/vcpkg_download_distfile.cmake:251 (message): Failed to download file. If you use a proxy, please check your proxy setting. Possible causes are: 1. You are actually using an HTTP proxy, but setting HTTPS_PROXY variable to `https://address:port`. This is not correct, because `https://` prefix claims the proxy is an HTTPS proxy, while your proxy (v2ray, shadowsocksr , etc..) is an HTTP proxy. Try setting `http://address:port` to both HTTP_PROXY and HTTPS_PROXY instead. 2. You are using Fiddler. Currently a bug (https://github.com/microsoft/vcpkg/issues/17752) will set HTTPS_PROXY to `https://fiddler_address:port` which lead to problem 1 above. Workaround is open Windows 10 Settings App, and search for Proxy Configuration page, Change `http=address:port;https=address:port` to `address`, and fill the port number. 3. You proxy's remote server is out of service. In future vcpkg releases, if you are using Windows, you no longer need to set HTTP(S)_PROXY environment variables. Vcpkg will simply apply Windows IE Proxy Settings set by your proxy software. See (https://github.com/microsoft/vcpkg-tool/pull/49) and (https://github.com/microsoft/vcpkg-tool/pull/77) Otherwise, please submit an issue at https://github.com/Microsoft/vcpkg/issues Call Stack (most recent call first): scripts/cmake/vcpkg_acquire_msys.cmake:84 (vcpkg_download_distfile) scripts/cmake/vcpkg_acquire_msys.cmake:174 (z_vcpkg_acquire_msys_download_package) scripts/cmake/vcpkg_find_acquire_program.cmake:449 (vcpkg_acquire_msys) scripts/cmake/vcpkg_fixup_pkgconfig.cmake:116 (vcpkg_find_acquire_program) ports/zlib/portfile.cmake:50 (vcpkg_fixup_pkgconfig) scripts/ports.cmake:141 (include) Error: Building package zlib:x64-windows failed with: BUILD_FAILED Please ensure you're using the latest portfiles with `.\vcpkg update`, then submit an issue at https://github.com/Microsoft/vcpkg/issues including: Package: zlib:x64-windows Vcpkg version: 2021-07-26-9425cf5f512f242c0bcbabac31f08832825aee81 Additionally, attach any relevant sections from the log files above. -- Running vcpkg install - failed CMake Error at submodules/vcpkg/scripts/buildsystems/vcpkg.cmake:840 (message): vcpkg install failed. See logs for more information: [path\to\project]\tf2_bot_detector\build\vcpkg-manifest-install.log Call Stack (most recent call first): D:/Programs/CMake/share/cmake-3.27/Modules/CMakeDetermineSystem.cmake:145 (include) CMakeLists.txt:7 (project) ```

How can I resolve this error? It looks like it has something to do with vcpkg not being able to download something. As far as I know, I'm not using a proxy.

I'm using a Windows 10 computer with gcc v. 13.1.0, and cmake v. 3.27.5

ClusterConsultant commented 9 months ago

You will have to manually update the build setup. The packages the current published process uses are no longer available and you simply need to point at the new ones. How this happens depends a bit on your setup. https://learn.microsoft.com/en-us/vcpkg/users/buildsystems/cmake-integration may be a useful resource. https://learn.microsoft.com/en-us/vcpkg/commands/upgrade might work

TheLazySquid commented 9 months ago

The error I was getting previously appears to be due to an issue with vcpkg, and updating it fixed it. However, I've run into a far more arcane error further down the line:

Crazy long error message
``` 1>Checking Build System Building Custom Rule project/pathtf2_bot_detector/submodules/mh_stuff/CMakeLists.txt cmake_pch.cxx file.cpp case_insensitive_string.cpp string_insertion.cpp source_location.cpp library.cpp Creating library project/path/tf2_bot_detector/build/submodules/mh_stuff/Release/mh-stuff.lib and object project/pathtf2_bot_detector/build/submodules/mh_stuff/Release/mh-stuff.exp stuff.vcxproj -> project\path\tf2_bot_detector\build\tf2_bot_detector\Release\mh-stuff.dll Building Custom Rule project/pathtf2_bot_detector/tf2_bot_detector_common/CMakeLists.txt cmake_pch.cxx PlatformCommon.cpp project\path\tf2_bot_detector\submodules\mh_stuff\cpp\include\mh\text\format.hpp(43,35): error C2039: 'wformat_parse_context': is not a member of 'fmt' [project\path\tf2_bot_detector\build\tf2_bot_detector_common\tf2_bot_detector_common.vcxproj] project\path\tf2_bot_detector\build\vcpkg_installed\x64-windows\include\fmt\ostream.h(22,1): message : see declaration of 'fmt' [project\path\tf2_bot_detector\build\tf2_bot_detector_common\tf2_bot_detector_common.vcxproj] project\path\tf2_bot_detector\submodules\mh_stuff\cpp\include\mh\text\format.hpp(43,2): error C2873: 'wformat_parse_context': symbol cannot be used in a using-declaration [project\path\tf2_bot_detector\build\tf2_bot_detector_common\tf2_bot_detector_common.vcxproj] project\path\tf2_bot_detector\submodules\mh_stuff\cpp\include\mh\text\format.hpp(45,35): error C2039: 'wformat_context': is not a member of 'fmt' [project\path\tf2_bot_detector\build\tf2_bot_detector_common\tf2_bot_detector_common.vcxproj] project\path\tf2_bot_detector\build\vcpkg_installed\x64-windows\include\fmt\ostream.h(22,1): message : see declaration of 'fmt' [project\path\tf2_bot_detector\build\tf2_bot_detector_common\tf2_bot_detector_common.vcxproj] project\path\tf2_bot_detector\submodules\mh_stuff\cpp\include\mh\text\format.hpp(45,2): error C2873: 'wformat_context': symbol cannot be used in a using-declaration [project\path\tf2_bot_detector\build\tf2_bot_detector_common\tf2_bot_detector_common.vcxproj] project\path\tf2_bot_detector\submodules\mh_stuff\cpp\include\mh\text\format.hpp(103,50): error C2039: 'wformat_args': is not a member of 'fmt' [project\path\tf2_bot_detector\build\tf2_bot_detector_common\tf2_bot_detector_common.vcxproj] project\path\tf2_bot_detector\build\vcpkg_installed\x64-windows\include\fmt\ostream.h(22,1): message : see declaration of 'fmt' [project\path\tf2_bot_detector\build\tf2_bot_detector_common\tf2_bot_detector_common.vcxproj] project\path\tf2_bot_detector\submodules\mh_stuff\cpp\include\mh\text\format.hpp(103,50): error C2061: syntax error: identifier 'wformat_args' [project\path\tf2_bot_detector\build\tf2_bot_detector_common\tf2_bot_detector_common.vcxproj] project\path\tf2_bot_detector\submodules\mh_stuff\cpp\include\mh\text\format.hpp(168,85): error C2143: syntax error: missing ',' before '&' [project\path\tf2_bot_detector\build\tf2_bot_detector_common\tf2_bot_detector_common.vcxproj] project\path\tf2_bot_detector\submodules\mh_stuff\cpp\include\mh\text\format.hpp(170,26): error C2065: 'args': undeclared identifier [project\path\tf2_bot_detector\build\tf2_bot_detector_common\tf2_bot_detector_common.vcxproj] project\path\tf2_bot_detector\submodules\mh_stuff\cpp\include\mh\text\format.hpp(175,16): error C2672: 'mh::format': no matching overloaded function found [project\path\tf2_bot_detector\build\tf2_bot_detector_common\tf2_bot_detector_common.vcxproj] project\path\tf2_bot_detector\submodules\mh_stuff\cpp\include\mh\text\format.hpp(114,15): message : could be 'unknown-type mh::format(const TFmtStr &,TArgs &&...)' [project\path\tf2_bot_detector\build\tf2_bot_detector_common\tf2_bot_detector_common.vcxproj] project\path\tf2_bot_detector\submodules\mh_stuff\cpp\include\mh\text\format.hpp(175,16): message : Failed to specialize function template 'unknown-type mh::format(const TFmtStr &,TArgs &&...)' [project\path\tf2_bot_detector\build\tf2_bot_detector_common\tf2_bot_detector_common.vcxproj] project\path\tf2_bot_detector\submodules\mh_stuff\cpp\include\mh\text\format.hpp(175,16): message : With the following template arguments: [project\path\tf2_bot_detector\build\tf2_bot_detector_common\tf2_bot_detector_common.vcxproj] project\path\tf2_bot_detector\submodules\mh_stuff\cpp\include\mh\text\format.hpp(175,16): message : 'TFmtStr=mh::try_vformat::::()::FMT_COMPILE_STRING' [project\path\tf2_bot_detector\build\tf2_bot_detector_common\tf2_bot_detector_common.vcxproj] project\path\tf2_bot_detector\submodules\mh_stuff\cpp\include\mh\text\format.hpp(175,16): message : 'TArgs={std::_Quote_out,size_t>}' [project\path\tf2_bot_detector\build\tf2_bot_detector_common\tf2_bot_detector_common.vcxproj] project\path\tf2_bot_detector\submodules\mh_stuff\cpp\include\mh\text\format.hpp(175,16): message : '=void' [project\path\tf2_bot_detector\build\tf2_bot_detector_common\tf2_bot_detector_common.vcxproj] project\path\tf2_bot_detector\submodules\mh_stuff\cpp\include\mh\text\format.hpp(115,45): message : 'std::string fmt::v10::format<_Ty>(fmt::v10::basic_format_string,size_t>>,_Ty &&)': cannot convert argument 1 from 'const TFmtStr' to 'fmt::v10::basic_format_string,size_t>>' [project\path\tf2_bot_detector\build\tf2_bot_detector_common\tf2_bot_detector_common.vcxproj] with [ _Ty=std::_Quote_out,size_t> ] and [ TFmtStr=mh::try_vformat::::()::FMT_COMPILE_STRING ] project\path\tf2_bot_detector\submodules\mh_stuff\cpp\include\mh\text\format.hpp(115,46): message : No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called [project\path\tf2_bot_detector\build\tf2_bot_detector_common\tf2_bot_detector_common.vcxproj] project\path\tf2_bot_detector\build\vcpkg_installed\x64-windows\include\fmt\format.h(4444,13): message : could be 'std::string fmt::v10::format(const Locale &,fmt::v10::basic_format_string::type...>,T &&...)' [project\path\tf2_bot_detector\build\tf2_bot_detector_common\tf2_bot_detector_common.vcxproj] project\path\tf2_bot_detector\submodules\mh_stuff\cpp\include\mh\text\format.hpp(115,45): message : while trying to match the argument list '(const TFmtStr, _Ty)' [project\path\tf2_bot_detector\build\tf2_bot_detector_common\tf2_bot_detector_common.vcxproj] with [ TFmtStr=mh::try_vformat::::()::FMT_COMPILE_STRING ] and [ _Ty=std::_Quote_out,size_t> ] ```

It looks like this might be an issue with something in Pazer's stuff repo? Attempting to update that to the latest version of it led to a whole slew of other errors, so I figured that that probably isn't the way to go. Do you know how I can fix this?

surepy commented 9 months ago

hiya, someone brought this to my attention.

Stuff I did to make mine compile are:

so the stuff I did in this commit should suffice: https://github.com/surepy/tf2_bot_detector/commit/9f38127e0884e03e51ba7d86cecc2d5db15033bc

If you don't want an email every time you push (from tests failing) I recommend taking a look at my master branch too
I kind of just removed a whole lot of stuff (example: download_and_compile, updater build, code signing, etc) as I didn't want to or can't deal with it, but I think it will help you get started- good luck!
https://github.com/PazerOP/tf2_bot_detector/compare/master...surepy:tf2_bot_detector:master

TheLazySquid commented 9 months ago

Thank you so much! I never could have figured this out on my own.