xamarin / xamarin-macios

.NET for iOS, Mac Catalyst, macOS, and tvOS provide open-source bindings of the Apple SDKs for use with .NET managed languages such as C#
Other
2.48k stars 514 forks source link

Output cannot correctly display the location of the ipa file by Publish an iOS app when using the command line #21258

Open rolfbjarne opened 1 month ago

rolfbjarne commented 1 month ago

Repro steps

Affected Branch: main

Affected Build: 17.11.0 Preview 1.0 [34814.24.main]

Note: The same command can generate ipa files on NET8

Setup

  1. Install any main build
  2. Install NET9: 9.0.100-preview.3.24204.13
  3. Install maui workload->dotnet workload install maui --from-rollback-file http://maui.blob.core.windows.net/metadata/rollbacks/9.0.0-preview.3.10457.json --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9/nuget/v3/index.json --source https://api.nuget.org/v3/index.json --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json

Steps to reproduce:

  1. Create an empty folder with the name of the solution for Maui eg:iosPub
  2. Run command line: cd to C:\iosPub
  3. Open the project and set the info.plist file ->save
  4. Run command line: dotnet new maui
  5. Run command line: dotnet publish iosPub.csproj -f net9.0-ios -c Release -p:ArchiveOnBuild=true;Platform=iPhone -p:RuntimeIdentifier=ios-arm64 -p:CodesignKey="Apple Distribution: xiaoting zhang (VVW3J38584)" -p:CodesignProvision="ZackVS" -p:ServerAddress=xxxx -p:ServerUser=xxx-p:ServerPassword=x.a.2036 -p:TcpPort=58181 -p:_DotNetRootRemoteDirectory=/Users/[xxxx]/Library/Caches/Xamarin/XMA/SDKs/dotnet/

Actually:

Output cannot correctly display the location of the ipa

368612620-3f77e404-f07c-451b-a205-4571079022d9

Expected:

Accurately give the location of ipa,Please refer to the screenshot of Net 8

image

rolfbjarne commented 1 month ago

The binlog shows that we're printing the message:

Created the package: bin\iPhone\Release\net9.0-ios\ios-arm64\publish\iosPub.ipa

I believe the reason the message doesn't actually show up is because the build logging behavior changed in .NET 9 (https://learn.microsoft.com/en-us/dotnet/core/compatibility/sdk/9.0/terminal-logger )

Can you try adding this to the "dotnet publish" command to see if that makes it work as you expect?

--tl:off

That will make the build logging behavior identical to what it is in .NET 8.

rolfbjarne commented 1 month ago

A solution for this is being worked on by the MSBuild team.

Discord discussion: https://discord.com/channels/732297728826277939/732310858776182866/1283410368034639943

Rolf — 09/11/2024 1:21 PM
    I pretty much solely work with binlogs. One problem with tl is that it's harder for a task to print something like "hey, the file you wanted built is <here>"

Chet Husk — 09/11/2024 2:54 PM
    This is one of the common use cases we're tracking - it will come in time for sure!

Rolf — 09/11/2024 2:56 PM
    is there an issue I can track?

Chet Husk — 09/11/2024 3:00 PM
    Yeah - https://github.com/dotnet/msbuild/issues/9608
    The overall story of TL has been 'wow, this is the Wild West and we need some specific messages to bring order and structure to the world'

So see also https://github.com/dotnet/msbuild/issues/9608