ffmpeginteropx / FFmpegInteropX

FFmpeg decoding library for Windows 10 UWP and WinUI 3 Apps
Apache License 2.0
205 stars 52 forks source link

Ensure consistency between VS and command line builds #380

Closed softworkz closed 10 months ago

softworkz commented 10 months ago

I finally identified the culprit which is responsible for a significant amount of pain I've gone through.

The use of the devcmd parameters in the PowerShell command have the effect that you get different results between builds made in Visual Studio and builds via Build-FFmpegInteropX.ps1.

Especially the app_platform=UWP settings does some very obscure things. It seems to trigger some outdated MSBuild functionality which overrides settings in the .vcxproj.

But all of those parameters must be dropped. I don't think that any of this is needed at all, but in case it would, then it would need to be replicated in the .vcxproj.

When doing a build in VS and you get a different result from a command line build, then it's pointless to even work an anything (sorry for sounding harsh, this has just cost me lots of hours).

Besides all the confusion this has caused for me, it is also responsible for the setting to have no effect, which in turn is the cause why your WinUI package wasn't working properly (because it still referenced app-local runtime dlls).

lukasf commented 10 months ago

I introduced the DevShell for FFmpeg build. There it is needed, including all the parameters, so the right compilers (right platform target), SDKs and include folders are added to the path. I just took this over to the FFmpegInteropX build which was only added later. It might very well be that all this is not needed, because MSBuild will get all the required things from the vcxproj file.

Have you made sure that this works for all build configurations, and that the output lib is fully functional?

softworkz commented 10 months ago

Have you made sure that this works for all build configurations, and that the output lib is fully functional?

What I had done is to compare the outputs between command line and VS builds (WinUI and UWP) to check whether they are identical (each time after a full cleanup). I also checked that the UWP builds are using the app-local dlls and the WinUI builds are using the system-installed dlls.

I will re-test the UWP output in an application context and I will also try building UWP builds with DesktopCompatible set to see how that works. But even when it would work - the ultimate truth will come to light, only when having tested the end result with the Windows Store verification..

lukasf commented 10 months ago

Merged, thank you @softworkz