This logic was intented to zip up the .NET unit tests to run them on Windows,
but in the end we went with a different approach that doesn't require zipping.
* Unify the code to collect diagnostic information about a bot.
* Unify some of the cleanup code to prepare a bot as well.
* Implement code to terminate processes on a bot that's used more than a day
of CPU (presumably these processes are stuck for some reason).
We need to set "UseCurrentRuntimeIdentifier=false", we must only set it for
the outer build for universal builds - when `RuntimeIdentifiers` is set - but
that means we can only do it *after* we set any default value for
`RuntimeIdentifiers`.
Fixes https://github.com/xamarin/xamarin-macios/issues/19391#issuecomment-2405499973.
This isn't very user friendly:
ILLink : unknown error IL7000: An error occurred while executing the custom linker steps. Please review the build log for more information.
ILLINK : error MT0073: Microsoft.iOS 18.0.8337 does not support a deployment target of 10.0 for iOS (the minimum is 11.0). Please select a newer deployment target in your project's Info.plist or change the SupportedOSPlatformVersion property in your project file.
ILLINK : error MT2301: The linker step 'Setup' failed during processing: Microsoft.iOS 18.0.8337 does not support a deployment target of 10.0 for iOS (the minimum is 11.0). Please select a newer deployment target in your project's Info.plist or change the SupportedOSPlatformVersion property in your project file.
[...]/packages/microsoft.net.illink.tasks/8.0.8/build/Microsoft.NET.ILLink.targets(87,5): error NETSDK1144: Optimizing assemblies for size failed. Optimization can be disabled by setting the PublishTrimmed property to false.
So improve this to only show a single error message:
The SupportedOSPlatformVersion value '10.0' in the project file is lower than the minimum value '11.0'.
Fixes https://github.com/xamarin/xamarin-macios/issues/21368.
We still need some of the source files from the legacy Mono library, but it's
only a few files, so just add them to the git repo.
Also implement caching of the .NET download, which speeds up clean rebuilds
significantly.
Note: all the files in the `builds/mono-ios-sdk-destdir` are a straight import
from the Mono archive, so those shouldn't need much reviewing (nor will I
change them unless absolutely necessary).
The methods 'GetTraitCollectionWithTraits' and 'GetTraitCollectionByModifyingTraits' takes a callback, but the callback
had the wrong signature.
So introduce a new overload for each of these methods, using a delegate with the correct signature.
Also deprecate 'FromTraitsFromCollections' according to both headers and documentation.
Fixes https://github.com/xamarin/xamarin-macios/issues/21377.
On the bots we're executing with Rosetta, and 'arch' returns 'i386' under
Rosetta, so detect when we're executing under Rosetta, and install the arm64
version of .NET in that case as well.
Also fix a bug in the same area in our tests.
This new pipeline will only be executed when the CI build is completed
by any of the branches that have been listed to be included in the
trigger.
This pipeline because it does a release has to extend the 1ES template.
---------
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Due to the way that resource triggers are implemented in VSTS, we are
triggering tests more than once. To solve the issue, we need to move the
diff stages to different pipelines. This is the first step to allow use
to get less stages in the build so that we can reduce the number of
tests that are triggered.
This is another step towards removing Mono.
This required a few changes:
* Nullability updates in test code.
* Explicitly sorted list of strings in a warning message, to make the warning text stable.
* Stopped allowing the test assemblies to see internals of the task assembly. This was necessary for to solve a problem with duplicate types:
* The netstandard2.0 version of `System.Reflection.Metadata.dll` contains
the `UnconditionalSuppressMessageAttribute` type (internally).
* Since we ILMerge the tasks assembly, this type ends up in
Xamarin.iOS.Tasks.dll (internally).
* The test assembly can't be a net472 assembly, because that means using
the netfx/desktop versions of the Microsoft.Build.* assemblies, which
don't work on .NET (they check for Mono, but .NET isn't Mono, so the
check fails and a PlatformNotSupportedException is thrown).
* So I bumped the test assembly to be a net8.0 assembly, but then there's
a conflict between the `UnconditionalSuppressMessageAttribute` shipped
in .NET vs the one in `Xamarin.iOS.Tasks.dll` (because the test assembly
can see the internals of `Xamarin.iOS.Tasks.dll`).
* The fix that _doesn't work_ is to not merge system assemblies in the
`Xamarin.iOS.Tasks.dll` assembly anymore. `Xamarin.iOS.Tasks.Windows.dll`
already does this, but it doesn't work when building remotely.
* The fix that seems to work is to just not allow the test assemblies to
see the internals of the task assembly. This is really an anti-pattern
anyway, so no big loss. This required a few changes (make some API in
the task assembly public, remove some legacy tests that don't apply
anymore in .NET, etc.)
Clean the CI from all references to the old pkg notarisation and
signing.
- Remove the templates that did the jobs.
- Remove the parameters that allowed to skip the signing and
notarisation.
- Remove the references to the scripts.
This simplifies greatly the yaml.
Split the variables and document their usage. Because we are going to
have to add more pipelines we want to limit the amount of secrets a new
pipeline requests and uses.
The split is as follows:
- variables/common.yml: needed by all.
- variables/api-scan.yml: needed by the api scan pipeline.
- variables/signing.yml: needed by pipeline that need to perform
signing.
---------
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Instead of doing this:
```cs
var obj = Runtime.GetINativeObject<T>(handle, false);
NSObject.ReleaseDangerous (handle);
```
we now do this:
```cs
var obj = Runtime.GetINativeObject<T>(handle, true);
```
Less generated code, and better performance too.
This was found while investigating https://github.com/xamarin/xamarin-macios/issues/21290.
Building the custom-type-assembly assembly doesn't work quite right if the
RuntimeIdentifier(s) variables are set in the environment from the project
file, so don't forward those to the sub-make we execute to build the assembly.
This fixes an issue where building monotouch-test would fail locally, because
building the custom-type-assembly assembly would fail.
Also remove legacy Xamarin logic.