tooling: extract GDK MSBuild platform profiles #3288

Manually merged
github merged 3 commits from github-bot/gh-3286 into gh-pr/3286/base 2026-11-28 06:02:33 +00:00 AGit
Owner

@⁠lambirou on GitHub · 2026-11-28 05:19 UTC · original
lambirou:gdk/platform-profiles → main · +507 −0 · 4 files · 3 commits · merged 2026-11-28 06:01 UTC

The GDK knowledge plan needs the exact MSBuild defines, include roots, libraries and flags per platform so fixtures can compile like a title without guessing. This adds an extractor and keeps the installation and the JSON profiles outside the repository.

tools/gdk_platform_profiles.py selects the VS2022/flatDeployment/v170 platform directory, reads Platform.default.props, Platform.Common.props, Platform.Edition.default.props, Platform.Edition.props, Platform.Edition.targets, Platform.Commandline.targets, Platform.props, Platform.targets and the toolset props, and writes a deterministic JSON profile. It keeps MSBuild conditions, joins incremental PreprocessorDefinitions entries, resolves simple variables, and leaves installation variables such as DurangoXdkInstallPath, DurangoGRDKInstallPath and XdkEdition visible instead of guessing them.

Measured from the 261000 payload:

  • Gaming.Desktop.x64 (GRDK): 10 sources, 2 defines, 1 include root, 1 library root, 6 dependencies.
  • Gaming.Xbox.Scarlett.x64: 10 sources, 7 defines, 3 include roots, 3 library roots, 1 direct dependency.
  • Gaming.Xbox.XboxOne.x64: the same shape as Scarlett.
  • Gaming.Desktop.arm64 is not present in this payload.

Console profiles define _GAMING_XBOX, the Scarlett or XboxOne macro, WIN32_LEAN_AND_MEAN and WINAPI_FAMILY=WINAPI_FAMILY_GAMES, plus the ATL/WRL strict-COM macros. The desktop profile defines _GAMING_DESKTOP and WINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP. The console dependency list in Console_Libs is pixevt.lib, d3d12_xs.lib, gameinput.lib, xgameplatform.lib, xgameruntime.lib, xmem.lib and xg_xs.lib.

Commands:

python -B tests/gdk_platform_profiles_check.py
python -B tools/gdk_platform_profiles.py list --root D:\gdk-ref\261000\gxdk\Microsoft GDK\261000\GXDK
python -B tools/gdk_platform_profiles.py scan --root D:\gdk-ref\261000\gxdk\Microsoft GDK\261000\GXDK --platform Gaming.Xbox.Scarlett.x64 --json out\scarlett.json

The check passed on Windows and runs on Linux without the GDK. The real profiles were written to D:\gdk-oracle\knowledge\platform.

A profile is a build recipe, not a runtime fact. The unresolved installation variables are kept because their values differ per host.

**@⁠lambirou** on GitHub · 2026-11-28 05:19 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3286) `lambirou:gdk/platform-profiles` → `main` · +507 −0 · 4 files · 3 commits · merged 2026-11-28 06:01 UTC The GDK knowledge plan needs the exact MSBuild defines, include roots, libraries and flags per platform so fixtures can compile like a title without guessing. This adds an extractor and keeps the installation and the JSON profiles outside the repository. tools/gdk_platform_profiles.py selects the VS2022/flatDeployment/v170 platform directory, reads Platform.default.props, Platform.Common.props, Platform.Edition.default.props, Platform.Edition.props, Platform.Edition.targets, Platform.Commandline.targets, Platform.props, Platform.targets and the toolset props, and writes a deterministic JSON profile. It keeps MSBuild conditions, joins incremental PreprocessorDefinitions entries, resolves simple variables, and leaves installation variables such as DurangoXdkInstallPath, DurangoGRDKInstallPath and XdkEdition visible instead of guessing them. Measured from the 261000 payload: - Gaming.Desktop.x64 (GRDK): 10 sources, 2 defines, 1 include root, 1 library root, 6 dependencies. - Gaming.Xbox.Scarlett.x64: 10 sources, 7 defines, 3 include roots, 3 library roots, 1 direct dependency. - Gaming.Xbox.XboxOne.x64: the same shape as Scarlett. - Gaming.Desktop.arm64 is not present in this payload. Console profiles define _GAMING_XBOX, the Scarlett or XboxOne macro, WIN32_LEAN_AND_MEAN and WINAPI_FAMILY=WINAPI_FAMILY_GAMES, plus the ATL/WRL strict-COM macros. The desktop profile defines _GAMING_DESKTOP and WINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP. The console dependency list in Console_Libs is pixevt.lib, d3d12_xs.lib, gameinput.lib, xgameplatform.lib, xgameruntime.lib, xmem.lib and xg_xs.lib. Commands: python -B tests/gdk_platform_profiles_check.py python -B tools/gdk_platform_profiles.py list --root D:\gdk-ref\261000\gxdk\Microsoft GDK\261000\GXDK python -B tools/gdk_platform_profiles.py scan --root D:\gdk-ref\261000\gxdk\Microsoft GDK\261000\GXDK --platform Gaming.Xbox.Scarlett.x64 --json out\scarlett.json The check passed on Windows and runs on Linux without the GDK. The real profiles were written to D:\gdk-oracle\knowledge\platform. A profile is a build recipe, not a runtime fact. The unresolved installation variables are kept because their values differ per host.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 05:21:06 +00:00
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-28 05:43 UTC · original · requested changes

The checked-in synthetic profile fixture passes on f74ee3fe. A separate two-version synthetic tree exposes a mismatch: scan --sdk 999999 reports sdk: "999999" but reads 261000/Platform.Common.props and emits PROFILE_261000, although a 999999/Platform.Common.props with PROFILE_999999 exists. The edition and command-line paths use the same hardcoded version. Please use the selected SDK for these versioned paths, or reject an unsupported SDK before producing output. A fixture with two sibling version directories should verify the reported SDK, file provenance and extracted value agree.

**@⁠R0Y00** on GitHub · 2026-11-28 05:43 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3286#pullrequestreview-6096114828) · **requested changes** The checked-in synthetic profile fixture passes on `f74ee3fe`. A separate two-version synthetic tree exposes a mismatch: `scan --sdk 999999` reports `sdk: "999999"` but reads `261000/Platform.Common.props` and emits `PROFILE_261000`, although a `999999/Platform.Common.props` with `PROFILE_999999` exists. The edition and command-line paths use the same hardcoded version. Please use the selected SDK for these versioned paths, or reject an unsupported SDK before producing output. A fixture with two sibling version directories should verify the reported SDK, file provenance and extracted value agree.
github-bot changed target branch from main to gh-pr/3286/base 2026-11-28 06:02:32 +00:00
github manually merged commit 354b32ffc4 into gh-pr/3286/base 2026-11-28 06:02:33 +00:00
Author
Owner

@⁠lambirou on GitHub · 2026-11-28 05:57 UTC · original

Corrigé sur la branche (commit 354b32ff). Les chemins versionnés utilisent maintenant --sdk : Platform.Common.props, Platform.Edition.* et Platform.Commandline.targets sont lus sous <platform>/<sdk>/, et un SDK sans répertoire correspondant est rejeté avant l'écriture du JSON.

Le test synthétique crée deux répertoires frères, 261000 et 999999 :

  • scan --sdk 999999 rapporte sdk: "999999", lit 999999/Platform.Common.props et extrait PROFILE_999999, sans aucune provenance 261000 ;
  • scan --sdk 888888 retourne 2 et n'écrit pas de sortie.

python -B tests/gdk_platform_profiles_check.py passe. Les trois profils réels 261000 ont été régénérés sans changement.

**@⁠lambirou** on GitHub · 2026-11-28 05:57 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3286#issuecomment-7234991601) Corrigé sur la branche (commit 354b32ff). Les chemins versionnés utilisent maintenant `--sdk` : `Platform.Common.props`, `Platform.Edition.*` et `Platform.Commandline.targets` sont lus sous `<platform>/<sdk>/`, et un SDK sans répertoire correspondant est rejeté avant l'écriture du JSON. Le test synthétique crée deux répertoires frères, `261000` et `999999` : - `scan --sdk 999999` rapporte `sdk: "999999"`, lit `999999/Platform.Common.props` et extrait `PROFILE_999999`, sans aucune provenance `261000` ; - `scan --sdk 888888` retourne 2 et n'écrit pas de sortie. `python -B tests/gdk_platform_profiles_check.py` passe. Les trois profils réels 261000 ont été régénérés sans changement.
Author
Owner

@⁠lambirou on GitHub · 2026-11-28 06:00 UTC · original

CI verte sur la tête 354b32ff : Windows, Linux et gfx1013 passent. Le test à deux répertoires de version vérifie le SDK rapporté, la provenance des fichiers et la valeur extraite ; le SDK inconnu est rejeté avant écriture. Prêt pour la re-revue.

**@⁠lambirou** on GitHub · 2026-11-28 06:00 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3286#issuecomment-7235020895) CI verte sur la tête 354b32ff : Windows, Linux et gfx1013 passent. Le test à deux répertoires de version vérifie le SDK rapporté, la provenance des fichiers et la valeur extraite ; le SDK inconnu est rejeté avant écriture. Prêt pour la re-revue.
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-28 06:01 UTC · original · approved these changes

Re-reviewed 354b32ff. The checked-in synthetic test passes on Windows. My separate two-version tree now reports SDK 999999, reads its own Platform.Common.props, and emits PROFILE_999999; the old 261000 inputs are absent from the source list. The suite also checks that a missing SDK returns 2 without writing a profile. The requested change is resolved.

**@⁠R0Y00** on GitHub · 2026-11-28 06:01 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3286#pullrequestreview-6096188184) · **approved these changes** Re-reviewed `354b32ff`. The checked-in synthetic test passes on Windows. My separate two-version tree now reports SDK `999999`, reads its own `Platform.Common.props`, and emits `PROFILE_999999`; the old `261000` inputs are absent from the source list. The suite also checks that a missing SDK returns 2 without writing a profile. The requested change is resolved.
This discussion has been locked. Commenting is limited to contributors.
No description provided.