dotnet / dotnet/xcsync

Exception in ConsumeAsync: Could not find a part of the path '/Users/******/yur/p1/obj/xcode/AppDelegate.h'

Open
#160 2 comments 0 reactions 1 assignee Claimed by @mcumming View on GitHub
Dominant language
C#
Stars
25
Forks
10
Avg merge
12h 50m
Merged PRs (30d)
10

Description

this: https://github.com/dotnet/xcsync/blob/7e95dff4ec8a211a26f9e6b69bcbb20c26b51950/src/xcsync/Commands/BaseCommand.cs#L204

isn't doing what it is supposed to when executing the generate command for the _very_ first time. It results in:

> ./xcsync generate -p /Users/`******`/yur/p1/p1.csproj -tfm net9.0-ios -f -v Detailed
xcSync v42.42.42.42, (c) Microsoft Corporation. All rights reserved.
[16:04:58 INF xcsync (1)] Using Xcode from /Applications/Xcode_15.4.0.app.
[16:04:59 INF xcsync (1)] Using the `dotnet` located at .
[16:04:59 INF xcsync (1)] Generating files from project '/Users/`******`/yur/p1/p1.csproj' to target '/Users/`******`/yur/p1/obj/xcode'
[16:04:59 DBG xcsync (1)] Generating Xcode project files...
Executing: dotnet msbuild /Users/`******`/yur/p1/p1.csproj -getProperty:UseMaui,OutputType -getResultOutputFile:/var/folders/qc/z5px468n56j2pnk6ltpctn5c0000gn/T/tmp1LATWI.tmp
[16:05:04 DBG xcsync (9)] Generated Xcode header and implementation files
[16:05:04 FTL xcsync (18)] Exception in ConsumeAsync: Could not find a part of the path '/Users/******/yur/p1/obj/xcode/AppDelegate.h'.
Executing: dotnet msbuild /Users/`******`/yur/p1/p1.csproj -getItem:Compile,None -property:TargetFramework=ios -getResultOutputFile:/var/folders/qc/z5px468n56j2pnk6ltpctn5c0000gn/T/tmpZztvRo.tmp
[16:05:04 FTL xcsync (18)] Exception in ConsumeAsync: Could not find a part of the path '/Users/`******`/yur/p1/obj/xcode/AppDelegate.m'.
Executing: dotnet msbuild /Users/`******`/yur/p1/p1.csproj -getItem:BundleResource -property:TargetFramework=net9.0-ios -getResultOutputFile:/var/folders/qc/z5px468n56j2pnk6ltpctn5c0000gn/T/tmptoprQU.tmp
Executing: dotnet msbuild /Users/`******`/yur/p1/p1.csproj -getProperty:SupportedOSPlatformVersion -property:TargetFramework=net9.0-ios -getResultOutputFile:/var/folders/qc/z5px468n56j2pnk6ltpctn5c0000gn/T/tmpDDP5Fd.tmp
[16:05:07 INF xcsync (9)] Generated Xcode project at '/Users/`******`/yur/p1/obj/xcode'
[16:05:07 DBG xcsync (18)] Synchronization complete.

in the above stack trace, we only see issues with the AppDelegate files. Why not any of the static ones like Info.plist?
because we ensure the directory is created for apple-specific files: https://github.com/dotnet/xcsync/blob/7e95dff4ec8a211a26f9e6b69bcbb20c26b51950/src/xcsync/SyncContext.cs#L173

also, I don't think we should be manually handling the `DirectorySeparatorChar` in: https://github.com/dotnet/xcsync/blob/7e95dff4ec8a211a26f9e6b69bcbb20c26b51950/src/xcsync/Commands/BaseCommand.cs#L52

I believe this might be contributing to the issue here. Regardless, the logic here should be more consistent

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.