Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building from source on Windows 10 #26012

Closed
timocov opened this issue Mar 8, 2023 · 77 comments · Fixed by #27510
Closed

Building from source on Windows 10 #26012

timocov opened this issue Mar 8, 2023 · 77 comments · Fixed by #27510
Labels

Comments

@timocov
Copy link

timocov commented Mar 8, 2023

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 de9a757

Installation source

Other (unofficial) source

Logs

No response

@timocov timocov added the bug label Mar 8, 2023
@github-actions
Copy link

github-actions bot commented Sep 5, 2023

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 github-actions bot added the stale label Sep 5, 2023
@4aiman
Copy link

4aiman commented Sep 21, 2023

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

@timocov
Copy link
Author

timocov commented Sep 21, 2023

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).

@github-actions github-actions bot removed the stale label Sep 22, 2023
@angelo0027
Copy link

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.

@jez9999
Copy link

jez9999 commented Nov 22, 2023

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
Copy link

jez9999 commented Nov 22, 2023

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]

@lorthirk
Copy link

lorthirk commented Dec 2, 2023

Same for me on Windows 11

@BrendanGrant
Copy link

+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.

@spobit
Copy link

spobit commented Dec 5, 2023

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

@jez9999
Copy link

jez9999 commented Dec 5, 2023

@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.

@spobit
Copy link

spobit commented Dec 5, 2023

@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.

@jez9999
Copy link

jez9999 commented Dec 5, 2023

@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.

@spobit
Copy link

spobit commented Dec 7, 2023

@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
    

@jez9999
Copy link

jez9999 commented Dec 7, 2023

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

@ProLord007
Copy link

@jez9999 , were you able to resolve this solution?

@ProLord007
Copy link

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

@EugenySychev
Copy link

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

@spobit
Copy link

spobit commented Dec 11, 2023

@EugenySychev

image

@spobit
Copy link

spobit commented Dec 11, 2023

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

@jez9999
Copy link

jez9999 commented Dec 11, 2023

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?"

@4aiman
Copy link

4aiman commented Dec 11, 2023

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

@jez9999
Copy link

jez9999 commented Dec 11, 2023

"building is an unsupported feature" 🤣

@JaynieBai
Copy link

@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.

@MrDvorak
Copy link

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

@timocov
Copy link
Author

timocov commented Dec 26, 2023

@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 :(

@wxhML
Copy link

wxhML commented Jan 11, 2024

I have use 17.8.4

ok, if you are using 17.8.4, please follow my previous reply to build

yean I have followed your method ,but the same issue

If copying to the /tg_owt/ directory does not work, please copy to the /tg_owt/src/ directory.

$USED_PREFIX/include/opus can you tell me this Absolute path? I'm going to compile it separately

image

why do this?
I have succeed as your method
image

@SpCoGov
Copy link

SpCoGov commented Jan 11, 2024

I have use 17.8.4

ok, if you are using 17.8.4, please follow my previous reply to build

yean I have followed your method ,but the same issue

If copying to the /tg_owt/ directory does not work, please copy to the /tg_owt/src/ directory.

$USED_PREFIX/include/opus can you tell me this Absolute path? I'm going to compile it separately

image

why do this?
I have succeed as your method
image

Go to BuildPath\tdesktop\Telegram and run (using your api_id and api_hash)

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

@wxhML
Copy link

wxhML commented Jan 11, 2024

I have use 17.8.4

ok, if you are using 17.8.4, please follow my previous reply to build

yean I have followed your method ,but the same issue

If copying to the /tg_owt/ directory does not work, please copy to the /tg_owt/src/ directory.

$USED_PREFIX/include/opus can you tell me this Absolute path? I'm going to compile it separately

image

why do this?
I have succeed as your method
image

Go to BuildPath\tdesktop\Telegram and run (using your api_id and api_hash)

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

9c52b1e1e1b2b6a176e0fc2858c5db6
thank you
I already know the cause of the problem ,because I compiled libvpx separately

@wxhML
Copy link

wxhML commented Jan 11, 2024

I have use 17.8.4

ok, if you are using 17.8.4, please follow my previous reply to build

yean I have followed your method ,but the same issue

If copying to the /tg_owt/ directory does not work, please copy to the /tg_owt/src/ directory.

$USED_PREFIX/include/opus can you tell me this Absolute path? I'm going to compile it separately

image

why do this?
I have succeed as your method
image

Go to BuildPath\tdesktop\Telegram and run (using your api_id and api_hash)

configure.bat x64 -D TDESKTOP_API_ID=YOUR_API_ID -D TDESKTOP_API_HASH=YOUR_API_HASH
Ten thousand thanks

@SpCoGov
Copy link

SpCoGov commented Jan 11, 2024

I have use 17.8.4

ok, if you are using 17.8.4, please follow my previous reply to build

yean I have followed your method ,but the same issue

If copying to the /tg_owt/ directory does not work, please copy to the /tg_owt/src/ directory.

$USED_PREFIX/include/opus can you tell me this Absolute path? I'm going to compile it separately

image

why do this?

I have succeed as your method

image

Go to BuildPath\tdesktop\Telegram and run (using your api_id and api_hash)

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

Ten thousand thanks

congratulations

@xmdnx
Copy link
Contributor

xmdnx commented Feb 3, 2024

hope it's finally fixed, now waiting for release

@xmdnx
Copy link
Contributor

xmdnx commented Feb 5, 2024

fixed vcredist avaliable at https://aka.ms/vs/17/release/vc_redist.x64.exe
version: 14.38.33135.0

@Aokromes
Copy link
Collaborator

Aokromes commented Feb 5, 2024

so i can close?

@xmdnx
Copy link
Contributor

xmdnx commented Feb 5, 2024

now i'm trying to build, i will notice if build succeeds.

@xmdnx
Copy link
Contributor

xmdnx commented Feb 5, 2024

update: vcredist_x64 does not installs in MSVC folder in Visual Studio folder

idk how to make it install right way

@jez9999
Copy link

jez9999 commented Feb 9, 2024

Yikes, what a mess that VS bug report is. So installing a new version of VS will not fix this, because it's in some VC redistributable libraries that don't get updated by Visual Studio apparently.

@john-preston
Copy link
Member

Unfortunately the issue isn't solved at all in MSVC, because the static libs that are used in TDesktop were not updated in any redist / msvc version yet, see my new (accepted, unresolved) bug report:

https://developercommunity.visualstudio.com/t/Illegal-Instruction-POPCNT-emitted-in-MS/10576397

@john-preston
Copy link
Member

(btw last ~ten messages were discussing not the fix for this issue, but the fix for the MSVC problem that stops me from updating MSVC toolchain used by me, after what this issue will start reproducing for me as well)

@xmdnx
Copy link
Contributor

xmdnx commented Feb 16, 2024

@john-preston i guess you can try installing clean VS 2022 with latest 17.8 (or 17.9 preview) toolchain on maybe second device or VM? to check if you can reproduce that

Copy link

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

@Aokromes
Copy link
Collaborator

https://developercommunity.visualstudio.com/t/Illegal-Instruction-POPCNT-emitted-in-MS/10576397#T-N10587252 a fix have been pushed, who knows when it will be released.

@ilya-fedin
Copy link
Contributor

i guess you can try installing clean VS 2022 with latest 17.8 (or 17.9 preview) toolchain on maybe second device or VM? to check if you can reproduce that

I guess he hints that the community could look at the issue rather than waiting for him to look.

@BrendanGrant
Copy link

@john-preston i guess you can try installing clean VS 2022 with latest 17.8 (or 17.9 preview) toolchain on maybe second device or VM? to check if you can reproduce that

I've done that... spun up a Win11 dev machine with Hyper-V (includes some build of VS 2022 Community) (I don't currently have Win11 media on hand for quick spin ups), removed it, installed VS 2022 Community 17.10.0 Preview 1.0... and same results, duplicate key as described by others above, and which I'd hit the same place with earlier builds as well.

@agl-1984
Copy link
Contributor

Read through whole thread + various other external bugreports, I understood that MS is not very keen to fix that.
Problem, how I got it - at some point of libvpx build we have two variables: TARGET and target. And this leads to incorrect handling in MSBuild.

  • lowercase target is set by libvpx make files.
  • UPPERCASE TARGET set in prepare.py

I don't think it is right to fix it on libvpx side.
Here is the patch file that replaces TARGET with TOOLCHAIN in prepare.py

It worked for me in following environments

  • Tested on VM with latest VS 17.9
  • Tested on github runner with VS 17.8

@john-preston
technically i need to modify prepare.py in tdesktop repo + update build_libvpx_win.sh in patches repo.
Code below is not to merge as I referenced my own fork of patches repo.
But I believe it will give you an idea of a solution.

PR for patches: desktop-app/patches#182
and a diff for tdesktop repo

diff --git a/Telegram/build/prepare/prepare.py b/Telegram/build/prepare/prepare.py
index f53417ea3..bb284c1fe 100644
--- a/Telegram/build/prepare/prepare.py
+++ b/Telegram/build/prepare/prepare.py
@@ -416,9 +416,9 @@ if customRunCommand:
     finish(0)
 
 stage('patches', """
-    git clone https://github.com/desktop-app/patches.git
+    git clone https://github.com/agl-1984/patches.git
     cd patches
-    git checkout 94be868240
+    git checkout 02b71ee
 """)
 
 stage('msys64', """
@@ -855,9 +855,9 @@ win:
     SET MSYS2_PATH_TYPE=inherit
 
     if "%X8664%" equ "x64" (
-        SET "TARGET=x86_64-win64-vs17"
+        SET "TOOLCHAIN=x86_64-win64-vs17"
     ) else (
-        SET "TARGET=x86-win32-vs17"
+        SET "TOOLCHAIN=x86-win32-vs17"
     )
 
 depends:patches/build_libvpx_win.sh

@john-preston
Copy link
Member

Thank you for resolving this issue! This is great.

I've merged the patches PR, so now you can make a PR here that will reference the new upstream patches commit.

@agl-1984
Copy link
Contributor

Thank you for resolving this issue! This is great.

I've merged the patches PR, so now you can make a PR here that will reference the new upstream patches commit.

#27510

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.