From 7e05686a7cbbffd8041d881b1e4409e3be0ed58d Mon Sep 17 00:00:00 2001 From: edde746 <86283021+edde746@users.noreply.github.com> Date: Sun, 26 Jul 2026 15:32:02 +0200 Subject: [PATCH] fix(windows): restore x64 and arm64 builds --- .github/workflows/build.yml | 34 +++++++++++++++++++++------- scripts/check_build_workflow.py | 8 ++++++- scripts/test_check_build_workflow.py | 12 ++++++++++ windows/runner/mpv/mpv_player.cpp | 4 ++-- 4 files changed, 47 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a6dc8c58..0f41aa99 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -441,22 +441,40 @@ jobs: cache-key: "${{ env.TRUSTED_BUILD_CACHE_VERSION }}-flutter-:os:-:channel:-:version:-:arch:-:hash:" pub-cache: false - - name: Set up Flutter 3.44.0 (git tag) + - name: Set up Flutter 3.44.0 from its immutable commit if: matrix.flutter_setup == 'git' - # Flutter publishes no windows-arm64 SDK archive, so subosito can't - # resolve 3.44.0 for arm64: the stable manifest has no arm64 entry, and - # `channel: master` would git-clone master HEAD (whose engine != our - # patched 3.44.0). Clone the 3.44.0 tag directly to get engine rev - # 4c525dac, which install-patched-engine.ps1 asserts before swapping. + # Flutter publishes no windows-arm64 SDK archive, so fetch the release tag for + # version discovery and verify it resolves to the pinned commit. That tag uses + # engine revision 4c525dac, which install-patched-engine.ps1 asserts before swapping. shell: pwsh run: | $root = "$env:RUNNER_TEMP\flutter" + $expectedCommit = "559ffa3f75e7402d65a8def9c28389a9b2e6fe42" git init $root git -C $root remote add origin https://github.com/flutter/flutter.git - git -C $root fetch --depth 1 origin 559ffa3f75e7402d65a8def9c28389a9b2e6fe42 - git -C $root checkout --detach FETCH_HEAD + git -C $root fetch --depth 1 origin refs/tags/3.44.0:refs/tags/3.44.0 + git -C $root checkout --detach refs/tags/3.44.0 + $actualCommit = git -C $root rev-parse HEAD + if ($LASTEXITCODE -ne 0 -or $actualCommit -ne $expectedCommit) { + throw "Flutter 3.44.0 resolved to $actualCommit, expected $expectedCommit" + } "$root\bin" | Out-File -FilePath $env:GITHUB_PATH -Append -Encoding utf8 & "$root\bin\flutter.bat" --version + if ($LASTEXITCODE -ne 0) { + throw "Unable to bootstrap the Flutter SDK" + } + $versionOutput = & "$root\bin\flutter.bat" --version --machine + if ($LASTEXITCODE -ne 0) { + throw "Unable to resolve the Flutter SDK version" + } + $versionJson = $versionOutput -join "`n" + if ([string]::IsNullOrWhiteSpace($versionJson)) { + throw "Flutter did not report machine-readable version JSON" + } + $version = $versionJson | ConvertFrom-Json + if ($version.frameworkVersion -ne "3.44.0") { + throw "Flutter reported version $($version.frameworkVersion), expected 3.44.0" + } - name: Cache Pub dependencies uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6 diff --git a/scripts/check_build_workflow.py b/scripts/check_build_workflow.py index f894955f..555940bc 100644 --- a/scripts/check_build_workflow.py +++ b/scripts/check_build_workflow.py @@ -132,7 +132,13 @@ require( for expected in ( "if: matrix.flutter_setup == 'action'", "if: matrix.flutter_setup == 'git'", - "git -C $root fetch --depth 1 origin 559ffa3f75e7402d65a8def9c28389a9b2e6fe42", + '$expectedCommit = "559ffa3f75e7402d65a8def9c28389a9b2e6fe42"', + "git -C $root fetch --depth 1 origin refs/tags/3.44.0:refs/tags/3.44.0", + "git -C $root checkout --detach refs/tags/3.44.0", + "$actualCommit = git -C $root rev-parse HEAD", + "$actualCommit -ne $expectedCommit", + r'$versionOutput = & "$root\bin\flutter.bat" --version --machine', + '$version.frameworkVersion -ne "3.44.0"', "flutter pub get --enforce-lockfile --no-example", "--dart-define=SENTRY_DIST=github-windows-${{ matrix.arch }}", "--split-debug-info=debug-info/windows-${{ matrix.arch }}", diff --git a/scripts/test_check_build_workflow.py b/scripts/test_check_build_workflow.py index bceb6aae..7c39748f 100755 --- a/scripts/test_check_build_workflow.py +++ b/scripts/test_check_build_workflow.py @@ -35,6 +35,18 @@ class BuildWorkflowGuardTest(unittest.TestCase): self.assertEqual(result.returncode, 0, result.stderr) self.assertIn("architecture matrix checks passed", result.stdout) + def test_windows_arm_flutter_without_release_tag_is_rejected(self) -> None: + workflow = self._workflow().replace( + "git -C $root fetch --depth 1 origin refs/tags/3.44.0:refs/tags/3.44.0", + "git -C $root fetch --depth 1 origin 559ffa3f75e7402d65a8def9c28389a9b2e6fe42", + 1, + ) + + result = self._run(workflow) + + self.assertNotEqual(result.returncode, 0) + self.assertIn("refs/tags/3.44.0", result.stderr) + def test_mutable_download_in_signing_step_is_rejected(self) -> None: workflow = self._workflow().replace( " try {\n", diff --git a/windows/runner/mpv/mpv_player.cpp b/windows/runner/mpv/mpv_player.cpp index 05ce95fb..8fd05e51 100644 --- a/windows/runner/mpv/mpv_player.cpp +++ b/windows/runner/mpv/mpv_player.cpp @@ -201,8 +201,8 @@ LRESULT CALLBACK MpvInnerSubclassProc( if (message == WM_NCDESTROY) { state->active.store(false, std::memory_order_release); - const HWND view = state->forward_target.exchange(nullptr, std::memory_order_acq_rel); - ReleaseForwardedPointer(*state, view); + const HWND forward_target = state->forward_target.exchange(nullptr, std::memory_order_acq_rel); + ReleaseForwardedPointer(*state, forward_target); ::RemoveWindowSubclass(hwnd, MpvInnerSubclassProc, subclass_id); std::lock_guard lock(g_inner_subclasses_mutex); const auto it = g_inner_subclasses.find(hwnd);