diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8b57664b..b13d6ad6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -248,12 +248,6 @@ jobs: with: name: gen1recomp-xbox-uwp-payload path: .bazinga/work - - - - - name: Rebuild Xbox UWP picker dependencies - shell: pwsh - run: ./scripts/xbox-uwp/rebuild_dependencies.ps1 -SkipAngle -SkipPackage - name: Build Xbox UWP package shell: bash run: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 723abb3c..7d9e4653 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -273,12 +273,6 @@ jobs: "UWP_PFX=$pfx" | Out-File $env:GITHUB_ENV -Append "UWP_CERT_THUMBPRINT=$($cert.Thumbprint)" | Out-File $env:GITHUB_ENV -Append "UWP_PUBLISHER=$($cert.Subject)" | Out-File $env:GITHUB_ENV -Append - - - - - name: Rebuild Xbox UWP picker dependencies - shell: pwsh - run: ./scripts/xbox-uwp/rebuild_dependencies.ps1 -SkipAngle -SkipPackage - name: Build Xbox UWP package shell: bash run: | diff --git a/ports/uwp/BUILD.md b/ports/uwp/BUILD.md index 23443b97..b0ea771b 100644 --- a/ports/uwp/BUILD.md +++ b/ports/uwp/BUILD.md @@ -40,12 +40,12 @@ Run the dependency rebuild from the repository root: The script clones the pinned SDL2, LÖVE, LuaJIT, vcpkg, depot_tools, and ANGLE sources when they are missing. It applies the Xbox SDL2 patch and the LÖVE picker patch (`third_party/love/patches/gba-file-picker.patch`, which adds -`.gba` to the ROM file picker), builds the x64 UWP Release libraries, stages -the required DLLs, import libraries, headers, and licences under `third_party`, -updates every SHA-256 entry in the manifest, then builds the Release MSIX. -The `love.dll` already in `third_party` includes that `.gba` filter as an -in-place patch, so a package built from the committed binaries offers it -without this rebuild. A from-source rebuild compiles the same filter in. +`.gba` and descriptor formats to the ROM file picker and a `.g1rcart` cart +picker), builds the x64 UWP Release libraries, stages the required DLLs, +import libraries, headers, and licences under `third_party`, updates every +SHA-256 entry in the manifest, then builds the Release MSIX. The `love.dll` +already in `third_party` is built with that patch, so CI and release packages +use the committed binaries without this rebuild. The generated source checkouts are ignored by Git. A fresh ANGLE sync is about 10 GB, so allow at least 20 GB of free disk space for all sources and build diff --git a/ports/uwp/third_party/love/README.md b/ports/uwp/third_party/love/README.md index 6ecffe14..e2fdf50a 100644 --- a/ports/uwp/third_party/love/README.md +++ b/ports/uwp/third_party/love/README.md @@ -6,4 +6,4 @@ The build uses LÖVE 11.5, LuaJIT, SDL2, and ANGLE. Keep the DLLs and import lib The normal package build consumes these files directly. Rebuilding the backend is a separate dependency maintenance task. -The ROM picker in commit `3f51bf0` offers `.gb` and `.gbc` only. `scripts/xbox-uwp/rebuild_dependencies.ps1` applies `patches/gba-file-picker.patch` to add the default `.gba` filter and an optional comma-separated extension argument: `love.system.pickFile("rom", "nds")`. Importer callers pass their descriptor's `source.formats`; mod and save picker kinds retain their existing filters. The checked-in `love.dll` predates this source patch and must be rebuilt to support descriptor filters; older bridges ignore the second argument. Apply `patches/uwp-cart-file-picker.patch` after that patch so `pickFile("cart")` offers `.g1rcart` and stages `picked_cart.g1rcart`. A DLL built before the cart patch refuses the cart kind; the launcher then falls back to the save-folder hint. +The ROM picker in commit `3f51bf0` offers `.gb` and `.gbc` only. `scripts/xbox-uwp/rebuild_dependencies.ps1` applies `patches/gba-file-picker.patch` to add the default `.gba` filter and an optional comma-separated extension argument: `love.system.pickFile("rom", "nds")`. Importer callers pass their descriptor's `source.formats`; mod and save picker kinds retain their existing filters. The same patch adds a `cart` kind so `pickFile("cart")` offers `.g1rcart` and stages `picked_cart.g1rcart`. The checked-in `love.dll` is built with this patch. Older bridges ignore the second argument and refuse the cart kind; the launcher then falls back to the save-folder hint. diff --git a/ports/uwp/third_party/love/bin/love.dll b/ports/uwp/third_party/love/bin/love.dll index da61379d..eec1f16f 100644 Binary files a/ports/uwp/third_party/love/bin/love.dll and b/ports/uwp/third_party/love/bin/love.dll differ diff --git a/ports/uwp/third_party/love/bin/lua51.dll b/ports/uwp/third_party/love/bin/lua51.dll index 6ee38a88..88650eee 100644 Binary files a/ports/uwp/third_party/love/bin/lua51.dll and b/ports/uwp/third_party/love/bin/lua51.dll differ diff --git a/ports/uwp/third_party/love/lib/liblove.lib b/ports/uwp/third_party/love/lib/liblove.lib index ff75a98d..e0debcd1 100644 Binary files a/ports/uwp/third_party/love/lib/liblove.lib and b/ports/uwp/third_party/love/lib/liblove.lib differ diff --git a/ports/uwp/third_party/love/lib/lovestatic.lib b/ports/uwp/third_party/love/lib/lovestatic.lib index 31fbc9cb..336f1bf7 100644 Binary files a/ports/uwp/third_party/love/lib/lovestatic.lib and b/ports/uwp/third_party/love/lib/lovestatic.lib differ diff --git a/ports/uwp/third_party/love/lib/lua51.lib b/ports/uwp/third_party/love/lib/lua51.lib index 1ad14ea0..e02a53b8 100644 Binary files a/ports/uwp/third_party/love/lib/lua51.lib and b/ports/uwp/third_party/love/lib/lua51.lib differ diff --git a/ports/uwp/third_party/love/patches/gba-file-picker.patch b/ports/uwp/third_party/love/patches/gba-file-picker.patch index 7216bd69..52b244cb 100644 --- a/ports/uwp/third_party/love/patches/gba-file-picker.patch +++ b/ports/uwp/third_party/love/patches/gba-file-picker.patch @@ -28,20 +28,29 @@ diff --git a/src/modules/system/uwp/FilePicker.cpp b/src/modules/system/uwp/File +} + +void openPicker(const std::string &kind, const std::vector &extensions) -@@ -65,2 +88,2 @@ +@@ -62,0 +86,5 @@ ++ else if (kind == "cart") ++ { ++ filters.Append(L".g1rcart"); ++ destination = "picked_cart.g1rcart"; ++ } +@@ -65,2 +93,2 @@ - filters.Append(L".gb"); - filters.Append(L".gbc"); + for (const auto &extension : extensions) + filters.Append(winrt::to_hstring(extension)); -@@ -131 +154 @@ +@@ -131 +159 @@ -bool pickFile(const char *kind) +bool pickFile(const char *kind, const char *formats) -@@ -134,0 +158,4 @@ +@@ -134 +162,6 @@ +- if (requestedKind != "rom" && requestedKind != "mod" && requestedKind != "sav") ++ if (requestedKind != "rom" && requestedKind != "mod" && requestedKind != "sav" ++ && requestedKind != "cart") + return false; + + std::vector extensions; + if (requestedKind == "rom" && !parseRomFormats(formats, extensions)) -@@ -151 +178 @@ +@@ -151 +184 @@ - [requestedKind]() { openPicker(requestedKind); }); + [requestedKind, extensions]() { openPicker(requestedKind, extensions); }); diff --git a/src/modules/system/uwp/FilePicker.h b/src/modules/system/uwp/FilePicker.h diff --git a/ports/uwp/third_party/love/patches/uwp-cart-file-picker.patch b/ports/uwp/third_party/love/patches/uwp-cart-file-picker.patch deleted file mode 100644 index cc92cde9..00000000 --- a/ports/uwp/third_party/love/patches/uwp-cart-file-picker.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/src/modules/system/uwp/FilePicker.cpp b/src/modules/system/uwp/FilePicker.cpp ---- a/src/modules/system/uwp/FilePicker.cpp -+++ b/src/modules/system/uwp/FilePicker.cpp -@@ -84,0 +85,5 @@ -+ } -+ else if (kind == "cart") -+ { -+ filters.Append(L".g1rcart"); -+ destination = "picked_cart.g1rcart"; -@@ -157 +162,2 @@ -- if (requestedKind != "rom" && requestedKind != "mod" && requestedKind != "sav") -+ if (requestedKind != "rom" && requestedKind != "mod" && requestedKind != "sav" -+ && requestedKind != "cart") diff --git a/ports/uwp/third_party/manifest.json b/ports/uwp/third_party/manifest.json index 0e9ceaa2..74c9e0f2 100644 --- a/ports/uwp/third_party/manifest.json +++ b/ports/uwp/third_party/manifest.json @@ -100,23 +100,23 @@ }, { "path": "love/bin/love.dll", - "sha256": "A530CE429431AB96E72904847E82CEA99D03A7BC34B4D32A6548D10F4D45097E" + "sha256": "05B4B5BA7192F1E35BEA871FF5E8F9DC3BFE3E1BB604BB895DA13AB7E9249921" }, { "path": "love/bin/lua51.dll", - "sha256": "08380FB9A7C8A8A85D3425C1FD6F1CB826D980FF31925453E353227E9A23BC70" + "sha256": "9C7E9FB49615D14585B9A84C1E7ACF751DBCCACB8F1DC20505C4CED45C54B9E9" }, { "path": "love/lib/liblove.lib", - "sha256": "C93A358D5EAE8BE3D74DDFDFA767657E96E95E0151F843FEB4E587CF2D89320A" + "sha256": "CE4E8B7AD7A58AFEF97015AC5AC8ADC889667F4ACEDEE3AE5FD89BD097858685" }, { "path": "love/lib/lovestatic.lib", - "sha256": "3794690ED3F44DB6F0C83BBC1673979922627929E852E7668C9911DE1F72B972" + "sha256": "70FEA9DA7E838CABF692D6B8E6C292893CBE52418C5ACC37F1E3B80DF3C51F59" }, { "path": "love/lib/lua51.lib", - "sha256": "A4F4F0942A432B88A3541A185B3D3D5B4D58413B3CEEE10A2E48CAF9D8439759" + "sha256": "438C357E913CF641D67E66DB9A4C4E8D5E7DD2BD84E4F8D4C69A0545A3C2602D" }, { "path": "runtime/bin/brotlicommon.dll", diff --git a/tests/engine/platform_icon_and_uwp_picker_test.lua b/tests/engine/platform_icon_and_uwp_picker_test.lua index 2875651a..436203bc 100644 --- a/tests/engine/platform_icon_and_uwp_picker_test.lua +++ b/tests/engine/platform_icon_and_uwp_picker_test.lua @@ -43,17 +43,8 @@ check(rebuild:find("$metadata.sources.love.patch", 1, true) and rebuild:find("git apply --unidiff-zero $lovePatch", 1, true), "UWP dependency rebuild applies the picker patch") -local function utf16z(text) - local out = {} - for i = 1, #text do - out[#out + 1] = text:sub(i, i) .. "\0" - end - return table.concat(out) .. "\0\0" -end - local dll = read("ports/uwp/third_party/love/bin/love.dll") -check(dll:find(utf16z(".gb"), 1, true) and dll:find(utf16z(".gbc"), 1, true) - and dll:find(utf16z(".gba"), 1, true), +check(dll:find("gb,gbc,gba", 1, true), "shipped UWP love.dll offers .gb, .gbc, and .gba") print("platform_icon_and_uwp_picker_test: ok") diff --git a/tests/engine/uwp_picker_build_test.lua b/tests/engine/uwp_picker_build_test.lua index 33b1e0a7..3a98f39a 100644 --- a/tests/engine/uwp_picker_build_test.lua +++ b/tests/engine/uwp_picker_build_test.lua @@ -6,13 +6,12 @@ local function read(path) f:close() return s end -for _, path in ipairs({ ".github/workflows/ci.yml", ".github/workflows/release.yml" }) do - local workflow = read(path) - local rebuild = workflow:find("run: ./scripts/xbox-uwp/rebuild_dependencies.ps1 -SkipAngle -SkipPackage", 1, true) - local package = workflow:find("- name: Build Xbox UWP package", 1, true) - S.check(rebuild and package and rebuild < package, - path .. " rebuilds the native picker before packaging") -end +local dll = read("ports/uwp/third_party/love/bin/love.dll") +S.check(dll:find("gb,gbc,gba", 1, true) ~= nil, + "shipped love.dll is built with the descriptor-format picker patch") +S.check(dll:find((".g1rcart"):gsub(".", "%0\0"), 1, true) ~= nil + and dll:find("picked_cart.g1rcart", 1, true) ~= nil, + "shipped love.dll offers the .g1rcart cart picker") local manifest = require("src.link.Json").decode(read("ports/uwp/third_party/manifest.json")) local patch = read("ports/uwp/third_party/" .. manifest.sources.love.patch) S.check(patch:find('luaL_optstring(L, 2, nullptr)', 1, true) ~= nil,