Closed cbat98 closed 1 year ago
Looks like we'll need to file an issue with vpkg, I already have had one open for about a year for yet another dependency: https://github.com/Microsoft/vcpkg/issues/5018
I think we'll either need to fix these package in vcpkg ourselves or move the package out of vcpkg
I checked https://github.com/Squalr/vcpkg/commits/master/ports/mpg123/portfile.cmake to make sure have the latest version and it looks to be the same as https://github.com/microsoft/vcpkg/commits/master/ports/mpg123 👎
I wonder if any of the recent commits broke it @zcanann did you have this same problem on windows? we could revert to https://github.com/Squalr/vcpkg/commit/bde9a0496726c0be181f97879e47a35a9928c242#diff-a030ab7272a55ea1491258fb928458d0 if it used to work
Huh, is this even used on Windows?
Maybe requirements.json
can be edited to only pull it on on darwin/linux. Right now it's under common.
Hi everyone, does this issue still exists?
Yes still exists
The reason for reporting this error is that the library was generated incorrectly. We expected to use dynamic CRT linkage but static CRT linkage.
vcpkg uses the Visual Studio project libmpg123.vcxproj
inside mpg123 source to build it, so I think the project file has been modified.
And I can't find the script dep.ph
, can anyone help me?
hi @JackBoosY it's dep.py, This is the script https://github.com/Squalr/Squally/blob/develop/dep.py
The project uses vcpkg to pull in mpg123 and that can be found here: https://github.com/microsoft/vcpkg/tree/master/ports/mpg123
Originally I thought the mpg123 portfiles might be behind microsoft's version and that was what was causing issues. Squally's version of the portfiles is a fork located here: https://github.com/Squalr/vcpkg/commits/c2b6e8e46d71ad4bc3169138715eba78f049c649/ports/mpg123
I feel this commit is suspect: https://github.com/Squalr/vcpkg/commit/39b331ec10f23dda7602c509da2535d980e7e669#diff-a030ab7272a55ea1491258fb928458d0 but I could not get mpg123 to build correctly, even using the direct portfiles from microsoft.
More info on VCpkg here: https://docs.microsoft.com/en-us/cpp/build/vcpkg?view=vs-2019
https://vcpkg.readthedocs.io/en/latest/examples/installing-and-using-packages/
dep.py is just a simple wrapper around vcpkg
@mattbucci The patch 0001-fix-crt-linking.patch
fixes the CRT linkage, ~so if you want to build static, that patch should be applied.~ This patch modifies the CRT linage under static configuration to MultiThreadedDebug
/ MultiThreaded
and should be always applied.
And now I still can't repro this issue:
PS F:\vcpkg> .\vcpkg.exe install mpg123
Computing installation plan...
The following packages will be built and installed:
mpg123[core]:x86-windows
Detecting compiler hash for triplet x86-windows...
Starting package 1/1: mpg123:x86-windows
Building package mpg123[core]:x86-windows...
Could not locate cached archive: C:\Users\AppData\Local\vcpkg\archives\07\07c652cf710f3c44c14f7e857748997b6774a638.zip
-- Trying auto-select mirror...
-- Downloading https://sourceforge.net/projects/mpg123/files/mpg123/1.25.8/mpg123-1.25.8.tar.bz2/download...
-- Skipping hash check for F:/vcpkg/downloads/temp/mpg123-1.25.8.tar.bz2.
-- The default mirror is in Disaster Recovery mode, trying other mirrors...
-- Trying mirror cfhcable...
-- Using cached F:/vcpkg/downloads/mpg123-1.25.8.tar.bz2
-- Skipping hash check for F:/vcpkg/downloads/mpg123-1.25.8.tar.bz2.
-- Extracting source F:/vcpkg/downloads/mpg123-1.25.8.tar.bz2
-- Applying patch 0001-fix-crt-linking.patch
-- Applying patch 0002-fix-x86-build.patch
-- Applying patch 0003-add-arm-configs.patch
-- Applying patch 0004-add-arm64-uwp-config.patch
-- Using source at F:/vcpkg/buildtrees/mpg123/src/f226317ddd-0aae5f9fd8.clean
-- Building F:/vcpkg/buildtrees/mpg123/src/f226317ddd-0aae5f9fd8.clean/ports/MSVC++/2015/win32/libmpg123/libmpg123.vcxproj for Release
-- Building F:/vcpkg/buildtrees/mpg123/src/f226317ddd-0aae5f9fd8.clean/ports/MSVC++/2015/win32/libmpg123/libmpg123.vcxproj for Debug
-- Installing
-- Installing: F:/vcpkg/packages/mpg123_x86-windows/debug/bin/libmpg123.dll
-- Installing: F:/vcpkg/packages/mpg123_x86-windows/debug/bin/libmpg123.pdb
-- Installing: F:/vcpkg/packages/mpg123_x86-windows/bin/libmpg123.dll
-- Installing: F:/vcpkg/packages/mpg123_x86-windows/bin/libmpg123.pdb
-- Installing: F:/vcpkg/packages/mpg123_x86-windows/debug/lib/libmpg123.lib
-- Installing: F:/vcpkg/packages/mpg123_x86-windows/lib/libmpg123.lib
-- Installing: F:/vcpkg/packages/mpg123_x86-windows/include/mpg123.h
-- Installing: F:/vcpkg/packages/mpg123_x86-windows/include/fmt123.h
-- Installing: F:/vcpkg/packages/mpg123_x86-windows/include/mpg123.h.in
-- Installing: F:/vcpkg/packages/mpg123_x86-windows/share/mpg123/copyright
-- Installing done
-- Performing post-build validation
-- Performing post-build validation done
Stored binary cache: C:\Users\AppData\Local\vcpkg\archives\07\07c652cf710f3c44c14f7e857748997b6774a638.zip
Building package mpg123[core]:x86-windows... done
Installing package mpg123[core]:x86-windows...
Installing package mpg123[core]:x86-windows... done
Elapsed time for package mpg123:x86-windows: 2.646 min
Total elapsed time: 3.042 min
I used the latest version in vcpkg master branch.
If the latest version does not work properly, please leave me the logs under _VCPKGROOT/buildtrees/mpg123.
Thanks.
Here are my logs @JackBoosY build-x86-windows-dbg-err.zip
My assumption is that the error is due to the change in the windows-86 triplet to compile a static binary instead of a dynamic one here: https://github.com/Squalr/vcpkg/blob/master/triplets/x86-windows.cmake
I assume mpg123 should still be able to build even if you set this to static instead of dynamic. You should be able to reproduce the problem by changing your triplet for x86 windows to build a static lib
@mattbucci I think so. Thanks for this info, I'll digger into it later.
Confirmed. And you should use community triplet x86-windows-static-md
instead of change triplet file x86-windows
.
@mattbucci So can we automatically compile mpg123 static while everything else is still dynamic? I can do so manually but weird mpg123 is not supporting dynamic.
@superhero1 This is easy to solve, just comment out _VCPKGROOT/ports/mpg123/porfile.cmake line 33:
0001-fix-crt-linking.patch
will solve this issue.
Then use command ./vcpkg install mpg123:x86-windows-static-md
.
Build okay.
The reason for this issue is that the patch failed to patch the RuntimeLibrary option in vcxproj
according to VCPKG_CRT_LINKAGE
. I will open a PR to fix the issue.
Switched to OGG so no more mp3 requirements needed
When I try running the dep.py script on windows, I get an error preventing mpg123 from being installed properly, as it seems to be failing post validation checks. I've done some digging to try and fix this, but this is a tad out of my depth and have just been going round in circles checking error codes and reading source files. Any input would be great.