Skip to content

Commit 8a3b644

Browse files
kotlarmilosCopilot
andcommitted
iOS inner loop: sort mlaunch by pack version dir; split msbuildargs on space and semicolon
- _resolve_mlaunch now sorts on the pack <version> directory (parent of tools/) rather than the pack-name suffix, so 26.10 ranks above 26.2. - The inner-loop proj builds _MSBuildArgs with a mix of ';' and space separators; splitting --msbuild-args on ';' alone left embedded spaces inside arguments and broke 'dotnet build'. Split on both. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 11f5aae commit 8a3b644

2 files changed

Lines changed: 10 additions & 8 deletions

File tree

src/scenarios/shared/ioshelper.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ def __init__(self):
7676

7777
@staticmethod
7878
def _resolve_mlaunch():
79-
"""Resolve the mlaunch binary from the iOS SDK pack.
79+
"""Resolve the mlaunch binary from the newest installed Microsoft.iOS.Sdk pack.
8080
81-
Searches $DOTNET_ROOT/packs/Microsoft.iOS.Sdk.*/tools/bin/mlaunch,
82-
falling back to ~/.dotnet if DOTNET_ROOT is unset. Caches the result.
81+
Sorts candidates by the pack *version* directory (parent of `tools/`),
82+
not by the pack name, so e.g. 26.10 ranks above 26.2.
8383
"""
8484
if iOSHelper._mlaunch_path is not None:
8585
return iOSHelper._mlaunch_path
@@ -94,10 +94,9 @@ def _resolve_mlaunch():
9494
)
9595

9696
def _version_key(p: str):
97-
m = re.search(r'Microsoft\.iOS\.Sdk\.([^/\\]+)', p)
98-
if not m:
99-
return ()
100-
parts = re.split(r'[.\-+]', m.group(1))
97+
# Path is .../packs/<pack>/<version>/tools/bin/mlaunch — sort on <version>.
98+
version_dir = os.path.basename(os.path.dirname(os.path.dirname(os.path.dirname(p))))
99+
parts = re.split(r'[.\-+]', version_dir)
101100
key = []
102101
for part in parts:
103102
key.append((0, int(part)) if part.isdigit() else (1, part))

src/scenarios/shared/runner.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1141,7 +1141,10 @@ def run(self):
11411141
if self.framework:
11421142
base_cmd.extend(['-f', self.framework])
11431143
if self.msbuildargs:
1144-
base_cmd.extend([arg for arg in self.msbuildargs.split(';') if arg])
1144+
# _MSBuildArgs in the proj uses both ';' and ' ' as separators.
1145+
for arg in re.split(r'[;\s]+', self.msbuildargs):
1146+
if arg.strip():
1147+
base_cmd.append(arg.strip())
11451148

11461149
project_dir = os.path.dirname(os.path.abspath(self.csprojpath))
11471150
exename = self.traits.exename

0 commit comments

Comments
 (0)