tdlib / td

Cross-platform library for building Telegram clients
https://core.telegram.org/tdlib
Boost Software License 1.0
7.11k stars 1.44k forks source link

Issues encountered with Java Windows build script #3123

Open Greengrer opened 1 day ago

Greengrer commented 1 day ago

Hi. Please take a look into a bug I found and consider changing instructions for the builder script a little.

  1. Please add to instruction line "Download and install Microsoft Visual Studio. Enable C++ support while installing" before the script.

The issue: during VS2022 installation when you pick Desktop development with C++ there's a box unchecked by default - and that is a component vcpkg needs. You can find it in: Desktop development with C++ in installation details > optional > MSVC v142 - VS 2019 C++ x64/x86 build tools (v14.29).

This box is unchecked by default, and due to the lack of build tools I had been running into error: in triplet x64-windows: Unable to find a valid Visual Studio instance Could not locate a complete Visual Studio instance The following paths were examined for Visual Studio instances: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary/Build\vcvarsall.bat

Solution to this issue, aside from switching to lower VC version, isn't really specified anywhere, while the fix is so easy. Consider adding this to the Microsoft Visual Studio line in the instructions.

  1. I used the script for Java, without debug binary, Windows x64, for powershell.

In the builder script after cloning vcpkg and cd there's a checkout to a commit: git checkout cd5e746ec203c8c3c61647e0886a8df8c1e78e41

But this version of vcpkg for me leads to: A suitable version of 7zip was not found (required v23.1.0) Downloading portable 7zip 23.1.0... Downloading 7zip... https://www.7-zip.org/a/7z2301-extra.7z-><my path> Downloading https://www.7-zip.org/a/7z2301-extra.7z warning: Download failed -- retrying after 1000ms warning: Download failed -- retrying after 2000ms warning: Download failed -- retrying after 4000ms error: Failed to download from mirror set error: https://www.7-zip.org/a/7z2301-extra.7z: WinHttpSendRequest failed with exit code 12007 error: https://www.7-zip.org/a/7z2301-extra.7z: WinHttpSendRequest failed with exit code 12007 error: https://www.7-zip.org/a/7z2301-extra.7z: WinHttpSendRequest failed with exit code 12007 error: https://www.7-zip.org/a/7z2301-extra.7z: WinHttpSendRequest failed with exit code 12007

After removal of this line everything went smoothly: A suitable version of 7zip was not found (required v24.8.0). Downloading https://github.com/ip7z/7zip/releases/download/24.08/7z2408-extra.7z Extracting 7zip... A suitable version of 7zr was not found (required v24.8.0). Downloading https://github.com/ip7z/7zip/releases/download/24.08/7zr.exe Compiler found: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/Hostx64/x64/cl.exe Restored 6 package(s) from C:\Users\1\AppData\Local\vcpkg\archives in 1.4 s. Use --debug to see more details. Installing 1/6 vcpkg-cmake:x64-windows@2024-04-23... Elapsed time to handle vcpkg-cmake:x64-windows: 10.1 ms vcpkg-cmake:x64-windows package ABI: 5695200ff20815ffdc875ce55109e045d1c0a94bd1bb533137df460568982d1d Installing 2/6 vcpkg-cmake-config:x64-windows@2024-05-23... Elapsed time to handle vcpkg-cmake-config:x64-windows: 18 ms vcpkg-cmake-config:x64-windows package ABI: 86623df1da8b80a6a69738bf7cf50a0358928a0d56431a67d88a984b584ed535 Installing 3/6 gperf:x64-windows@3.1#6... Elapsed time to handle gperf:x64-windows: 17.2 ms gperf:x64-windows package ABI: 64d8478900a0a487702d37c789af45076d0fe6c4e3fde0d8e69549a20caee9b1 Installing 4/6 vcpkg-cmake-get-vars:x64-windows@2024-09-22... Elapsed time to handle vcpkg-cmake-get-vars:x64-windows: 18.9 ms vcpkg-cmake-get-vars:x64-windows package ABI: e840d5856f4cabe906ee2f9ea304e309faf68e0c54874e035119ee41b9d0561a Installing 5/6 openssl:x64-windows@3.4.0... Elapsed time to handle openssl:x64-windows: 89.6 ms openssl:x64-windows package ABI: 5943cbfda75fa99474bde4382ac29f2a9e532dcf791c8f6c7d8ebef0aba9d697 Installing 6/6 zlib:x64-windows@1.3.1... Elapsed time to handle zlib:x64-windows: 25.2 ms zlib:x64-windows package ABI: e8a3f24b4b201a0f637ffcb208d1a4c4cfeef60272f7637d3279123e9f60059d Total install time: 189 ms

So if specific version of vcpkg isn't important please consider removing this checkout.

Thanks.

levlam commented 1 day ago
  1. Are the optional components required by the latest vcpkg?
  2. The pinning of specific version of vcpkg is very important, because master version can have some short-living bugs that will prevent successful building.

The received error means that the file https://www.7-zip.org/a/7z2301-extra.7z wasn't available for you, but the file https://github.com/ip7z/7zip/releases/download/24.08/7z2408-extra.7z was. But both links are valid, therefore there are no errors in the build instructions.