Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dotnet publish -f net8.0-ios -c Release is way too slow #20090

Closed
cmydur opened this issue Jan 23, 2024 · 13 comments
Closed

dotnet publish -f net8.0-ios -c Release is way too slow #20090

cmydur opened this issue Jan 23, 2024 · 13 comments
Labels
area-publishing Issues with the app packaging/publishing process (ipk/apk/msix/trimming) platform/iOS 🍎 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working

Comments

@cmydur
Copy link

cmydur commented Jan 23, 2024

Description

My Publish times for iOS are close an hour or so.

Steps to Reproduce

Create a new MAUI App
build the app
run dotnet publish -f net8.0-ios -c Release

Link to public reproduction project repository

No response

Version with bug

8.0.6

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

iOS

Did you find any workaround?

No

Relevant log output

No response

@cmydur cmydur added the t/bug Something isn't working label Jan 23, 2024
@jsuarezruiz jsuarezruiz added platform/iOS 🍎 area-publishing Issues with the app packaging/publishing process (ipk/apk/msix/trimming) labels Jan 23, 2024
@mobilewares
Copy link

We consistently get ~5 minutes build times on our DevOps MacVM based pipeline (and same with 8.0.6 nugets) for the iOS build - which is typically a lot slower vs a local Mac machine. We do a MAUI workload install & a dotnet restore prior to this & it's a very large complex project with a lot of 3rd party components in use.
Are you able to see what point in the output/build process it's taking so long?

@cmydur
Copy link
Author

cmydur commented Jan 24, 2024

I'm running on my local Mac, this is where it is stuck for long time. One thing to note is Android build does not take as long

Optimizing assemblies for size may change the behavior of the app. Be sure to test after publishing. See: https://aka.ms/dotnet-illink
Optimizing assemblies for size. This process might take a while.

@javrro
Copy link

javrro commented Feb 1, 2024

Im getting the same issue.
Though I havent waited the hour to see if it finishes the build.

@cmydur
Copy link
Author

cmydur commented Feb 1, 2024

It will finish after an hour

@vchelaru
Copy link

I am also experiencing this problem - no comments from the maintainers on why this is happening or when it might be fixed?

@josemnbcamacho
Copy link

I'm also having this problem. ADO pipelines were failing because build time was longer than one hour.

Added this to Release configuration and build times came back to normal:

<MtouchUseLlvm>False</MtouchUseLlvm>
<AotAssemblies>True</AotAssemblies>

@ninachen03 ninachen03 added s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage labels Apr 29, 2024
@ninachen03
Copy link

ninachen03 commented Apr 29, 2024

Verified this issue with Visual Studio 17.6.10(build 428) ,I can not repro it.

@MrZander
Copy link

I am also experiencing this issue.

Running dotnet 8.0.302

dotnet publish -f net8.0-ios -c Release -p:ArchiveOnBuild=true -p:RuntimeIdentifier=ios-arm64 -p:CodesignKey="iPhone Distribution" -p:CodesignProvision="My Provision" -p:ServerAddress=omitted -p:ServerUser=omitted -p:ServerPassword=omitted -p:TcpPort=omitted -p:_DotNetRootRemoteDirectory=/Users/myuser/Library/Caches/Xamarin/XMA/SDKs/dotnet/ -v diag

Adding <MtouchUseLlvm>False</MtouchUseLlvm> dropped my release build time from 2.5 hours to ~10 minutes. Still pretty dang slow, but it is at least manageable.

@samhouts samhouts removed s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Jul 3, 2024
@samhouts samhouts added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Jul 10, 2024
@pluggy
Copy link

pluggy commented Aug 28, 2024

Same problem here. Half an hour for a release build is too much.

@MartyIX
Copy link
Contributor

MartyIX commented Aug 28, 2024

(Would it help here to produce a binlog? See https://github.com/dotnet/maui/wiki/Capturing-Binary-Logs or https://dfederm.com/debugging-msbuild/. Just an idea.)

@rbev
Copy link

rbev commented Oct 22, 2024

I'm also having this problem. ADO pipelines were failing because build time was longer than one hour.

Added this to Release configuration and build times came back to normal:

<MtouchUseLlvm>False</MtouchUseLlvm>
<AotAssemblies>True</AotAssemblies>

Did this have any significant impact on package size or performance?

@rabuckley
Copy link
Contributor

I'm hitting very slow release build times too. Running the following on my M1 MacBook Pro took over 13 minutes. Publishing the same app takes just over one minute. Is such a large difference expected? Is the big difference between building for simulator vs. a real device?

dotnet new maui --name MauiBuildTime
cd MauiBuildTime
dotnet build -c release -f net9.0-ios -bl
Machine Specs and dotnet info
macOS Sequoia 15.0.1 (24A348) [Darwin 24.0.0]
Apple M1 Pro, 1 CPU, 10 logical and 10 physical cores

---

.NET SDK:
 Version:           9.0.100-rc.2.24474.11
 Commit:            315e1305db
 Workload version:  9.0.100-manifests.3424025a
 MSBuild version:   17.12.0-preview-24473-03+fea15fbd1

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  15.0
 OS Platform: Darwin
 RID:         osx-arm64
 Base Path:   /usr/local/share/dotnet/sdk/9.0.100-rc.2.24474.11/

.NET workloads installed:
 [maui]
   Installation Source: SDK 9.0.100-rc.2
   Manifest Version:    9.0.0-rc.2.24503.2/9.0.100-rc.2
   Manifest Path:       /usr/local/share/dotnet/sdk-manifests/9.0.100-rc.2/microsoft.net.sdk.maui/9.0.0-rc.2.24503.2/WorkloadManifest.json
   Install Type:        FileBased

Build

dotnet build -c release -f net9.0-ios -bl
You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy
  MauiBuildTime net9.0-ios succeeded (788.8s) → bin/Release/net9.0-ios/iossimulator-arm64/MauiBuildTime.dll

Build succeeded in 789.0s

Publish

dotnet publish -c release -r ios-arm64 -f net9.0-ios -bl
You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy
  MauiBuildTime net9.0-ios succeeded (69.2s) → bin/Release/net9.0-ios/ios-arm64/MauiBuildTime.dll

Build succeeded in 69.4s

@rolfbjarne
Copy link
Member

This issue was moved to dotnet/macios#21597

@github-actions github-actions bot locked and limited conversation to collaborators Dec 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-publishing Issues with the app packaging/publishing process (ipk/apk/msix/trimming) platform/iOS 🍎 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests