tdesktop icon indicating copy to clipboard operation
tdesktop copied to clipboard

Building from source on Windows 10

Open timocov opened this issue 2 years ago • 70 comments
trafficstars

Steps to reproduce

  1. Install Visual Studio Community 2022 image
  2. Follow the instructions from https://github.com/telegramdesktop/tdesktop/blob/dev/docs/building-win-x64.md

Expected behaviour

No errors while running tdesktop\Telegram\build\prepare\win.bat

Actual behaviour

Cannot build libvpx package.

Log
D:\projects\telegram-build>tdesktop\Telegram\build\prepare\win.bat
[1/26](Libraries/patches): SKIPPING
[2/26](ThirdParty/msys64): SKIPPING
[3/26](ThirdParty/python#0.3.10.10): SKIPPING
[4/26](ThirdParty/NuGet): SKIPPING
[5/26](ThirdParty/jom): SKIPPING
[6/26](ThirdParty/gyp): SKIPPING
[7/26](Libraries/lzma): SKIPPING
[8/26](Libraries/zlib): SKIPPING
[9/26](Libraries/mozjpeg): SKIPPING
[10/26](Libraries/openssl): SKIPPING
[11/26](Libraries/opus): SKIPPING
[12/26](Libraries/rnnoise): SKIPPING
[13/26](Libraries/dav1d): SKIPPING
[14/26](Libraries/libavif): SKIPPING
[15/26](Libraries/libde265): SKIPPING
[16/26](Libraries/libheif): SKIPPING
[17/26](Libraries/libjxl): SKIPPING
[18/26](Libraries/libvpx): CHANGED, (r)ebuild, rebuild (a)ll, (s)kip, (p)rint, (q)uit?: BUILDING:
---------------------------------COMMANDS-LIST----------------------------------
if exist libvpx rmdir /Q /S libvpx
if exist libvpx exit /b 1
git clone https://github.com/webmproject/libvpx.git
cd libvpx
git checkout v1.11.0
for /r %%i in (..\patches\libvpx\*) do git apply %%i
SET PATH_BACKUP_=%PATH%
SET PATH=%ROOT_DIR%\ThirdParty\msys64\usr\bin;%PATH%
SET CHERE_INVOKING=enabled_from_arguments
SET MSYS2_PATH_TYPE=inherit
if "%X8664%" equ "x64" (
SET "TARGET=x86_64-win64-vs17"
) else (
SET "TARGET=x86-win32-vs17"
)
bash --login ../patches/build_libvpx_win.sh
SET PATH=%PATH_BACKUP_%
--------------------------------------------------------------------------------
Cloning into 'libvpx'...
remote: Enumerating objects: 164493, done.
remote: Counting objects: 100% (74293/74293), done.
remote: Compressing objects: 100% (6770/6770), done.
remote: Total 164493 (delta 69987), reused 67770 (delta 67516), pack-reused 90200
Receiving objects: 100% (164493/164493), 69.43 MiB | 8.62 MiB/s, done.
Resolving deltas: 100% (133143/133143), done.
Note: switching to 'v1.11.0'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 626ff3595 Update AUTHORS and version info in libs.mk
warning: build/make/gen_msvs_sln.sh has type 100644, expected 100755
warning: build/make/gen_msvs_vcxproj.sh has type 100644, expected 100755
warning: configure has type 100644, expected 100755
warning: build/make/gen_msvs_vcxproj.sh has type 100644, expected 100755
warning: build/make/gen_msvs_vcxproj.sh has type 100644, expected 100755
:: Synchronising package databases...
 clangarm64 is up to date
 mingw32 is up to date
 mingw64 is up to date
 ucrt64 is up to date
 clang32 is up to date
 clang64 is up to date
 msys is up to date
warning: make-4.4.1-1 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (1) make-4.4.1-1

Total Installed Size:  1.61 MiB
Net Upgrade Size:      0.00 MiB

:: Proceed with installation? [Y/n]
(1/1) checking keys in keyring                                                                                                                                                                                           [########################################################################################################################################] 100%
(1/1) checking package integrity                                                                                                                                                                                         [########################################################################################################################################] 100%
(1/1) loading package files                                                                                                                                                                                              [########################################################################################################################################] 100%
(1/1) checking for file conflicts                                                                                                                                                                                        [########################################################################################################################################] 100%
(1/1) checking available disk space                                                                                                                                                                                      [########################################################################################################################################] 100%
:: Processing package changes...
(1/1) reinstalling make                                                                                                                                                                                                  [########################################################################################################################################] 100%
:: Running post-transaction hooks...
(1/1) Updating the info directory file...
warning: diffutils-3.8-4 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (1) diffutils-3.8-4

Total Installed Size:  1.46 MiB
Net Upgrade Size:      0.00 MiB

:: Proceed with installation? [Y/n]
(1/1) checking keys in keyring                                                                                                                                                                                           [########################################################################################################################################] 100%
(1/1) checking package integrity                                                                                                                                                                                         [########################################################################################################################################] 100%
(1/1) loading package files                                                                                                                                                                                              [########################################################################################################################################] 100%
(1/1) checking for file conflicts                                                                                                                                                                                        [########################################################################################################################################] 100%
(1/1) checking available disk space                                                                                                                                                                                      [########################################################################################################################################] 100%
:: Processing package changes...
(1/1) reinstalling diffutils                                                                                                                                                                                             [########################################################################################################################################] 100%
:: Running post-transaction hooks...
(1/1) Updating the info directory file...
  disabling examples
  disabling unit_tests
  disabling tools
  disabling docs
  enabling static_msvcrt
  enabling vp8
  enabling vp9
  enabling webm_io
Configuring for target 'x86_64-win64-vs17'
  enabling x86_64
  enabling runtime_cpu_detect
  enabling mmx
  enabling sse
  enabling sse2
  enabling sse3
  enabling ssse3
  enabling sse4_1
  enabling avx
  enabling avx2
  enabling avx512
    disabling avx512: not supported by compiler
  using yasm
  disabling ccache
  enabling postproc
  enabling libyuv
Bypassing toolchain for environment detection.
Creating makefiles for x86_64-win64-vs17 libs
Creating makefiles for x86_64-win64-vs17 solution
    [CREATE] vpx.def
    [CREATE] vpx_config.asm
    [CREATE] vpx_scale_rtcd.h
    [CREATE] vpx_dsp_rtcd.h
    [CREATE] vp8_rtcd.h
    [CREATE] vp9_rtcd.h
    [CREATE] vpx.pc
    [CREATE] vpx.vcxproj
    [CREATE] vp9rc.vcxproj
generating filter 'Source Files' from 151 files
generating filter 'Source Files' from 471 files
generating filter 'Header Files' from 78 files
generating filter 'Build Files' from 3 files
generating filter 'References' from 1 files
Ignored files list (1 items) is:
    vp9/common/vp9_rtcd_defs.pl
generating filter 'Header Files' from 227 files
generating filter 'Build Files' from 20 files
generating filter 'References' from 7 files
Ignored files list (7 items) is:
    CHANGELOG
    vpx_scale/vpx_scale_rtcd.pl
    vpx_dsp/vpx_dsp_rtcd_defs.pl
    vp8/common/rtcd_defs.pl
    vp9/common/vp9_rtcd_defs.pl
    build/make/version.sh
    build/make/rtcd.pl
    [CREATE] vpx.sln
/d/projects/telegram-build/Libraries/win64/libvpx/build/make/gen_msvs_sln.sh \
             --dep=vp9rc:vpx \
            --dep=test_libvpx:gtest \
            --ver=17\
            --out=vpx.sln vp9rc.vcxproj vpx.vcxproj
msbuild.exe vpx.sln -m -t:Build \
        -p:Configuration="Debug" -p:Platform="x64"
msbuild.exe vpx.sln -m -t:Build \
        -p:Configuration="Release" -p:Platform="x64"
MSBuild version 17.5.0+6f08c67f3 for .NET Framework
MSBuild version 17.5.0+6f08c67f3 for .NET Framework
Build started 08.03.2023 23:05:17.
Included response file: C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\MSBuild.rsp

Build started 08.03.2023 23:05:17.
Included response file: C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\MSBuild.rsp

     1>Project "D:\projects\telegram-build\Libraries\win64\libvpx\vpx.sln" on node 1 (Build target(s)).
     1>ValidateSolutionConfiguration:
         Building solution configuration "Debug|x64".
     1>Project "D:\projects\telegram-build\Libraries\win64\libvpx\vpx.sln" on node 1 (Build target(s)).
     1>ValidateSolutionConfiguration:
         Building solution configuration "Release|x64".
     1>Project "D:\projects\telegram-build\Libraries\win64\libvpx\vpx.sln" (1) is building "D:\projects\telegram-build\Libraries\win64\libvpx\vpx.vcxproj" (2) on node 2 (default targets).
     2>PrepareForBuild:
         Creating directory "x64\Debug\vpx\".
         Creating directory "x64\Debug\vpx\vpx.tlog\".
       InitializeBuildStatus:
         Creating "x64\Debug\vpx\vpx.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
     2>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001: Invalid command line switch for "cmd.exe". System.ArgumentException: Item has already been added. Key in dictionary: 'target'  Key being added: 'TARGET' [D:\projects\telegram-build\Libraries\win64\libvpx\vpx.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001:    at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add) [D:\projects\telegram-build\Libraries\win64\libvpx\vpx.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001:    at System.Diagnostics.ProcessStartInfo.get_EnvironmentVariables() [D:\projects\telegram-build\Libraries\win64\libvpx\vpx.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001:    at Microsoft.Build.Utilities.ToolTask.GetProcessStartInfo(String pathToTool, String commandLineCommands, String responseFileSwitch) [D:\projects\telegram-build\Libraries\win64\libvpx\vpx.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001:    at Microsoft.Build.Utilities.ToolTask.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) [D:\projects\telegram-build\Libraries\win64\libvpx\vpx.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001:    at Microsoft.Build.CPPTasks.TrackedVCToolTask.TrackerExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) [D:\projects\telegram-build\Libraries\win64\libvpx\vpx.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001:    at Microsoft.Build.CPPTasks.CustomBuild.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) [D:\projects\telegram-build\Libraries\win64\libvpx\vpx.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001:    at Microsoft.Build.Utilities.ToolTask.Execute() [D:\projects\telegram-build\Libraries\win64\libvpx\vpx.vcxproj]
     2>Done Building Project "D:\projects\telegram-build\Libraries\win64\libvpx\vpx.vcxproj" (default targets) -- FAILED.
     1>Project "D:\projects\telegram-build\Libraries\win64\libvpx\vpx.sln" (1) is building "D:\projects\telegram-build\Libraries\win64\libvpx\vp9rc.vcxproj" (3) on node 1 (default targets).
     3>PrepareForBuild:
         Creating directory "x64\Debug\vp9rc\".
         Creating directory "x64\Debug\vp9rc\vp9rc.tlog\".
       InitializeBuildStatus:
         Creating "x64\Debug\vp9rc\vp9rc.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
     1>Project "D:\projects\telegram-build\Libraries\win64\libvpx\vpx.sln" (1) is building "D:\projects\telegram-build\Libraries\win64\libvpx\vpx.vcxproj" (3) on node 2 (default targets).
     3>PrepareForBuild:
         Creating directory "x64\Release\vpx\".
         Creating directory "x64\Release\vpx\vpx.tlog\".
     3>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001: Invalid command line switch for "cmd.exe". System.ArgumentException: Item has already been added. Key in dictionary: 'target'  Key being added: 'TARGET' [D:\projects\telegram-build\Libraries\win64\libvpx\vp9rc.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001:    at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add) [D:\projects\telegram-build\Libraries\win64\libvpx\vp9rc.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001:    at System.Diagnostics.ProcessStartInfo.get_EnvironmentVariables() [D:\projects\telegram-build\Libraries\win64\libvpx\vp9rc.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001:    at Microsoft.Build.Utilities.ToolTask.GetProcessStartInfo(String pathToTool, String commandLineCommands, String responseFileSwitch) [D:\projects\telegram-build\Libraries\win64\libvpx\vp9rc.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001:    at Microsoft.Build.Utilities.ToolTask.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) [D:\projects\telegram-build\Libraries\win64\libvpx\vp9rc.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001:    at Microsoft.Build.CPPTasks.TrackedVCToolTask.TrackerExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) [D:\projects\telegram-build\Libraries\win64\libvpx\vp9rc.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001:    at Microsoft.Build.CPPTasks.CustomBuild.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) [D:\projects\telegram-build\Libraries\win64\libvpx\vp9rc.vcxproj]
       C:\Program F       InitializeBuildStatus:
iles\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001:    at Microsoft.Build.Utilities.ToolTask.Execute() [D:\projects\telegram-build\Libraries\win64\libvpx\vp9rc.vcxproj]
         Creating "x64\Release\vpx\vpx.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
     3>Done Building Project "D:\projects\telegram-build\Libraries\win64\libvpx\vp9rc.vcxproj" (default targets) -- FAILED.
     1>     3>Done Building Project "D:\projects\telegram-build\Libraries\win64\libvpx\vpx.sln" (Build target(s)) -- FAILED.
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001: Invalid command line switch for "cmd.exe". System.ArgumentException: Item has already been added. Key in dictionary: 'target'  Key being added: 'TARGET' [D:\projects\telegram-build\Libraries\win64\libvpx\vpx.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001:    at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add) [D:\projects\telegram-build\Libraries\win64\libvpx\vpx.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001:    at System.Diagnostics.ProcessStartInfo.get_EnvironmentVariables() [D:\projects\telegram-build\Libraries\win64\libvpx\vpx.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001:    at Microsoft.Build.Utilities.ToolTask.GetProcessStartInfo(String pathToTool, String commandLineCommands, String responseFileSwitch) [D:\projects\telegram-build\Libraries\win64\libvpx\vpx.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001:    at Microsoft.Build.Utilities.ToolTask.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) [D:\projects\telegram-build\Libraries\win64\libvpx\vpx.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001:    at Microsoft.Build.CPPTasks.TrackedVCToolTask.TrackerExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) [D:\projects\telegram-build\Libraries\win64\libvpx\vpx.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targ
ets(247,5): error MSB6001:    at Microsoft.Build.CPPTasks.CustomBuild.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) [D:\projects\telegram-build\Libraries\win64\libvpx\vpx.vcxproj]
       C:\Program Files\MicrosoftBuild FAILED.
 Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001:    at Microsoft.Build.Utilities.ToolTask.Execute() [D:\projects\telegram-build\Libraries\win64\libvpx\vpx.vcxproj]
     3>Done Building Project "D:\projects\telegram-build\Libraries\win64\libvpx\vpx.vcxproj" (default targets) -- FAILED.

       "D:\projects\telegram-build\Libraries\win64\libvpx\vpx.sln" (Build target) (1) ->
     1>       "D:\projects\telegram-build\Libraries\win64\libvpx\vpx.vcxproj" (default target) (2) ->
       (CustomBuild target) ->
         C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001: Invalid command line switch for "cmd.exe". System.ArgumentException: Item has already been added. Key in dictionary: 'target'  Key being added: 'TARGET' [D:\projects\telegram-build\Libraries\win64\libvpx\vpx.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001:    at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add) [D:\projects\telegram-build\Libraries\win64\libvpx\vpx.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001:    at System.Diagnostics.ProcessStartInfo.get_EnvironmentVariables() [D:\projects\telegram-build\Libraries\win64\libvpx\vpx.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCProject "D:\projects\telegram-build\Libraries\win64\libvpx\vpx.sln" (1) is building "D:\projects\telegram-build\Libraries\win64\libvpx\vp9rc.vcxproj" (2) on node 1 (default targets).
ommon.targets(247,5): error MSB6001:    at Microsoft.Build.Utilities.ToolTask.GetProcessStartInfo(String pathToTool, String commandLineCommands, String responseFileSwitch) [D:\projects\telegram-build\Libraries\win64\libvpx\vpx.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001:    at Microsoft.Build.Utilities.ToolTask.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) [D:\projects\telegram-build\Libraries\win64\libvpx\vpx.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001:    at Microsoft.Build.CPPTasks.TrackedVCToolTask.TrackerExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) [D:\projects\telegram-build\Libraries\win64\libvpx\vpx.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001:    at Microsoft.Build.CPPTasks.CustomBuild.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) [D:\projects\telegram-build\Libraries\win64\libvpx\vpx.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001:    at Microsoft.Build.Utilities.ToolTask.Execute() [D:\projects\telegram-build\Libraries\win64\libvpx\vpx.vcxproj]


       "D:\projects\telegram-build\Libraries\win64\libvpx\vpx.sln" (Build target) (1) ->
     2>       "D:\projects\telegram-build\Libraries\win64\libvpx\vp9rc.vcxproj" (default target) (3) ->
         C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001: Invalid command line switch for "cmd.exe". System.ArgumentException: Item has already been added. Key in dictionary: 'target'  Key being added: 'TARGET' [D:\projects\telegram-build\Libraries\win64\libvpx\vp9rc.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001:    at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add) [D:\projects\telegram-build\Libraries\win64\libvpx\vp9rc.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001:    at System.Diagnostics.ProcessStartInfo.get_EnvironmentVariables() [D:\projects\telegram-build\Libraries\win64\libvpx\vp9rc.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001:    at Microsoft.Build.Utilities.ToolTask.GetProcessStartInfo(String pathToTool, String commandLineCommands, String responseFileSwitch) [D:\projects\telegram-build\Libraries\win64\libvpx\vp9rc.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001:    at Microsoft.Build.Utilities.ToolTask.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) [D:\projects\telegram-build\Libraries\win64\libvpx\vp9rc.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001:    at Microsoft.Build.CPPTasks.TrackedVCToolTask.TrackerExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) [D:\projects\telegram-build\Libraries\win64\libvpx\vp9rc.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001:    at Microsoft.Build.CPPTasks.CustomBuild.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) [D:\projects\telegram-build\Libraries\win64\libvpx\vp9rc.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001:    at Microsoft.Build.Utilities.ToolTask.Execute() [D:\projects\telegram-build\Libraries\win64\libvpx\vp9rc.vcxproj]
PrepareForBuild:

         Creating directory "x64\Release\vp9rc\".
    0 Warning(s)
    2 Error(s)
         Creating directory "x64\Release\vp9rc\vp9rc.tlog\".

Time Elapsed 00:00:00.76
       InitializeBuildStatus:
         Creating "x64\Release\vp9rc\vp9rc.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
     2>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001: Invalid command line switch for "cmd.exe". System.ArgumentException: Item has already been added. Key in dictionary: 'target'  Key being added: 'TARGET' [D:\projects\telegram-build\Libraries\win64\libvpx\vp9rc.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001:    at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add) [D:\projects\telegram-build\Libraries\win64\libvpx\vp9rc.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001:    at System.Diagnostics.ProcessStartInfo.get_EnvironmentVariables() [D:\projects\telegram-build\Libraries\win64\libvpx\vp9rc.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001:    at Microsoft.Build.Utilities.ToolTask.GetProcessStartInfo(String pathToTool, String commandLineCommands, String responseFileSwitch) [D:\projects\telegram-build\Libraries\win64\libvpx\vp9rc.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001:    at Microsoft.Build.Utilities.ToolTask.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) [D:\projects\telegram-build\Libraries\win64\libvpx\vp9rc.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001:    at Microsoft.Build.CPPTasks.TrackedVCToolTask.TrackerExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) [D:\projects\telegram-build\Libraries\win64\libvpx\vp9rc.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001:    at Microsoft.Build.CPPTasks.CustomBuild.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) [D:\projects\telegram-build\Libraries\win64\libvpx\vp9rc.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001:    at Microsoft.Build.Utilities.ToolTask.Execute() [D:\projects\telegram-build\Libraries\win64\libvpx\vp9rc.vcxproj]
     2>Done Building Project "D:\projects\telegram-build\Libraries\win64\libvpx\vp9rc.vcxproj" (default targets) -- FAILED.
     1>Done Building Project "D:\projects\telegram-build\Libraries\win64\libvpx\vpx.sln" (Build target(s)) -- FAILED.
make[1]: *** [vpx.sln.mk:21: Debug_x64] Error 1

make[1]: *** Waiting for unfinished jobs....
Build FAILED.

       "D:\projects\telegram-build\Libraries\win64\libvpx\vpx.sln" (Build target) (1) ->
       "D:\projects\telegram-build\Libraries\win64\libvpx\vpx.vcxproj" (default target) (3) ->
       (CustomBuild target) ->
         C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001: Invalid command line switch for "cmd.exe". System.ArgumentException: Item has already been added. Key in dictionary: 'target'  Key being added: 'TARGET' [D:\projects\telegram-build\Libraries\win64\libvpx\vpx.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001:    at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add) [D:\projects\telegram-build\Libraries\win64\libvpx\vpx.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001:    at System.Diagnostics.ProcessStartInfo.get_EnvironmentVariables() [D:\projects\telegram-build\Libraries\win64\libvpx\vpx.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001:    at Microsoft.Build.Utilities.ToolTask.GetProcessStartInfo(String pathToTool, String commandLineCommands, String responseFileSwitch) [D:\projects\telegram-build\Libraries\win64\libvpx\vpx.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001:    at Microsoft.Build.Utilities.ToolTask.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) [D:\projects\telegram-build\Libraries\win64\libvpx\vpx.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001:    at Microsoft.Build.CPPTasks.TrackedVCToolTask.TrackerExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) [D:\projects\telegram-build\Libraries\win64\libvpx\vpx.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001:    at Microsoft.Build.CPPTasks.CustomBuild.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) [D:\projects\telegram-build\Libraries\win64\libvpx\vpx.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001:    at Microsoft.Build.Utilities.ToolTask.Execute() [D:\projects\telegram-build\Libraries\win64\libvpx\vpx.vcxproj]


       "D:\projects\telegram-build\Libraries\win64\libvpx\vpx.sln" (Build target) (1) ->
       "D:\projects\telegram-build\Libraries\win64\libvpx\vp9rc.vcxproj" (default target) (2) ->
         C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001: Invalid command line switch for "cmd.exe". System.ArgumentException: Item has already been added. Key in dictionary: 'target'  Key being added: 'TARGET' [D:\projects\telegram-build\Libraries\win64\libvpx\vp9rc.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001:    at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add) [D:\projects\telegram-build\Libraries\win64\libvpx\vp9rc.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001:    at System.Diagnostics.ProcessStartInfo.get_EnvironmentVariables() [D:\projects\telegram-build\Libraries\win64\libvpx\vp9rc.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001:    at Microsoft.Build.Utilities.ToolTask.GetProcessStartInfo(String pathToTool, String commandLineCommands, String responseFileSwitch) [D:\projects\telegram-build\Libraries\win64\libvpx\vp9rc.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001:    at Microsoft.Build.Utilities.ToolTask.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) [D:\projects\telegram-build\Libraries\win64\libvpx\vp9rc.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001:    at Microsoft.Build.CPPTasks.TrackedVCToolTask.TrackerExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) [D:\projects\telegram-build\Libraries\win64\libvpx\vp9rc.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001:    at Microsoft.Build.CPPTasks.CustomBuild.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) [D:\projects\telegram-build\Libraries\win64\libvpx\vp9rc.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB6001:    at Microsoft.Build.Utilities.ToolTask.Execute() [D:\projects\telegram-build\Libraries\win64\libvpx\vp9rc.vcxproj]

    0 Warning(s)
    2 Error(s)

Time Elapsed 00:00:00.80
make[1]: *** [vpx.sln.mk:35: Release_x64] Error 1
make: *** [Makefile:17: .DEFAULT] Error 2
[18/26](Libraries/libvpx): FAILED
FAILED

Operating system

Win10 x64

Version of Telegram Desktop

Building from de9a757e7a41ebb75f30e20f4acfcbe75d972db8

Installation source

Other (unofficial) source

Logs

No response

timocov avatar Mar 08 '23 23:03 timocov

Hey there!

This issue was inactive for a long time and will be automatically closed in 30 days if there isn't any further activity. We therefore assume that the user has lost interest or resolved the problem on their own.

Don't worry though; if this is an error, let us know with a comment and we'll be happy to reopen the issue.

Thanks!

github-actions[bot] avatar Sep 05 '23 01:09 github-actions[bot]

I'm not the one who's opened this, but it still happens in the latest dev

4aiman avatar Sep 21 '23 20:09 4aiman

Not sure if my comment can help to keep this issue open, but lets give a shot (but I don't this would help to address the issue lol).

timocov avatar Sep 21 '23 22:09 timocov

This happens for me too with the latest version. Windows 11 x64.

C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): error MSB6001: Invalid command line switch for "CL.exe". System.ArgumentException: Item has already been added. Key in d ictionary: 'target' Key being added: 'TARGET' [C:\Git\Telegram\Libraries\win64\libvpx\vpxrc.vcxproj]

Can anyone look into this bug? There seems to be a duplicate key being added twice during execution.

angelo0027 avatar Nov 19 '23 14:11 angelo0027

Yeah, I'm getting this too. Is it a Windows 10 thing (does it not happen on Windows 11)? Can anyone actually get Telegram Desktop to build on Windows 10?

jez9999 avatar Nov 22 '23 12:11 jez9999

The issue is with the build of libvpx:

Build FAILED.

       "C:\Development\Telegram\Libraries\win64\libvpx\vpx.sln" (Build target) (1) ->
       "C:\Development\Telegram\Libraries\win64\libvpx\vpxrc.vcxproj" (default target) (2) ->
       (ClCompile target) ->
         C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): error MSB6001: Invalid command line switch for "CL.exe". System.ArgumentExcepti
       on: Item has already been added. Key in dictionary: 'target'  Key being added: 'TARGET' [C:\Development\Telegram\Libraries\win64\libvpx\vpxrc.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): error MSB6001:    at System.Collections.Hashtable.Insert(Object key, Object nvalu
       e, Boolean add) [C:\Development\Telegram\Libraries\win64\libvpx\vpxrc.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): error MSB6001:    at System.Diagnostics.ProcessStartInfo.get_EnvironmentVariables
       () [C:\Development\Telegram\Libraries\win64\libvpx\vpxrc.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): error MSB6001:    at Microsoft.Build.Utilities.ToolTask.GetProcessStartInfo(Strin
       g pathToTool, String commandLineCommands, String responseFileSwitch) [C:\Development\Telegram\Libraries\win64\libvpx\vpxrc.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): error MSB6001:    at Microsoft.Build.Utilities.ToolTask.ExecuteTool(String pathTo
       Tool, String responseFileCommands, String commandLineCommands) [C:\Development\Telegram\Libraries\win64\libvpx\vpxrc.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): error MSB6001:    at Microsoft.Build.CPPTasks.TrackedVCToolTask.TrackerExecuteToo
       l(String pathToTool, String responseFileCommands, String commandLineCommands) [C:\Development\Telegram\Libraries\win64\libvpx\vpxrc.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): error MSB6001:    at Microsoft.Build.CPPTasks.TrackedVCToolTask.ExecuteTool(Strin
       g pathToTool, String responseFileCommands, String commandLineCommands) [C:\Development\Telegram\Libraries\win64\libvpx\vpxrc.vcxproj]
       C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(755,5): error MSB6001:    at Microsoft.Build.Utilities.ToolTask.Execute() [C:\Development
       \Telegram\Libraries\win64\libvpx\vpxrc.vcxproj]

jez9999 avatar Nov 22 '23 12:11 jez9999

Same for me on Windows 11

lorthirk avatar Dec 02 '23 17:12 lorthirk

+1 on this on Windows 11. On a lark I even removed the VS2022 version of CMake and had the build rely on the one installed as part of the official instructions, same result. Now time to go spin up a Win10 VM and see if there is a difference.

Also, I suspect the build instructions are out of date, as I had issues earlier on without WSL being installed.

BrendanGrant avatar Dec 04 '23 17:12 BrendanGrant

I found the topic https://developercommunity.visualstudio.com/t/Build-Error:-MSB6001-in-Maven-Build/10527486?sort=newest.

I found the follow script: image So, build it by vs, then make install.

image

image

spobit avatar Dec 05 '23 12:12 spobit

@spobit I'm getting the 'Item has already been added' error before the following completes:

configure.bat x64 -D TDESKTOP_API_ID=YOUR_API_ID -D TDESKTOP_API_HASH=YOUR_API_HASH

Because it's not even getting through the configure stage, I have no .sln to open/build with VS.

jez9999 avatar Dec 05 '23 15:12 jez9999

@jez9999 Me to.

the error is libvpx. after the error happened, build vpx.sln by vs, and then make --prefix=../local install. after you do those, vpx is ready, run tdesktop\Telegram\build\prepare\win.bat, skip [18/28] libvpx.

please see vpx script (my first picture) how to do.

spobit avatar Dec 05 '23 16:12 spobit

@jez9999 Me to.

the error is libvpx. after the error happened, build vpx.sln by vs, and then make --prefix=../local install. after you do those, vpx is ready, run tdesktop\Telegram\build\prepare\win.bat, skip [18/28] libvpx.

please see vpx script (my first picture) how to do.

In which directory do you run make --prefix=../local install? Also, your script picture is of some python script, and then a Unix shell script. What does that have to do with building in Windows? The official build instructions say to use command prompt and cmake, not make, so I don't know what you're doing.

jez9999 avatar Dec 05 '23 17:12 jez9999

@jez9999

  • cmd to do:

    SET ROOT_DIR=%<your-build-root>%
    SET PATH_BACKUP_=%PATH%
    SET PATH=%ROOT_DIR%\\ThirdParty\\msys64\\usr\\bin;%PATH%
    SET CHERE_INVOKING=enabled_from_arguments
    SET MSYS2_PATH_TYPE=inherit
    SET "TARGET=x86_64-win64-vs17"
    bash --login ../patches/build_libvpx_win.sh
    SET PATH=%PATH_BACKUP_%
    
  • vs2022 to build vpx.shl

  • bash to do:

    bash pos: %<your-build-root>%/ThirdParty\msys64\usr\bin\bash.exe

    make install
    

spobit avatar Dec 07 '23 00:12 spobit

I don't have bash though, I'm in the x64 Native Tools command prompt for VS 2022 on Windows.

jez9999 avatar Dec 07 '23 01:12 jez9999

@jez9999 , were you able to resolve this solution?

ProLord007 avatar Dec 07 '23 05:12 ProLord007

@spobit , I would be really thankful if you could provide video of solving this VPX issue.

ProLord007 avatar Dec 07 '23 06:12 ProLord007

spobit, did you just run bash? I have a message '$ make bash: make: command not found'

EugenySychev avatar Dec 08 '23 07:12 EugenySychev

@EugenySychev

image

spobit avatar Dec 11 '23 01:12 spobit

@jez9999 @EugenySychev this is so easy, bat and shell, you should try to get it.

spobit avatar Dec 11 '23 02:12 spobit

Yeah it probably is easy, but the point is it seems like a totally unsupported setup. Where did you get instructions that you needed to use that make.exe during the build process, or did you cobble an environment together through trial and error? You shouldn't have to do that to build the client! What happens when something breaks and people ask "why are you using make on Windows?"

jez9999 avatar Dec 11 '23 11:12 jez9999

I concur. If merely following these was enough, this issue wouldn't be raised.

But I do understand why those hasn't been updated on their own or by patching some of the scripts. What confuses people is the fact those instructions exist in the first place, and nowhere do they state that building is an unsupported feature

4aiman avatar Dec 11 '23 12:12 4aiman

"building is an unsupported feature" 🤣

jez9999 avatar Dec 11 '23 13:12 jez9999

@timocov Do you still repro this issue? If yes, could you follow Details on sharing binary logs and share the logs? so, we can conduct further research.

JaynieBai avatar Dec 12 '23 09:12 JaynieBai

@EugenySychev Call this inside bash before make: export PATH="/usr/bin:$PATH"

MrDvorak avatar Dec 17 '23 12:12 MrDvorak

@timocov Do you still repro this issue? If yes, could you follow Details on sharing binary logs and share the logs? so, we can conduct further research.

@JaynieBai sorry I gave up a long time ago and haven't tried since :(

timocov avatar Dec 26 '23 10:12 timocov

  1. I open d:\TBuild\BuildPath\Libraries\win64\libvpx\vpx.sln
  2. when I build this vpx project, here is the error: image

atrdev-rgb avatar Dec 28 '23 08:12 atrdev-rgb

I found the topic https://developercommunity.visualstudio.com/t/Build-Error:-MSB6001-in-Maven-Build/10527486?sort=newest.

I found the follow script: image So, build it by vs, then make install.

image

image

can you please step by step? Nothing can be done

atrdev-rgb avatar Dec 28 '23 09:12 atrdev-rgb

  1. I open d:\TBuild\BuildPath\Libraries\win64\libvpx\vpx.sln

    1. when I build this vpx project, here is the error: image

I have built vpxmt.lib, what is the next step?

SpCoGov avatar Jan 02 '24 18:01 SpCoGov

I found the topic https://developercommunity.visualstudio.com/t/Build-Error:-MSB6001-in-Maven-Build/10527486?sort=newest. I found the follow script: image So, build it by vs, then make install. image image

can you please step by step? Nothing can be done

I have built it successfully. If you have any questions, please ask me.

SpCoGov avatar Jan 02 '24 18:01 SpCoGov

steps:

  1. After win.bat stops with the error "Item has already been added", just build Libraries\win64\libvpx\vpx.sln with vc
  2. go back to Command Prompt, run
cd Libraries\win64\libvpx
<BuildPath>\ThirdParty\msys64\usr\bin\make.exe install
cd ..\..\..
  1. run win.bat again, skip libvpx step

Mike-Mercer avatar Jan 02 '24 21:01 Mike-Mercer