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.49k stars 515 forks source link

Allow me to disable the SayHello build task for class libraries #8601

Closed dotMorten closed 3 years ago

dotMorten commented 4 years ago

Steps to Reproduce

  1. Create a multi-targeted class library that includes xamarin.ios targets.
  2. Build on Windows without a mac-host attached/
  3. Notice that the build takes a long time waiting for the SayHello build task to connect to a build host

Expected Behavior

Skip the sayhello task for class libraries - it's not needed, I want fast iterations on my work, which should include reducing build times. About 80% of my build time is because of this task.

Alternatively, let me at least disable it with an msbuild property so I can choose to skip it and speed up build times.

Actual Behavior

Compilation takes significantly longer because if this task that isn't even needed.

Environment

Visual Studio: Help > About Microsoft Visual Studio > Copy Info [button]

Microsoft Visual Studio Enterprise 2019
Version 16.5.4
VisualStudio.16.Release/16.5.4+30011.22
Microsoft .NET Framework
Version 4.8.03752

Installed Version: Enterprise

Visual C++ 2019   00435-60000-00000-AA944
Microsoft Visual C++ 2019

ArcGIS Runtime SDK for .NET   100.8.0
ArcGIS Runtime SDK for .NET allows developers to build immersive, native mapping applications for Windows, Android, and iOS devices using C#.  It includes five APIs: WPF to create apps for Windows Desktop, UWP to create Universal Windows apps, Xamarin.Android and Xamarin.iOS for Android and iOS apps that need access to native functionality, and Xamarin.Forms to create apps that share UI layouts across Android, iOS, and UWP.

ASP.NET and Web Tools 2019   16.5.236.49856
ASP.NET and Web Tools 2019

ASP.NET Web Frameworks and Tools 2019   16.5.236.49856
For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0   16.5.236.49856
Azure App Service Tools v3.0.0

Azure Functions and Web Jobs Tools   16.5.236.49856
Azure Functions and Web Jobs Tools

C# Tools   3.5.0-beta4-20153-05+20b9af913f1b8ce0a62f72bea9e75e4aa3cf6b0e
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools   1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Extensibility Message Bus   1.2.0 (d16-2@8b56e20)
Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.

IntelliCode Extension   1.0
IntelliCode Visual Studio Extension Detailed Info

Microsoft Azure Tools   2.9
Microsoft Azure Tools for Microsoft Visual Studio 2019 - v2.9.30207.1

Microsoft Continuous Delivery Tools for Visual Studio   0.4
Simplifying the configuration of Azure DevOps pipelines from within the Visual Studio IDE.

Microsoft JVM Debugger   1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft Library Manager   2.1.25+gdacdb9b7a1
Install client-side libraries easily to any web project

Microsoft MI-Based Debugger   1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual C++ Wizards   1.0
Microsoft Visual C++ Wizards

Microsoft Visual Studio Tools for Containers   1.1
Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container.

Microsoft Visual Studio VC Package   1.0
Microsoft Visual Studio VC Package

Mono Debugging for Visual Studio   16.5.514 (c4f36a9)
Support for debugging Mono processes with Visual Studio.

NuGet Package Manager   5.5.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

Project System Tools   1.0
Tools for working with C#, VisualBasic, and F# projects.

ProjectServicesPackage Extension   1.0
ProjectServicesPackage Visual Studio Extension Detailed Info

Snapshot Debugging Extension   1.0
Snapshot Debugging Visual Studio Extension Detailed Info

SQL Server Data Tools   16.0.62003.05170
Microsoft SQL Server Data Tools

Test Adapter for Boost.Test   1.0
Enables Visual Studio's testing tools with unit tests written for Boost.Test.  The use terms and Third Party Notices are available in the extension installation directory.

Test Adapter for Google Test   1.0
Enables Visual Studio's testing tools with unit tests written for Google Test.  The use terms and Third Party Notices are available in the extension installation directory.

TypeScript Tools   16.0.20225.2001
TypeScript Tools for Microsoft Visual Studio

UnoPlatformPackage Extension   1.0
UnoPlatformPackage Visual Studio Extension Detailed Info

Visual Basic Tools   3.5.0-beta4-20153-05+20b9af913f1b8ce0a62f72bea9e75e4aa3cf6b0e
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools 10.8.0.0 for F# 4.7   16.5.0-beta.20181.6+85af456066acd4e76d2bc7821b44a325e46f2fca
Microsoft Visual F# Tools 10.8.0.0 for F# 4.7

Visual Studio Code Debug Adapter Host Package   1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio Container Tools Extensions (Preview)   1.0
View, manage, and diagnose containers within Visual Studio.

Visual Studio Tools for CMake   1.0
Visual Studio Tools for CMake

Visual Studio Tools for Containers   1.0
Visual Studio Tools for Containers

VisualStudio.DeviceLog   1.0
Information about my package

VisualStudio.Foo   1.0
Information about my package

VisualStudio.Mac   1.0
Mac Extension for Visual Studio

Xamarin   16.5.000.533 (d16-5@9152e1b)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer   16.5.0.470 (remotes/origin/d16-5@681de3fd6)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin Templates   16.5.49 (0904f41)
Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.

Xamarin.Android SDK   10.2.0.100 (d16-5/988c811)
Xamarin.Android Reference Assemblies and MSBuild support.
    Mono: c0c5c78
    Java.Interop: xamarin/java.interop/d16-5@fc18c54
    ProGuard: xamarin/proguard/master@905836d
    SQLite: xamarin/sqlite/3.28.0@46204c4
    Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-5@9f4ed4b

Xamarin.iOS and Xamarin.Mac SDK   13.16.0.13 (b75deaf)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

VS bug #1125165

mandel-macaque commented 4 years ago

@dotMorten this is an issue with the xamarin-vs team, the xamarin-macios project does not control that. It has been labeled so that you will get a reply from the correct team.

softlion commented 4 years ago

There is the same issue with msbuild when building from the command line. So this is not a VS issue.
I'm building the Vapolia.Xamarin.Svg.Forms nuget library since 5 years and this is a new issue.

@mandel-macaque Why would it be an issue with the VS team ?
It's a msbuild task that you created, it's not a problem with VS.

dotMorten commented 4 years ago

@softlion the sayhello task isn't defined in this repo. AFAIK it isn't open source, but this is the repo we'd usually report iOS issues in.

softlion commented 4 years ago

@brendanzagaeski this is a show stopper could you do something ? In the family "i want to be as uneffective as possible" i take the king 👍

brendanzagaeski commented 4 years ago

Interesting. I have a couple ideas that might help, but since I've been focused on Xamarin.Android for the past few years, I might be a little of the loop, so take these with a grain of salt.

dotMorten commented 3 years ago

This is still an issue with net6-ios. For a simple class library, 12.043s out of an 12.635s second build is spent on this task: image

jonathanpeppers commented 3 years ago

/cc @emaf

See: https://discord.com/channels/732297728826277939/732297916680765551/856654093560184852

Didn't this get fixed in .NET 6? Should it make a connection in a class library project at all?

dotMorten commented 3 years ago

I'm seeing this with .NET 6 preview 5.

mauroa commented 3 years ago

Hi, This issue has been fixed for good by avoiding to execute the SayHello task when no ServerAddress input is passed to the target. Unfortunately this is not available in .net6 Preview 5 but you will be able to get the fix from Preview 6. Thanks

dotMorten commented 3 years ago

This issue has been fixed for good by avoiding to execute the SayHello task when no ServerAddress input is passed to the target.

How do I control that though? I wasn't passing anything. And even if I was, why is this needed for class libraries?

mauroa commented 3 years ago

@dotMorten iOS class libraries can also be built against the Mac, specially if you are referencing it from an iOS app or if you have any referenced framework (static or dynamic). If you build from command line you need to be explicit about the connection information to connect to a Mac (you need to set the MSBuiid properties) but if you build from VS this is implicit and directly passed from VS to MSBuild (with the connection information that VS already has). What the latest fix does is to avoid executing this connection task at all if no connection information is passed (from command line or VS). So you don’t need to control anything, meaning if you are building from VS and you are not connected to a Mac then the task will not be executed. On the other hand, if you are building from command line you decide if you want to do it against a Mac or not.

softlion commented 3 years ago

That is a curious explanation. I’m used to debug / build iOS apps from windows, and still have this message.