[ffmpeg] Honor macosx deployment target for ffmpeg#18460
[ffmpeg] Honor macosx deployment target for ffmpeg#18460strega-nil-ms merged 2 commits intomicrosoft:masterfrom
Conversation
|
I would consider this PR invalid. The proper fix is to call |
I disagree. The documentation for this function quite clearly states that it's meant only for internal use in vcpkg helpers, since behavior and arguments will change without notice. So you wouldn't want to put this in a portfile, since that means you'd have ports breaking all the time when a change in this function happens. |
There are exceptions to 'rules' for ports with really bad build systems like ffmpeg which do not use vcpkg helpers due to being a extraordinary special kind of flower. As such creating an extra helper would be too port specific. (I mean you could create |
|
@Neumann-A Can you explain a little bit more about what the advantages are of this setup? I have tried doing this by adding the call to the I do see that the |
|
You need to add all the FLAGS env variables as done inininhttps://github.com/microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_configure_make.cmake |
|
I still don't understand how that is advantageous. The file you're linking to seems to do things to process variables like So, to implement your suggestion I would add a dependency on something marked internal, and then I can use |
c4587d7 to
c9ff11b
Compare
the bigger picture. ffmpeg is not correctly setting compiler and compiler/linker flags. in vcpkg everything should depend on the cmake_toolchain_file which ffmpeg is currently not.
wrong. these are the flags emitted by cmake if cmake is adding them somewhere else like e.g. in the platform scripts they need to be added to the detection script. this then not only fixes ffmpeg but all ports depending on the detection script. |
|
Unfortunately, I fear I'm not familiar with the internal workings of vcpkg_internal_get_cmake_vars to understand exactly what's needed here, and the documentation isn't particularly helpful. From what I gather from looking at existing code, the intended usage appears to be: vcpkg_internal_get_cmake_vars(OUTPUT_FILE _VCPKG_CMAKE_VARS_FILE)
include("${_VCPKG_CMAKE_VARS_FILE}")but as noted above, this isn't enough. I agree that ideally non-standard ports should set linker and compiler flags similar to standard ports. Perhaps someone with a solid understanding of the inner workings of vcpkg could document how to do that, and implement it for ffmpeg, to serve as an example for other non-standard ports. The other option is to try to switch ffmpeg to vcpkg_configure_make, but that might be a much bigger undertaking, and I don't know how easy that is or even if it is possible with ffmpeg's configure script. Pending all of this, the PR as it currently stands seems like an acceptable temporary solution for macosx deployment, at least to me, until a better solution can be implemented. |
c9ff11b to
e7c5e72
Compare
e7c5e72 to
be0343a
Compare
|
Rebased on current master and solved conflicts |
936f886 to
2ee2747
Compare
|
Another round of conflict resolution. |
2ee2747 to
e97b13b
Compare
|
Is there anything I can do to facilitate this getting merged? I can keep resolving merge conflicts, of course, but is anybody still looking at this PR? |
|
@omartijn, sorry for the delay, I will ask other team member to review this PR, please resolve the conflicts. |
e97b13b to
b142716
Compare
|
Limit knowledge to the evaluation, needs other team member to take a look again. |
ports/ffmpeg/portfile.cmake
Outdated
| endif() | ||
|
|
||
| if(VCPKG_TARGET_IS_OSX AND VCPKG_OSX_DEPLOYMENT_TARGET) | ||
| set(OPTIONS "--extra-cflags=-mmacosx-version-min=${VCPKG_OSX_DEPLOYMENT_TARGET} ${OPTIONS}") |
There was a problem hiding this comment.
This should probably be run after vcpkg_cmake_get_vars, and use the result from there.
There was a problem hiding this comment.
This should probably be run after
vcpkg_cmake_get_vars, and use the result from there.
Please look at feeding ffmpeg the right flags with this. https://github.com/microsoft/vcpkg/blob/master/docs/maintainers/ports/vcpkg-cmake/vcpkg_cmake_get_vars.md
(Note that we discourage use in portfiles in that documentation because most modifications to cmake vars should happen in the build system rather than the portfile, but ffmpeg has a custom build system :) )
There was a problem hiding this comment.
This is a new experimental fast check for PR issues. Please let us know if this bot is helpful!
After committing all other changes, the version database must be updated
git add -u && git commit
git checkout 8c092e5cb6c275906758f0b5b54dde4ce6afaaa0 -- versions
./vcpkg x-add-version --allDiff
diff --git a/versions/f-/ffmpeg.json b/versions/f-/ffmpeg.json
index e5434c5..35a4664 100644
--- a/versions/f-/ffmpeg.json
+++ b/versions/f-/ffmpeg.json
@@ -1,7 +1,7 @@
{
"versions": [
{
- "git-tree": "adbff70b914d111ca076f7d41421bc8c78436fde",
+ "git-tree": "24cb6ddcd146248cb3758ec1aa4c038b28d4c0c5",
"version": "4.4",
"port-version": 15
},e82e022 to
d83b161
Compare
|
The macos fleet is currently broken because a SAS token expired, fix is in #20512 |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@BillyONeal Should I rebase to get the latest fixes for the azure pipeline? |
@omartijn Rebasing wouldn't gain you anything wrt to the osx CI issues. The artifact cache for osx was empty when |
Shouldn't be needed as this build was successful. The merge to get osx fixes caused PRs to fail.
In this case the binary cache got broken which reset all the things :/ |
|
Thanks @omartijn :) |
Ports that are not CMake-based, which includes most nominally ports using Autotools, ignore options like VCPKG_OSX_DEPLOYMENT_TARGET. This is not an issue for our normal triplets, since they don't set this flag anyway, but when used in manifest mode it's common to set this to the same deployment target as the software it's used in.
This PR makes ffmpeg honor this flag by setting the correct c- and linker flags.
What does your PR fix?
Fixes ffmpeg ignoring VCPKG_MACOSX_DEPLOYMENT_TARGET
Which triplets are supported/not supported? Have you updated the CI baseline?
No changes to triplets, ci baseline is not updated
Does your PR follow the maintainer guide?
Yes
If you have added/updated a port: Have you run
./vcpkg x-add-version --alland committed the result?Versions have been updated.
If you are still working on the PR, open it as a Draft: https://github.blog/2019-02-14-introducing-draft-pull-requests/