Skip to content

[ffmpeg] regxep and passthrough fix #44955

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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

petersteneteg
Copy link
Contributor

This PR addresses issues with building FFMpeg on windows

The PC config files are transform in the portfile:

if(content MATCHES "${entry}: ([^\n]*)")
set(old_value "${CMAKE_MATCH_1}")
string(REGEX REPLACE "-libpath:" "-L" new_value "${old_value}")
string(REGEX REPLACE " ([^ /]+)[.]lib" " -l\\1" new_value "${new_value}")
string(REPLACE "${entry}: ${old_value}" "${entry}: ${new_value}" content "${content}")
endif()

basically mapping foo.lib -> -lfoo
But first case item in the list was not transformed due to a space issue in the regexp matching

for example: given input:
Libs.private: psapi.lib ole32.lib strmiids.lib uuid.lib
We got
Libs.private: psapi.lib -lole32 -lstrmiids -luuid
But expected
Libs.private: -lpsapi -lole32 -lstrmiids -luuid

Similarly
In the generated FindFFMPEG.cmake I get the following in my windows computer

append_dependencies(FFMPEG_DEPS_LIBRARY_RELEASE NAMES "psapi.lib;uuid.lib;oleaut32.lib;shlwapi.lib;gdi32.lib;vfw32.lib;secur32.lib;ws2_32.lib;mfuuid.lib;strmiids.lib;ole32.lib;user32.lib;bcrypt.lib")

And we expect libs like psapi.lib the math the set of pass_through libs

set(pass_through
${CMAKE_CXX_IMPLICIT_LINK_LIBRARIES}
advapi32 bcrypt crypt32 gdi32 mfuuid ole32 oleaut32 psapi secur32 shlwapi strmiids user32 uuid vfw32 ws2_32 usp10 cfgmgr32 rpcrt4
-pthread -pthreads pthread atomic m
)

But since they are given without the .lib extension we also have to check just the stem of the give lib name

  • Changes comply with the maintainer guide.
  • SHA512s are updated for each updated download.
  • The "supports" clause reflects platforms that may be fixed by this new version.
  • Any fixed CI baseline entries are removed from that file.
  • Any patches that are no longer applied are deleted from the port's directory.
  • The version database is fixed by rerunning ./vcpkg x-add-version --all and committing the result.
  • Only one version is added to each modified port's versions file.

@Mengna-Li Mengna-Li self-assigned this Apr 10, 2025
@Mengna-Li Mengna-Li added the category:port-bug The issue is with a library, which is something the port should already support label Apr 10, 2025
@BillyONeal BillyONeal marked this pull request as draft April 11, 2025 19:56
@BillyONeal
Copy link
Member

The build failures appear legitimate.

@petersteneteg
Copy link
Contributor Author

@BillyONeal Yes, probably, But I can not reproduce it locally and it seems I can not download the build logs from the failed jobs. The download buttons don't seem do anything. How can I access them?

@BillyONeal
Copy link
Member

failure logs for x64-windows-static.zip

Button works for me 🤷

@BillyONeal
Copy link
Member

(Note that vcpkg-ci-ffmpeg is in scripts/test_ports)

@dg0yt
Copy link
Contributor

dg0yt commented Apr 15, 2025

libpath woes?

  • Both failures do not show a single -libpath in the failing linker command.
  • Some libs are used with namespec only (failing: SDL2-staticd.lib, libmfx.lib).
  • The pattern which this PR attempts to fix is also related to the lack of libpath: The usual haystack is
    Libs: <libpath-arg> <lib-arg> [...]
    
    There is hardly any scenario where a pc file wouldn't use this pattern. And then the modification wouldn't be needed. (The exception might be header-only "libs" if they need system libs. But here, we look at ffmpeg.)

@petersteneteg
Copy link
Contributor Author

petersteneteg commented Apr 15, 2025

@BillyONeal I only found this page with artifacts https://dev.azure.com/vcpkg/public/_build/results?buildId=114494&view=artifacts&pathAsName=false&type=publishedArtifacts and not of those works, Where do I find the link you added?

bild

Im using firefox as you see the three vertical dot that I can see in Safari is not there on firefox. And clicking the text does noting. But I found that after some hovering I can get the dots to pop up so I can get to the download button.

@petersteneteg
Copy link
Contributor Author

@dg0yt I don't quite understand what the problem is or how I caused it. :/ And locally everything works. Do you have any more hints on how to address the issues?

@dg0yt
Copy link
Contributor

dg0yt commented Apr 16, 2025

Can you start with information how to reproduce the problem? Which feature set or manifest do you use when the problem occurs?

@dg0yt
Copy link
Contributor

dg0yt commented Apr 16, 2025

Where do I find the link you added?

Hover an artifact line. Spot the three dots on the right side while hovering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-bug The issue is with a library, which is something the port should already support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants