Build/Build kJams script: Difference between revisions

From kJams Wiki
Jump to navigation Jump to search
restore CFBundleIdentifier uniqueness from 2013 recipe; Python creator
replace WinAppHelper .app stubs with prlexec .command launchers
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
The coordinator ('''taurus''', a Mac VM on '''sugarbear''') cannot SSH into a Windows guest and land in the current GUI login session. Parallels "Windows Apps" (WinAppHelper stubs) are Mac <code>.app</code> bundles that, when '''opened on the hardware host''', launch a <code>.bat</code> inside that host's Windows guest session.
The coordinator ('''taurus''', a Mac VM on '''sugarbear''') cannot SSH into a Windows guest and land in the current GUI login session. On the Parallels '''hardware host''', <code>prlexec</code> runs a <code>.bat</code> inside that host's Windows guest desktop session (a visible cmd window).


Create each stub '''on the hardware that owns the VM''' (bobina for luna-pc, sugarbear for taurus-pc). Do not create them on pandora. The VM UUID is baked into <code>AppParams.pva</code>; a stub made on the wrong Mac will not talk to the build guest.
Mac wrappers are plain <code>.command</code> scripts in Perforce. They call <code>prlexec_win_gui.sh</code>. Do not copy Command Prompt.app or edit <code>AppParams.pva</code>.


Store finished stubs here (this is what Python opens):
Store the launchers here (this is what Python <code>open</code>s):


<pre>xplat/proj/win/_scripts/</pre>
<pre>xplat/proj/win/_scripts/</pre>
<code>prlexec</code> is part of Parallels Desktop Pro/Business (<code>/usr/local/bin/prlexec</code> on bobina and sugarbear).


== Machine map ==
== Machine map ==
Line 28: Line 30:
| 32-bit Windows guest
| 32-bit Windows guest
| '''luna-pc'''
| '''luna-pc'''
| Windows 10 VM on bobina. Reached only by opening a WinAppHelper '''on bobina'''.
| Windows 10 VM on bobina. Reached only by running <code>prlexec</code> '''on bobina'''.
|-
|-
| 64-bit hardware
| 64-bit hardware
Line 43: Line 45:
|}
|}


== Apps Python opens ==
== Scripts Python opens ==


Names are the '''Windows guest''' that runs the work. Python builds them in <code>xplat.get_win_build_apphelper_name()</code> / <code>get_win_codesign_apphelper_name()</code>.
Names are the '''Windows guest''' that runs the work. Python builds them in <code>xplat.get_win_build_prlexec_name()</code> / <code>get_win_codesign_prlexec_name()</code>.


{| class="wikitable"
{| class="wikitable"
! Bundle name (exact)
! Launcher (exact)
! Create / <code>open</code> on
! Create / <code>open</code> on
! Target VM
! Target VM
! <code>App Path</code>
! Windows bat
|-
|-
| <code>Build kJams luna-pc.app</code>
| <code>Build kJams luna-pc.command</code>
| bobina
| bobina
| luna-pc
| luna-pc
| <code>Z:\depot\kJams\Development\xplat\proj\win\_scripts\build.bat</code>
| <code>Z:\depot\kJams\Development\xplat\proj\win\_scripts\build.bat</code>
|-
|-
| <code>Build kJams taurus-pc.app</code>
| <code>Build kJams taurus-pc.command</code>
| sugarbear
| sugarbear
| taurus-pc
| taurus-pc
| <code>Z:\depot\kJams\Development\xplat\proj\win\_scripts\build.bat</code>
| <code>Z:\depot\kJams\Development\xplat\proj\win\_scripts\build.bat</code>
|-
|-
| <code>code sign taurus-pc.app</code>
| <code>code sign taurus-pc.command</code>
| sugarbear
| sugarbear
| taurus-pc
| taurus-pc
| <code>Z:\depot\kJams\Development\xplat\proj\win\_scripts\code_sign_app_taurus.bat</code>
| <code>Z:\depot\kJams\Development\xplat\proj\win\_scripts\code_sign_app_taurus.bat</code>
|-
|-
| <code>code sign paths taurus-pc.app</code>
| <code>code sign paths taurus-pc.command</code>
| sugarbear
| sugarbear
| taurus-pc
| taurus-pc
| <code>Z:\depot\kJams\Development\xplat\proj\win\_scripts\code_sign_paths_taurus.bat</code>
| <code>Z:\depot\kJams\Development\xplat\proj\win\_scripts\code_sign_paths_taurus.bat</code>
|}
|}
Shared engine: <code>prlexec_win_gui.sh</code>. It runs:
<pre>prlexec --vm "&lt;guest&gt;" cmd /c start cmd /c "&lt;bat&gt;"</pre>


<code>build.bat</code> picks VS 2019 on <code>LUNA-PC</code> and VS 2022 elsewhere, then runs <code>win_build.py</code>.
<code>build.bat</code> picks VS 2019 on <code>LUNA-PC</code> and VS 2022 elsewhere, then runs <code>win_build.py</code>.


== Sugarbear (taurus-pc, scripted) ==
== Hop (what taurus actually does) ==
 
* '''Win32 build:''' taurus SSHes to '''bobina''' and <code>open</code>s <code>Build kJams luna-pc.command</code> → luna-pc runs <code>build.bat</code>.
* '''Win64 build:''' taurus SSHes to '''sugarbear''' and <code>open</code>s <code>Build kJams taurus-pc.command</code> → taurus-pc runs <code>build.bat</code>.
* '''USB code sign (from luna-pc or taurus Mac):''' SSH to '''sugarbear''' and <code>open</code> <code>code sign taurus-pc.command</code> or <code>code sign paths taurus-pc.command</code>.
* '''Mac32:''' taurus SSHes to '''luna''' and <code>open</code>s <code>publish.command</code> / <code>rogue.command</code> (no prlexec).
* '''Mac64:''' taurus spawns a local Terminal worker with <code>KJAMS_WORKER=1</code>.


The three taurus-pc stubs are created by <code>create_sugarbear_winapphelpers.py</code>, which follows this page's recipe (including the <code>CFBundleIdentifier</code> step below). sugarbear's <code>/usr/bin/python3</code> is an Xcode license stub, so run the script on '''taurus''' (it SSHes to sugarbear only to copy the live Command Prompt). The <code>.sh</code> wrapper on sugarbear hops to taurus.
Manual check from sugarbear:


<pre>
<pre>
python3 /Volumes/Developer/depot/kJams/Development/xplat/python/create_sugarbear_winapphelpers.py --dry-run
open "/Volumes/Developer/depot/kJams/Development/xplat/proj/win/_scripts/Build kJams taurus-pc.command"
python3 /Volumes/Developer/depot/kJams/Development/xplat/python/create_sugarbear_winapphelpers.py
</pre>
</pre>


That copies the live Parallels '''Command Prompt''' app for taurus-pc (Helper Version 27 as of 2026-09) and points <code>APP Path</code> at the bats in the table. Precise recipe: depot <code>xplat/python/create_sugarbear_winapphelpers.md</code>.
After a submit on pandora, always <code>p4 sync</code> '''taurus''' (and taurus-pc's <code>Z:\depot</code>). sugarbear <code>open</code>s taurus's disk.
 
taurus-pc must be running. Do not run the script on pandora or bobina. After creating the stubs, copy them into the depot <code>xplat/proj/win/_scripts/</code> tree and '''submit''' — they belong in Perforce. <code>open</code> on sugarbear uses taurus's disk (sugarbear mounts it). Always <code>p4 sync</code> '''taurus''' after a pandora submit.
 
Bobina is not scripted: Parallels there is version-locked for luna.
 
== Recipe (one stub, manual) ==
 
Do this '''on bobina''' for <code>Build kJams luna-pc.app</code> (and anywhere you are not using the sugarbear script). The Windows guest must be running and logged into the GUI session you want the build to use. This is the original 2013 sequence; later edits dropped the identifier line.
 
# On the hardware host, open the Parallels "Windows applications" folder for '''that''' guest (bobina: luna-pc Applications; sugarbear: taurus-pc Applications).
## If you cannot find it: Parallels → Configure → Options → Applications → enable "Show Windows applications folder in Dock". Dock icon → Reveal in Finder.
# Copy '''Command Prompt''' to the Desktop.
# Rename the copy to the '''exact bundle name''' from the table (without <code>.app</code> if Finder hides it), e.g. <code>Build kJams luna-pc</code>.
# Right-click → Show Package Contents.
# Edit <code>Contents/Info.plist</code>:
#* <code>CFBundleGetInfoString</code> must '''end with''' the <code>App Path</code> from the table (the <code>Z:\...\ _scripts\....bat</code> line).
#* <code>CFBundleName</code> = the exact bundle name without <code>.app</code>.
#* <code>CFBundleIdentifier</code>: insert the stub name immediately after <code>com.parallels.winapp.</code> (hyphenate spaces; a reverse-DNS id cannot contain spaces). The 2013 page said: add <code>.Build kJams</code> just after <code>.winapp</code>. Example: <code>com.parallels.winapp.b7210c99…</code> becomes <code>com.parallels.winapp.Build-kJams-luna-pc.b7210c99…</code>. '''Do not leave the live Command Prompt identifier''' — Launch Services / Parallels will reuse that helper and ignore this stub's <code>APP Path</code>. Also set the identifier in <code>English.lproj/InfoPlist.strings</code> if that file has one.
# Edit <code>Contents/Resources/English.lproj/InfoPlist.strings</code>: set both <code>CFBundleName</code> and <code>CFBundleDisplayName</code> to that same name.
# Edit <code>Contents/Resources/AppParams.pva</code>: set <code>APP Path</code> (or <code>App Path</code>) to the same <code>Z:\...</code> bat path. Confirm <code>VM Name</code> is luna-pc or taurus-pc as appropriate.
# Move the finished <code>.app</code> into <code>/Volumes/Developer/depot/kJams/Development/xplat/proj/win/_scripts/</code> (same path on the host via the Developer share).
# You only need the manual copy once on bobina (<code>Build kJams luna-pc.app</code>). sugarbear's three stubs come from the Python script above.
 
== Hop (what taurus actually does) ==
 
* '''Win32 build:''' taurus SSHes to '''bobina''' and <code>open</code>s <code>Build kJams luna-pc.app</code> → luna-pc runs <code>build.bat</code>.
* '''Win64 build:''' taurus SSHes to '''sugarbear''' and <code>open</code>s <code>Build kJams taurus-pc.app</code> → taurus-pc runs <code>build.bat</code>.
* '''USB code sign (from luna-pc or taurus Mac):''' SSH to '''sugarbear''' and <code>open</code> <code>code sign taurus-pc.app</code> or <code>code sign paths taurus-pc.app</code>.
* '''Mac32:''' taurus SSHes to '''luna''' and <code>open</code>s <code>publish.command</code> / <code>rogue.command</code> (no WinAppHelper).
* '''Mac64:''' taurus spawns a local Terminal worker with <code>KJAMS_WORKER=1</code>.


== See also ==
== See also ==


* Depot docs: <code>Development/documentation/01_Infrastructure_Overview.md</code>
* Depot docs: <code>Development/documentation/01_Infrastructure_Overview.md</code>
* <code>Development/xplat/python/create_sugarbear_winapphelpers.py</code>
* <code>Development/xplat/proj/win/_scripts/README.md</code>
* <code>Development/xplat/python/create_sugarbear_winapphelpers.md</code>
* <code>CF/python/xplat.py</code> — <code>guest_to_host()</code>, <code>get_win_build_prlexec_name()</code>
* <code>CF/python/xplat.py</code> — <code>guest_to_host()</code>, <code>get_win_build_apphelper_name()</code>

Latest revision as of 00:22, 8 September 2026

The coordinator (taurus, a Mac VM on sugarbear) cannot SSH into a Windows guest and land in the current GUI login session. On the Parallels hardware host, prlexec runs a .bat inside that host's Windows guest desktop session (a visible cmd window).

Mac wrappers are plain .command scripts in Perforce. They call prlexec_win_gui.sh. Do not copy Command Prompt.app or edit AppParams.pva.

Store the launchers here (this is what Python opens):

xplat/proj/win/_scripts/

prlexec is part of Parallels Desktop Pro/Business (/usr/local/bin/prlexec on bobina and sugarbear).

Machine map

Role Name What it is
Dev workstation pandora Dave's personal Mac. Not a release-build host. Qt Creator / MCP only.
32-bit hardware bobina Intel Mac. Hosts luna + luna-pc. Perpetual only.
32-bit Mac guest luna Mojave VM on bobina. Coordinator SSHes here directly (open publish.command).
32-bit Windows guest luna-pc Windows 10 VM on bobina. Reached only by running prlexec on bobina.
64-bit hardware sugarbear ARM Mac. Hosts taurus + taurus-pc. Perpetual + subscription. USB code-sign token lives on taurus-pc.
Coordinator / 64-bit Mac guest taurus Mac VM on sugarbear. is_initiator() is hardcoded to this host. Launches luna, luna-pc, taurus-pc, and a local Mac worker.
64-bit Windows guest taurus-pc Windows VM on sugarbear. Win64 compile + USB signing for both 32- and 64-bit.

Scripts Python opens

Names are the Windows guest that runs the work. Python builds them in xplat.get_win_build_prlexec_name() / get_win_codesign_prlexec_name().

Launcher (exact) Create / open on Target VM Windows bat
Build kJams luna-pc.command bobina luna-pc Z:\depot\kJams\Development\xplat\proj\win\_scripts\build.bat
Build kJams taurus-pc.command sugarbear taurus-pc Z:\depot\kJams\Development\xplat\proj\win\_scripts\build.bat
code sign taurus-pc.command sugarbear taurus-pc Z:\depot\kJams\Development\xplat\proj\win\_scripts\code_sign_app_taurus.bat
code sign paths taurus-pc.command sugarbear taurus-pc Z:\depot\kJams\Development\xplat\proj\win\_scripts\code_sign_paths_taurus.bat

Shared engine: prlexec_win_gui.sh. It runs:

prlexec --vm "<guest>" cmd /c start cmd /c "<bat>"

build.bat picks VS 2019 on LUNA-PC and VS 2022 elsewhere, then runs win_build.py.

Hop (what taurus actually does)

  • Win32 build: taurus SSHes to bobina and opens Build kJams luna-pc.command → luna-pc runs build.bat.
  • Win64 build: taurus SSHes to sugarbear and opens Build kJams taurus-pc.command → taurus-pc runs build.bat.
  • USB code sign (from luna-pc or taurus Mac): SSH to sugarbear and open code sign taurus-pc.command or code sign paths taurus-pc.command.
  • Mac32: taurus SSHes to luna and opens publish.command / rogue.command (no prlexec).
  • Mac64: taurus spawns a local Terminal worker with KJAMS_WORKER=1.

Manual check from sugarbear:

open "/Volumes/Developer/depot/kJams/Development/xplat/proj/win/_scripts/Build kJams taurus-pc.command"

After a submit on pandora, always p4 sync taurus (and taurus-pc's Z:\depot). sugarbear opens taurus's disk.

See also

  • Depot docs: Development/documentation/01_Infrastructure_Overview.md
  • Development/xplat/proj/win/_scripts/README.md
  • CF/python/xplat.pyguest_to_host(), get_win_build_prlexec_name()