Skip to content

ios build/package/upload resolve a relative --project against the current directory instead of --workspace, so bundle, Info.plist and .ipa lookups fail #193

Description

@matt-edmondson

What's wrong

The ios subcommands pass --project through as given (KtsuBuild.Tool/Program.cs, handlers around lines 500–740). dotnet runs with workingDirectory = workspace, so the build and publish themselves find the project. KtsuBuild's own file lookups, however, resolve the path against the process CWD:

  • IosBuildService.VerifyDeviceBundle: Path.GetFullPath(head) (KtsuBuild/Ios/IosBuildService.cs:118)
  • IosService.LocateIpas: Path.GetFullPath(head) (KtsuBuild/Ios/IosService.cs:256)
  • IosService.ArchiveAsync: Path.GetFullPath(options.ProjectPath) (:401)
  • IosService.ResolveInfoPlist: Path.GetFullPath(projectPath) (:462)
  • IosService.ResolveIosFramework: File.Exists(projectPath) (:477)

Failure scenario

On macOS, from outside the workspace: ktsubuild ios build --workspace app --project src/App.iOS/App.iOS.csproj

  • ios build: dotnet build succeeds, then the bundle check searches <cwd>/src/App.iOS/bin/Release. It logs "Device .app bundle not found" and exits 1.
  • ios package: Info.plist is "not found", so the version is not stamped (only a warning). -f is omitted, and the command throws "iOS archive completed but no .ipa was produced".
  • ios upload: it finds no .ipa and exits 0 having uploaded nothing.

test run already handles this case (TestCommand.cs around line 116). #172 is the same class of bug (--workspace differs from CWD) for the changelog and release notes.

Suggested fix

Normalize once in the ios handlers, the same way test run does: Path.IsPathRooted(p) ? p : Path.Combine(workspace, p). Alternatively, resolve against options.WorkingDirectory inside the services, so every lookup agrees with the directory dotnet ran in.

Acceptance: unit tests run the three services with a relative project path and a WorkingDirectory that differs from the process CWD, using temp directories. They show that the bundle, Info.plist, framework and .ipa lookups all resolve under the workspace.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions