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

Failed to build, opus not found with pkg-config #26414

Closed
CaledoniaProject opened this issue Jun 17, 2023 · 30 comments
Closed

Failed to build, opus not found with pkg-config #26414

CaledoniaProject opened this issue Jun 17, 2023 · 30 comments
Labels

Comments

@CaledoniaProject
Copy link
Contributor

Steps to reproduce

I'm following exactly the steps here
https://github.com/telegramdesktop/tdesktop/blob/dev/docs/building-win-x64.md

Expected behaviour

I expect tdesktop\Telegram\build\prepare\win.bat to finish successfully

Actual behaviour

The prepare script failed

111

Operating system

Windows Server 2022

Version of Telegram Desktop

latest

Installation source

Other (unofficial) source

Crash ID

No response

Logs

Packages (1) pkgconf-1.9.4-1

Total Download Size:   0.06 MiB
Total Installed Size:  0.29 MiB

:: Proceed with installation? [Y/n]
:: Retrieving packages...
 pkgconf-1.9.4-1-x86_64                          61.6 KiB  65.7 KiB/s 00:01 [#########################################] 100%
(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) installing pkgconf                                                    [#########################################] 100%
sed 's#@@PREFIX@@#C:/Users/Administrator/Desktop/Libraries/win64/local#' ffnvcodec.pc.in > ffnvcodec.pc
install -m 0755 -d '/c/Users/Administrator/Desktop/Libraries/win64/patches/../local/include/ffnvcodec'
install -m 0644 include/ffnvcodec/*.h '/c/Users/Administrator/Desktop/Libraries/win64/patches/../local/include/ffnvcodec'
install -m 0755 -d '/c/Users/Administrator/Desktop/Libraries/win64/patches/../local/lib/pkgconfig'
install -m 0644 ffnvcodec.pc '/c/Users/Administrator/Desktop/Libraries/win64/patches/../local/lib/pkgconfig'
ERROR: opus not found using pkg-config

If you think configure made a mistake, make sure you are using the latest
version from Git.  If the latest version fails, report the problem to the
[email protected] mailing list or IRC #ffmpeg on irc.libera.chat.
Include the log file "ffbuild/config.log" produced by configure as this will help
solve the problem.
[20/26](Libraries/ffmpeg): FAILED
FAILED
@CaledoniaProject
Copy link
Contributor Author

I executed the script multiple times and it finally exited without error. Now I got another problem

> configure.bat -D XXX -D XXX

Warn about uninitialized values.
Version: 4.8.4
-- Selecting Windows SDK version 10.0.22000.0 to target Windows 10.0.20348.
CMake Error at cmake/external/qt/package.cmake:32 (find_package):
  Could not find a package configuration file provided by "QT" with any of
  the following names:

    Qt5Config.cmake
    qt5-config.cmake

  Add the installation prefix of "QT" to CMAKE_PREFIX_PATH or set "QT_DIR" to
  a directory containing one of the above files.  If "QT" provides a separate
  development package or SDK, be sure it has been installed.
Call Stack (most recent call first):
  CMakeLists.txt:64 (include)


-- Configuring incomplete, errors occurred!

@ilya-fedin
Copy link
Contributor

ilya-fedin commented Jun 17, 2023

and it finally exited without error.

Given that tdesktop can't find Qt, I'm highly doubt it exited without error.

@CaledoniaProject
Copy link
Contributor Author

@ilya-fedin It succeed and the Qt5 library is compiled.

qqq

And when I execute the prepare script again it prompts no error, everything is done already.

C:\Users\Administrator\Desktop>tdesktop\Telegram\build\prepare\win.bat
[1/26](Libraries/patches): SKIPPING
[2/26](ThirdParty/msys64): SKIPPING
[3/26](ThirdParty/python#0.3.11.4): 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): SKIPPING
[19/26](Libraries/nv-codec-headers): SKIPPING
[20/26](Libraries/ffmpeg): SKIPPING
[21/26](Libraries/openal-soft#0.2): SKIPPING
[22/26](Libraries/breakpad): SKIPPING
[23/26](Libraries/tg_angle): SKIPPING
[24/26](Libraries/qt_5_15_9): SKIPPING
[25/26](Libraries/tg_owt): SKIPPING
[26/26](Libraries/protobuf): SKIPPING

@ilya-fedin
Copy link
Contributor

provide your CMakeCache.txt

@CaledoniaProject
Copy link
Contributor Author

@ilya-fedin I'll come back ASAP, I have deleted everything and start over again.

@CaledoniaProject
Copy link
Contributor Author

CaledoniaProject commented Jun 18, 2023

Qt5Config.cmake is located in the Qt-5.5.19 folder

1111

And I tried to specify the directory directly, still won't work

C:\Users\Administrator\Desktop\tdesktop\Telegram>configure.bat -DQT_DIR=C:\Users\Administrator\Desktop\Libraries\win64\Qt-5.15.9
Warn about uninitialized values.
Version: 4.8.4
-- Selecting Windows SDK version 10.0.22000.0 to target Windows 10.0.20348.
CMake Error at cmake/external/qt/package.cmake:32 (find_package):
  Could not find a package configuration file provided by "QT" with any of
  the following names:

    Qt5Config.cmake
    qt5-config.cmake

  Add the installation prefix of "QT" to CMAKE_PREFIX_PATH or set "QT_DIR" to
  a directory containing one of the above files.  If "QT" provides a separate
  development package or SDK, be sure it has been installed.
Call Stack (most recent call first):
  CMakeLists.txt:64 (include)

-- Configuring incomplete, errors occurred!

Attached CMakeCache.txt
cmakecache.txt

@ilya-fedin
Copy link
Contributor

# It was generated by CMake: C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cmake.exe
CMake provided by Visual Studio is known to not to work with tdesktop build, please uninstall it.

@CaledoniaProject
Copy link
Contributor Author

@ilya-fedin Interesting pitfall, can you update the build document and tell other people not to uncheck cmake in Visual Studio Installer?

11222

@ilya-fedin
Copy link
Contributor

Well, it's more a question for @john-preston whether he would like to document that

CaledoniaProject added a commit to CaledoniaProject/tdesktop that referenced this issue Jun 18, 2023
@CaledoniaProject
Copy link
Contributor Author

I've created a PR for this #26424

@CaledoniaProject
Copy link
Contributor Author

@ilya-fedin It does not solve the problem .... it still couldn't find QT

cmakecache-new.txt

@ilya-fedin
Copy link
Contributor

I hope you've cleared the build directory and didn't pass the -DQT_DIR option?

@ilya-fedin
Copy link
Contributor

Is it possible you somehow launch prepare.py with x64 build tools but tdesktop itself with x86 build tools?

@ilya-fedin
Copy link
Contributor

ilya-fedin commented Jun 18, 2023

According to your CMakeCache.txt, it's not just x86 build tools but x64_x86 cross tools (not x64 Native Tools as the instructions says)

//Path to a program.
CMAKE_AR:FILEPATH=C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.36.32532/bin/Hostx64/x86/lib.exe

@ilya-fedin
Copy link
Contributor

ilya-fedin commented Jun 18, 2023

If prepare.py was running using x64_x86 cross tools as well then all the built dependencies are corrupted

@CaledoniaProject
Copy link
Contributor Author

I don't remember if it's a X64 native environment, I've deleted Telegram\out, Libraries, ThirdParty and will start over again.

@CaledoniaProject
Copy link
Contributor Author

@ilya-fedin In the x64 Native environment, prepare.py finished successfully and I instantly started the configure.bat, and it fails with the same error

shot 2023-06-18 at 14 56 41

Attached cmakecache
cmakecache3.txt

@ilya-fedin
Copy link
Contributor

You're still using x64_x86 Cross Tools, NOT the x64 Native Tools (or maybe you forgot to clear build cache?).

@CaledoniaProject
Copy link
Contributor Author

@ilya-fedin Hmm, that's weird, see the last screenshot title .... I'm in the x64 Native tools. What do you think is wrong?

I cleared Libraries, ThirdParty and tdesktop\out, is that not enough?

@CaledoniaProject
Copy link
Contributor Author

I'll clear everything and try the x86 steps, just to see if it works

@ilya-fedin
Copy link
Contributor

is that not enough?

cmakecache is in out, so I was talking about out specifically.

I'm in the x64 Native tools.

Are you sure? CMakeCache says you're not.

@ilya-fedin
Copy link
Contributor

Running command line as admin has tendency to reset environment variable, ensure you're not running as admin

@ilya-fedin
Copy link
Contributor

configure.bat -D XXX -D XXX

I have just noticed that none of your snipetts/screenshots have x64 like mentoned in the instruction
изображение

@CaledoniaProject
Copy link
Contributor Author

I successfully build it with x86 environment. Weird, not sure what's wrong with x64.

@ilya-fedin
Copy link
Contributor

Have you seen my last message?

@CaledoniaProject
Copy link
Contributor Author

@ilya-fedin Yes I saw it, but I think -D is not actually the culprit. In the x86 environment I forget to use these parameters as well, but it prompts the API and HASH is required, instead of missing QT libraries ....

@ilya-fedin
Copy link
Contributor

Huh? I don't talk about the -D parameters, re-read my comment

@CaledoniaProject
Copy link
Contributor Author

@ilya-fedin Ahhh, damn, I completely missed the x64 parameter!

@CaledoniaProject
Copy link
Contributor Author

CaledoniaProject commented Jun 19, 2023

Is there any way for prepare.py or configure.bat to detect the build environment automatically? Since everything is tied together, I don't think people would mix the environment for different architectures.

@CaledoniaProject
Copy link
Contributor Author

CaledoniaProject commented Jun 20, 2023

Closing the case. I've successfully build on both x86 and x64 environment. Thanks for the help! @ilya-fedin

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

No branches or pull requests

2 participants