Skip to content

deps.ffmpeg: Update libvpx to 1.17.0 and fix Windows build issues - #324

Open
PatTheMav wants to merge 2 commits into
obsproject:masterfrom
PatTheMav:libvpx-nasm-fix
Open

PatTheMav wants to merge 2 commits into
obsproject:masterfrom
PatTheMav:libvpx-nasm-fix

Conversation

@PatTheMav

Copy link
Copy Markdown
Member

Description

Upgrades libvpx to version 1.17.0 released in August 2026 and applies an official commit as a patch that fixes build issues introduced by the upgrade to nasm 3.0+ in MSYS2.

Also fixes potential issues with git installed in MSYS2 on a machine running the build script.

Motivation and Context

When nasm's MSYS2 package was upgraded to 3.0+, builds of libvpx on Windows were broken due to a bug in libvpx's assembler source code.

This is fixed by commit 251f0168c042861763f73b744f0b3583c70431a2 in the libvpx repository, which is retained as a patch file for Windows as part of this PR.

This PR also fixes issues with git installed in MSYS2 on a Windows machine:

  • Get-Command would provide the path to git.exe inside the MSYS2 installation.
  • Running this variant of git.exe would return paths in their Cygwin "Unix" variant (e.g. /c/Program Files/ which would then "leak" into the global script variables like ProjectRoot.
  • If these paths are then used to create new path strings and those are fed back to this version of git.exe, the binary will use paths like /c/c/Program Files instead.
  • If cygpath is available on the system, it suggests availability of MSYS2. cygpath accepts Windows-style paths as well as Unix-style paths and returns the desired variant, which can thus be used to ensure a Windows-style path.
  • git.exe can be installed individually in MSYS2 and patch.exe is not provided automatically. If the former is present, the latter needs to be present as well. Git for Windows provides them both (which is the dependency installed automatically by the build script).
    • The changes thus only ensure that if both git.exe and patch.exe are available via MSYS2, that patching can still succeed.

How Has This Been Tested?

  • Tested on Windows 11: libvpx built and linked successfully using nasm.
  • Tested on macOS (Apple Silicon): libvpx built successfully, but the ARM64 target does not use nasm.
  • Not tested on macOS (Intel): I have no Intel-based Macs available to me.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • I have read the contributing document.
  • My code has been run through clang-format.
  • My code follows the project's style guidelines
  • My code is not on the master branch.
  • My code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

@RytoEX RytoEX mentioned this pull request Oct 22, 2026
6 of 7 tasks
@RytoEX

RytoEX commented Oct 22, 2026

Copy link
Copy Markdown
Member

Merging #327 caused a merge conflict here.

If git is installed via MSYS2 it is potentially preferred by Get-Command
and thus paths returned will be Cygwin-based paths (which the script is
not designed to handle) and the patch executable does not exist in the
same location relative to git.exe.

These changes ensure that the potential checkout path is converted to
a Windows-style path before being set as a global variable and also
attempts to detect if MSYS2 git is used and thus patch.exe should be
present in the same directory as git.exe.

NOTE: If only git.exe is installed but not patch.exe, this is now
considered a misconfiguration of the build system.
Also fixes issue with nasm 3.0+ producing wrong x86 and x86_64 assembly.
@PatTheMav

Copy link
Copy Markdown
Member Author

Merging #327 caused a merge conflict here.

Resolved and rebased.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants