From 9dfbef00f564e63249fe5606e292fd2b25e353db Mon Sep 17 00:00:00 2001 From: patchzyy <64382339+patchzyy@users.noreply.github.com> Date: Wed, 21 Oct 2026 16:17:42 +0200 Subject: [PATCH] hash inc files and require project for shards --- .../WiiCompiled.Setup.Windows/ToolkitFingerprint.cs | 6 +++--- translator/src/Translator.Cli/Program.cs | 10 ++++++++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Launcher/WiiCompiled.Setup.Windows/ToolkitFingerprint.cs b/Launcher/WiiCompiled.Setup.Windows/ToolkitFingerprint.cs index 7735291..16aa770 100644 --- a/Launcher/WiiCompiled.Setup.Windows/ToolkitFingerprint.cs +++ b/Launcher/WiiCompiled.Setup.Windows/ToolkitFingerprint.cs @@ -16,15 +16,15 @@ internal static class ToolkitFingerprint // v6/native-toolchain v2 forces one clean rebuild past a Ninja stale-object bug. // translation v2 added runtime/src, which the translator regex-scans for native overrides; // v3 replaced it with the native index extracted from it, whenever that index is current. - private const string Version = "mkwc-toolkit-compile-v6"; - private const string TranslationVersion = "mkwc-toolkit-translation-v3"; + private const string Version = "mkwc-toolkit-compile-v7"; + private const string TranslationVersion = "mkwc-toolkit-translation-v4"; private const string NativeToolchainVersion = "mkwc-toolkit-native-toolchain-v2"; private const string PackageVersion = "mkwc-toolkit-package-v1"; private const string RuntimeAssetsVersion = "mkwc-product-runtime-assets-v3"; private const string RuntimeAssetsDescription = "The product runtime assets"; private static readonly string[] SourceExtensions = - [".c", ".cc", ".cpp", ".cxx", ".h", ".hh", ".hpp", ".inl", ".s", ".asm", + [".c", ".cc", ".cpp", ".cxx", ".h", ".hh", ".hpp", ".inl", ".inc", ".s", ".asm", ".cmake", ".txt", ".yml", ".yaml", ".toml", ".json", ".ps1", ".in", ".def", ".patch"]; /// diff --git a/translator/src/Translator.Cli/Program.cs b/translator/src/Translator.Cli/Program.cs index df7f966..793e7e7 100644 --- a/translator/src/Translator.Cli/Program.cs +++ b/translator/src/Translator.Cli/Program.cs @@ -221,7 +221,7 @@ int RunCheckBaseModAwareness(string[] argsTail) RuntimeNativeIndex ResolveRegionalNativeIndex(string nativeSourceDirectory, string? indexPath) { var index = RuntimeNativeIndexBuilder.Resolve(nativeSourceDirectory, indexPath, Console.Error); - var region = GuestRegions.FromGameId(project?.Identity.GameId); + var region = GuestRegions.FromGameId(RequireProject().Identity.GameId); var tablePath = GuestAddressTable.DefaultPath(nativeSourceDirectory); // A runtime without a table can only be built for PAL. if (region == GuestRegion.Pal && !File.Exists(tablePath)) @@ -231,6 +231,12 @@ RuntimeNativeIndex ResolveRegionalNativeIndex(string nativeSourceDirectory, stri int RunEmitBuildShards(string[] argsTail) { + // The project decides the guest region the shards are built for. + if (project is null) + { + Console.Error.WriteLine("emit-build-shards requires --project ."); + return 1; + } var baseMetadata = OptionValue(argsTail, "--base-metadata") ?? Path.Combine(root, "generated", "base_translation_output.json"); var baseFunctions = OptionValue(argsTail, "--base-functions-dir") ?? Path.Combine(root, "generated", "functions"); var output = OptionValue(argsTail, "--out") ?? Path.Combine(root, "generated", "build_shards"); @@ -258,7 +264,7 @@ int RunEmitBuildShards(string[] argsTail) string.IsNullOrWhiteSpace(resolvedProfile) ? null : Path.GetFullPath(resolvedProfile), string.IsNullOrWhiteSpace(retroCpp) ? null : Path.GetFullPath(retroCpp), NativeIndex: nativeIndex, - Region: GuestRegions.FromGameId(project?.Identity.GameId))); + Region: GuestRegions.FromGameId(project.Identity.GameId))); Console.WriteLine("[translator] emitted stable translated build graph"); Console.WriteLine($" base functions: {result.BaseFunctionCount:N0}"); Console.WriteLine($" shared base functions: {result.SharedBaseFunctionCount:N0}");