Skip to content

make building 'stable' stable - #826

Open
tasty0tomato wants to merge 11 commits into
shinchiro:masterfrom
tasty0tomato:pr/stable-build-fixes
Open

make building 'stable' stable#826
tasty0tomato wants to merge 11 commits into
shinchiro:masterfrom
tasty0tomato:pr/stable-build-fixes

Conversation

@tasty0tomato

Copy link
Copy Markdown

Of course, from mpv's perspective, nightly builds are stable enough. But tagged releases are naturally perceived as "stable" by regular users, and the mpv_tarball option in mpv_clang had several issues that made it unreliable. These fixes make it actually work.

btw, I did not do anything about mpv_gcc.

…ails

The shell idiom `$MPV_TARBALL && ninja mpv-release || ninja mpv` runs the
nightly fallback whenever `ninja mpv-release` fails, not just when
MPV_TARBALL is false. Any failure in the stable build path (e.g. mpv
master adding a meson option that the current stable tag does not
accept) silently produced a nightly build with mpv_ver=UNKNOWN and a
green job status, masking real regressions.

Replace with explicit if/else so the matrix job fails red when a stable
build is requested and `ninja mpv-release` fails.
The stable branch of the packaging script tried to copy
`mpv-root/mpv` and `mpv-root/fonts` from shinchiro/mpv-packaging, but
those directories no longer exist in that repo. With no `set -e` the
`cp` failed silently and stable archives ended up with only
`d3dcompiler_43.dll` from the packaging step.

End-user impact: stable builds were missing `mpv-install.bat` /
`mpv-uninstall.bat` (register mpv as the default media player),
`installer/mpv-icon.ico`, `installer/updater.ps1`, `updater.bat`,
and `doc/` — all of which the nightly branch correctly bundles via
`cp -r mpv-root/*`.

Align the stable branch with the nightly one.
Mirror the existing pattern in `packages/mpv.cmake` (line 111) which
already calls `force_meson_configure(mpv)`. Avoids stale meson cache
when re-running the workflow with different inputs against the same
build directory.
Stable tarball artifacts are named mpv-<TAG>-<arch>.7z (version first),
not mpv-<arch>-*.7z (arch first) like nightly builds. The existing upload
glob `mpv-${{ env.arch }}*` only matched arch-first names and silently
dropped all stable artifacts.

Add a second glob `mpv-*-${{ env.arch }}*.7z` to cover version-first
names. The trailing wildcard also handles the x86_64-v3 case where the
arch suffix includes the microarchitecture level (mpv-0.41.0-x86_64-v3.7z).
mpv-release.cmake does not produce a debug symbols package, so the
debug upload step emitted a warning for each of the 4 matrix jobs when
mpv_tarball=true. Skip the step entirely in that case.
Wrap the existing `meson setup` invocation with a generated bash script
that reads the tarball's `meson.options` (or legacy `meson_options.txt`)
and drops any `-D<name>=<value>` whose <name> is not declared there.
Unknown options are logged to stderr and skipped instead of aborting
configure.

mpv-release.cmake's option list is kept in sync with mpv master, so
building any older stable tag will fail at meson configure as soon as
master gains a new option (e.g. `-Dsubrandr=enabled` is unknown to
v0.41.0). Combined with the previously fixed silent fallback in the
workflow, that turned every stable build request into a nightly build
in disguise.

The option-name regex is restricted to [a-zA-Z0-9_-]+, matching meson's
own grammar, so the filter cannot drop a legitimate flag accidentally
or accept arbitrary input from the source tree.
After a successful stable build the workflow runs `rm -rf build_$BIT/mpv*`
which removes the mpv-<TAG>-<arch>/ output folder but leaves ExternalProject
stamp files inside the toolchain cache. On the next run ninja sees the
stamps as up-to-date, skips build/copy-package-dir, and the packaging
script finds no directory to archive, causing `mv build/mpv*.7z` to fail.

Delete the build and install-chain stamps at cmake configure time so
ninja always re-executes those steps. The download stamp is intentionally
left intact to avoid re-fetching the tarball.
The build_mpv job checked out ref: master unconditionally, meaning any
cmake/package changes on a non-master branch (e.g. fork-default) were
silently ignored — the cmake files run during the build always came
from master regardless of which branch triggered the workflow.

Change to ref: ${{ github.ref_name }} so the checked-out source matches
the branch that dispatched the workflow.
Stable users expect a fixed version (v0.41.0). Including updater.bat and
installer/updater.ps1 would silently upgrade them to nightly, contradicting
the reason they chose a stable build. Only copy installer/ and doc/.
@tasty0tomato
tasty0tomato force-pushed the pr/stable-build-fixes branch from 67c1ccc to 61ca8c8 Compare May 20, 2026 23:46
@tasty0tomato

tasty0tomato commented May 22, 2026

Copy link
Copy Markdown
Author

https://github.com/tasty0tomato/mpv-winbuild-cmake/actions/runs/26196662127
Build works (the Gist/release jobs fail, but that's expected since I don't have access to your repo's tokens).
Changes verified:

  1. mpv_tarball=true now works correctly — builds the stable tarball instead of silently falling back to nightly when something fails.
  2. The stable archive now includes installer/mpv-install.bat and installer/mpv-uninstall.bat, which were missing because mpv-root/mpv and mpv-root/fonts no longer exist in the packaging repo.(Include installer for stable releases #325 release and git versions and "installer" dir #795)
  3. The meson options filter (meson_setup_filtered.sh) allows building older stable tarballs even when master has added new meson options that the tarball doesn't support.

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.

1 participant