Граф коммитов

2669 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge c4f0087c98 Merge remote-tracking branch 'origin/main' into darc-main-fc6e47e2-7b69-4464-b65f-8f67ca26b4e8 2022-03-25 09:46:57 +01:00
Manuel de la Pena 11bdf4b29b
[CI] Add missing variables needed to trigger the test selector. (#14488) 2022-03-24 18:07:32 -04:00
Manuel de la Pena b608e95645
[CI] Ensure that VS has the correct version of Xcode in all jobs. (#14480) 2022-03-24 11:02:14 -04:00
Rolf Bjarne Kvinge 7b9810c523 [devops] Next attempt 2022-03-24 15:04:44 +01:00
Rolf Bjarne Kvinge 456170df10 Merge remote-tracking branch 'origin/main' into darc-main-fc6e47e2-7b69-4464-b65f-8f67ca26b4e8 2022-03-24 07:57:58 +01:00
Rolf Bjarne Kvinge e317f9d3cb [devops] Fix extraction. 2022-03-24 07:57:44 +01:00
Rolf Bjarne Kvinge aa3d95ef22
[devops] Report if tests on older macOS bots time out. (#14438)
Also relax the requirement for GitHub comments to have a description, since we don't need to say more than that it timed out.

This is how it ends up looking: https://github.com/xamarin/xamarin-macios/pull/14438#issuecomment-1075451821
2022-03-23 22:35:39 +01:00
Rolf Bjarne Kvinge 286a67ef23 [devops] Fix stuff. 2022-03-23 19:11:02 +01:00
Rolf Bjarne Kvinge ecef7ad570 [devops] Add a GitHub comment if the build fails. 2022-03-23 15:38:05 +01:00
Rolf Bjarne Kvinge e26250dfcd [devops] Only publish binlogs if they exist. 2022-03-23 15:25:45 +01:00
Rolf Bjarne Kvinge cbaa6e8f5d [devops] Attempt to install sdk manifest to make workload installs possible. 2022-03-23 09:59:19 +01:00
Rolf Bjarne Kvinge e44d0fd047
[.NET] Rename several DOTNET6_* variables to to DOTNET_*. (#14463)
Also rename DOTNET_VERSION to SYSTEM_DOTNET_VERSION to make it clear what it's
referring to (and to not clash with DOTNET6_VERSION which has now been renamed
to DOTNET_VERSION).

.NET 7 is right around the corner.
2022-03-23 08:07:34 +01:00
Manuel de la Pena 28b9d24b07
[CI] Undo a merge done by Github/VSTS when we do the checkout so that both jobs (build & test) use the same commit. (#14443) 2022-03-22 17:41:03 -04:00
Rolf Bjarne Kvinge 7d500da2bf
[msbuild] Rework code signing. (#14387)
The main theme here is that code signing will be done in the outermost
executable project, not in any app extension projects or watch projects, nor
during the RID-specific build of a .NET universal app. This makes codesigning
easier to reason about and other affected logic (such as strip/dsymutil)
easier to handle, in particular for .NET universal apps. Another benefit is
that the differences between the iOS and macOS code bases have been
eliminated.

The first step is to collect all the information we need from the targets
files. Every app bundle (be it app extension, watch app or main app) will add
its own output app bundle (.app/.appex) to the _CodesignBundle item group.
Then every app bundle will load this informarion from referenced app bundles,
and finally store this information on disk (in the 'codesign-bundle.items'
file). This means that in the end the main app bundle will have a list of all
contained app bundles in the app (recursively), in the _CodesignBundle item
group.

Separately we keep a list of other items that need signing, in the
_CodesignItems item group, and we do the same store/load logic for every
contained/contained app bundle (in the 'codesign.items' file, so a the end the
main app bundle will have a list of all the _CodesignItems for all contained
app bundles (recursively).

The previous steps occur in the _CollectCodesigningData and
_StoreCodesigningData targets.

The next step is to use the new ComputeCodesignItems task to compute
everything we need to know for code signing. This task takes over the
responsibility for listing all the *.dylib and *.metallib files, and the
*.framework directories in the app bundles, that need signing (which was
previously done in the targets file). This logic is significantly easier to
write, debug and test in C# than MSBuild.

In addition the ComputeCodesignItems also figures out a stamp file path we use
to determine if something needs (re-)signing. Previously .framework
directories did not have a stamp location, so they'd always end up resigned in
a rebuild, while now we'll automatically skip signing *.framework directories
unless something changed in them.

I've also tried to comment everything thorougly, for the next poor soul having
to deal with any bugs.

Behavioral differences:

* We were always signing *.dylib files for macOS. We're now doing the same
  thing for all platforms.
* We're now always signing *.framework directories for all platforms (like we
  do for *.dylib files), since frameworks are pretty much like dylibs anyways.

I've verified that this works both by running the submission tests and running
and launching a sample project on device from Windows.
2022-03-22 12:53:58 +01:00
Rolf Bjarne Kvinge e369f466f7
[dotnet] Rename the DOTNET6 make variable to DOTNET. (#14441)
This is the follow-up to where the DOTNET variable was renamed SYSTEM_DOTNET.
2022-03-21 15:56:57 +01:00
Steve Hawley d47dc8d63c
Nnyeah (#14426)
* Remove existing attributes

* Attribute Conversion

* First cut of code for review.

* Clean up csproj

* nullable enable and cleanup nullability. Compiles with no errors or warnings.

* typo

* Remove nullables with cleaner code, reworked things with Try...pattern.

* last couple '== null' changes
2022-03-18 15:54:15 -04:00
Rolf Bjarne Kvinge 8b445936a3
[devops] Fix typo in step name. (#14433) 2022-03-17 09:36:44 +01:00
Rolf Bjarne Kvinge 3d05542677 [msbuild] Rework code signing.
The main theme here is that code signing will be done in the outermost executable
project, not in any app extension projects or watch projects, nor during the RID-specific
build of a .NET universal app. This makes codesigning easier to reason about and
other affected logic (such as strip/dsymutil) easier to handle, in particular for
.NET universal apps. Another benefit is that the differences between the iOS and
macOS code bases have been eliminated.

The first step is to collect all the information we need from the targets files.
Every app bundle (be it app extension, watch app or main app) will add its own output
app bundle (.app/.appex) to the _CodesignBundle item group. Then every app bundle
will load this informarion from referenced app bundles, and finally store this information
on disk (in the 'codesign-bundle.items' file). This means that in the end the main
app bundle will have a list of all contained app bundles in the app (recursively),
in the _CodesignBundle item group.

Separately we keep a list of other items that need signing, in the _CodesignItems
item group, and we do the same store/load logic for every contained/contained app
bundle (in the 'codesign.items' file, so a the end the main app bundle will have
a list of all the _CodesignItems for all contained app bundles (recursively).

The previous steps occur in the _CollectCodesigningData and _StoreCodesigningData
targets.

The next step is to use the new ComputeCodesignItems task to compute everything we
need to know for code signing. This task takes over the responsibility for listing
all the *.dylib and *.metallib files, and the *.framework directories in the app
bundles, that need signing (which was previously done in the targets file). This
logic is significantly easier to write, debug and test in C# than MSBuild.

In addition the ComputeCodesignItems also figures out a stamp file path we use to
determine if something needs (re-)signing. Previously .framework directories did
not have a stamp location, so they'd always end up resigned in a rebuild, while now
we'll automatically skip signing *.framework directories unless something changed
in them.

I've also tried to comment everything thorougly, for the next poor soul having to
deal with any bugs, as well has adding a comprehensive test for the new task.

Behavioral differences:

* We were always signing *.dylib files for macOS. We're now doing the same thing
  for all platforms.
* We're now always signing *.framework directories for all platforms (like we do
  for *.dylib files), since frameworks are pretty much like dylibs anyways.
2022-03-16 21:00:15 +01:00
Manuel de la Pena 792bd80471
[CI] Fix typo that reuslted reporting the wrong test results. (#14425) 2022-03-15 15:58:53 -04:00
Manuel de la Pena 5e5414f160
[CI] Do not try to download and extract tests in the build job. (#14410) 2022-03-15 15:42:10 -04:00
Manuel de la Pena 1f9998a5db
[CI[ Re-enable the upload of the api diff. (#14409) 2022-03-15 15:41:36 -04:00
Manuel de la Pena 2586aa1541
[CI] Always execute older macOs tests. (#14366)
Always execute the older macOS tests since they do not take too much
time and we now do have the required resources.
2022-03-11 21:43:41 -05:00
Manuel de la Pena bcfad82211
[CI] Build the rollback file in the build bot. (#14389)
Or make files canculate the version of the nuget based on the hash of
the source, because VSTS does a merge of the branhc rather than checking
out, the version calculated in the tests bot via de makefiles is
different to the one that was used in the build bots.

We solve this by creating the rollback file at build time so that it is
consumed by the test bot.
2022-03-11 21:40:36 -05:00
Manuel de la Pena 917d2cfc87
[CI] Fix download url. This will later should not be hardcoded. (#14391) 2022-03-11 18:45:02 -05:00
Manuel de la Pena d221a69f8a
[CI] Fix html report publishing on vsdrops. (#14388) 2022-03-11 17:55:16 -05:00
Bekir Ozturk af30c26381
[Localization] Turn on template localization on dotnet CLI (#14213) 2022-03-11 10:30:47 -05:00
Rolf Bjarne Kvinge 9c4c3213e1
[registrar] Fix comparing full token references. Fixes #11641. (#14313)
The static registrar usually stores a compressed version of metadata tokens in
the generated code. However, when there are many assemblies in the app (>127),
we can't use the compressed version anymore, and fall back to a full version.

In this case, we weren't comparing type metadata tokens correctly when looking
for a type in our table of types, and thus we weren't finding the type we were
looking for.

The result is an exception like this:

> Can’t register the class MyClass when the dynamic registrar has been linked away.

In the generated table of types we're storing the full metadata token, which
includes a few bits indicating which type of token it is (in this particular
case a TypeDef token). When going through the table looking for a type, we
need to compare with those few bits set on the input type token as well to
find what we're looking for.

Also make it possible to use the remove-dynamic-registrar optimization on
macOS (which is useful by itself, but it also makes adding a test case
easier).

Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1476585.
Fixes https://github.com/xamarin/xamarin-macios/issues/11641.
2022-03-11 07:30:01 +01:00
Manuel de la Pena e07b7bef79
[CI] Move tests outside of the build machine. (#14105)
Move the execution of tests to a diff bot to be compliant with the latests EO.
2022-03-10 23:36:37 -05:00
Manuel de la Pena b68ac928c1
[CI] Do not show a warning if we cannot disable the lock screen. (#14361)
If we have an issue unlocking the UI prompt we continue on error. This
is considered a warning in the pipeline, but doing so teaches users to
ignore warnings and will result in us ignoring real actual issues.
Setting the step to not have a warning will ensure that we only see
warnings that we care about.
2022-03-10 23:09:23 -05:00
Manuel de la Pena 45dca51dfc
[CI] Fix github.glue not to fail on a remove. (#14360) 2022-03-10 16:41:42 -05:00
Rolf Bjarne Kvinge 233a0c4505
[msbuild] Fix a few paths to have consistently macOS paths. (#14354)
This fixes an issue where we'd do logic with Windows-style paths on macOS, and that's
never the right thing to do.

For the LinkNativeCode task, this would manifest as this error when building from windows:

> ld: file too small (length=0) file 'obj/Debug/net6.0-ios/iossimulator-x64/nativelibraries/libSystem.Native.dylib' for architecture x86_64

because the 'ShouldCopyToBuildServer' method would return incorrect results.

For the Codesign task, it would manifest as an exception trying to create a
directory with an empty string (because the directory name of a windows-style
path is an empty string on macOS).

Since this exception was quite useless (just getting the exception message
didn't tell me much about what caused the exception, because it had no stack
trace information), I've also improved error reporting in both of these tasks.
2022-03-09 21:53:14 -05:00
Manuel de la Pena a130485c7e
[CI] Disable the device tests until we have sorted out the pipeline pool. (#14353) 2022-03-09 12:36:54 -05:00
Rolf Bjarne Kvinge c98a6d01cc
[HealthKit] Add this framework to Mac Catalyst. (#14312) 2022-03-09 18:18:48 +01:00
Manuel de la Pena c7992072cd
[CI] Move the static page comment out and add test. (#14308) 2022-03-08 14:05:08 -05:00
Rolf Bjarne Kvinge 0897150a4f
[VisionKit] Add this framework to Mac Catalyst. (#14316) 2022-03-07 09:30:17 +01:00
Manuel de la Pena e5f7cd78f1
[CI] Ensure we have dotnet 3.x to be able to run ESRP. (#14323)
* [CI] Ensure we have dotnet 3.x to be able to run ESRP.

* do runtime instead

* [CI] Force dotnet installation path

* [CI] Move task after the build created the path dotnet is looking for

* [CI] Remove extra /

* [CI] Try getting 5.x and 3x installed

* Avoid blank space

Co-authored-by: Alex Soto <alex@alexsoto.me>
2022-03-06 18:34:10 -05:00
Manuel de la Pena e49d854805
[CI] Allow to override the pool that will be used in a manual build. (#14320) 2022-03-05 19:42:51 -05:00
Alex Soto 28f905fd75
[CHIP] Remove CHIP framework from dotnet (#14309)
CHIP framework seems to not be stable yet from Apple's side
each xcode update it brings breaking changes and it is also
not documented anywhere so let's disable it for now and
we can re-enable it in the future once it is stable.
2022-03-04 11:59:49 -05:00
Manuel de la Pena 44ac7f5977
[CI] Do not fail a build if we cannot upload to vsdrops. (#14310) 2022-03-04 09:32:12 -05:00
Manuel de la Pena bd6d0e6e89
[CI] Allow to create the APIDiff comments from files. (#14305) 2022-03-03 22:07:26 -05:00
Manuel de la Pena 3cce27446a
Revert "[ApiDiff] Let the CI show warnings when ApiDiff has make issues (#14276)" (#14295)
This reverts commit 26474fb81e.
2022-03-03 11:15:39 -05:00
TJ Lambert 26474fb81e
[ApiDiff] Let the CI show warnings when ApiDiff has make issues (#14276)
Co-authored-by: TJ Lambert <tjlambert@microsoft.com>
2022-03-01 10:46:58 -05:00
Manuel de la Pena 3e948646d6
[CI] Separate API diff from the test comment to move running the tests in a diff agent. (#14269) 2022-03-01 10:42:30 -05:00
Manuel de la Pena 888410ed9b
[CI] Remove old polycheck pipeline since we do the steps on the CI pipeline. (#14274) 2022-03-01 10:38:37 -05:00
Rolf Bjarne Kvinge c51b064ba2
[Message[s|UI]] Add to Mac Catalyst. #13935. (#14268)
Fixes https://github.com/xamarin/xamarin-macios/issues/13935.
2022-02-28 22:37:14 +01:00
Manuel de la Pena afddc693c9
[CI] Do not download artifacts for api diff if it failed. (#13923) 2022-02-28 11:34:23 -05:00
Rolf Bjarne Kvinge 8ce2d33d09
[dotnet-linker] Improve the error message from the linker when we run into a problem. (#14253)
* Better text.
* Better number ("7000" is more like "this is kind of normal" - while "6999"
  was more like "something quite expected happened").
* Use resources to make it localizable.
2022-02-26 01:58:00 +01:00
Rolf Bjarne Kvinge 2a1f24f2cc
[CoreTelephony] Fix multiple issues. Fixes #13931. (#14242)
* Add to Mac Catalyst. Fixes #13931.
* Manually include CoreTelephony headers in xtro. There's no umbrella header
  in CoreTelephony 😡 😞
* Fix availability attributes
	* Only CTCall and CTCallCenter are deprecated in the CoreTelephony API.
	* None of these APIs are obsolete, just deprecated.
	* Add Mac Catalyst attributes.

One curious fact is that the PCSC framework interferes with compiling CTCarrer.h:

    In file included from /private/var/folders/43/h027tm1n101cdrq2_b6n9n2m0000gn/T/n0b0byrt.h:163:
    /Applications/Xcode_13.2.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/CoreTelephony.framework/Headers/CTCarrier.h:62:41: error: reference to 'BOOL' is ambiguous
    @property (nonatomic, readonly, assign) BOOL allowsVOIP __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_4_0);
                                            ^
    /Applications/Xcode_13.2.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/PCSC.framework/Headers/wintypes.h:59:18: note: candidate found by name lookup is 'BOOL'
            typedef int16_t BOOL;
                            ^
    /Applications/Xcode_13.2.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/objc/./objc.h:78:18: note: candidate found by name lookup is 'BOOL'
        typedef bool BOOL;
                     ^
    1 error generated.

but since we don't bind the PCSC framework, we can just ask ObjectiveSharpie
to exclude it.

Fixes https://github.com/xamarin/xamarin-macios/issues/13931.
2022-02-24 23:41:52 +01:00
Rolf Bjarne Kvinge 15c17ddece
[msbuild] Implement proper MSBuild logging in FileCopier. (#14176)
Fixes https://github.com/xamarin/xamarin-macios/issues/12422.
Fixes https://github.com/xamarin/xamarin-macios/issues/13697.
Fixes https://github.com/xamarin/xamarin-macios/issues/14157.
2022-02-24 16:51:49 +01:00
Rolf Bjarne Kvinge bd97933b60
[runtime] Remove ObjCRuntime.nfloat in favor of System.Runtime.InteropServices.NFloat. (#14197)
* Remove ObjCRuntime.nfloat (in favor of   System.Runtime.InteropServices.NFloat).
* Automatically add a reference to the System.Runtime.InteropServices.Internal
  package, so that developers get the new NFloat API (with operators) we've
  added post .NET 6 (but don't do this for .NET 7).
* Automatically add a global using alias for
  System.Runtime.InteropServices.NFloat -> nfloat. This is not behind the
  usual `ImplicitUsings` condition our other implicit usings are, because
  they're off by default for existing projects, and the main target for the
  global using alias for nfloat is upgraded projects.
* Automatically generate a global using alias (like above) in the generator
  for all code the generator compiles.
* Update xtro entries to reference System.Runtime.InteropServices.NFloat
  instead of ObjCRuntime.nfloat.
* Add a workaround for a hopefully temporary issue with .NET/CoreCLR where the
  wrong runtime pack is selected otherwise (without the new NFloat API, so
  nothing works at runtime).

Ref: https://github.com/xamarin/xamarin-macios/issues/13087
2022-02-24 16:51:12 +01:00
TJ Lambert 188a35d879
[ApiDiffs] More renaming to enable ApiDiffs (#14187)
There was a large change to rename a lot of our Xamarin assemblies to Microsoft
ie) Xamarin.iOS -> Microsoft.iOS

There is a mismatch with some of the prerequisites in our tools/apidiff/Makefile where dependencies 
are looking for ...Microsoft.iOS... but they are still named ...Xamarin.iOS...

This PR takes any remaining "Xamarin" names and changes them to "Microsoft" for all dotnet related rules.
We will also change other dotnet rules to use the new naming convention of "macOS" and "tvOS"

The only exception is to the Xamarin.PLATFORM.dll's coming from the zip - those remain as Xamarin.iOS.dll

We should expect to see the gists showing up in ApiDiffs from this PR!

Co-authored-by: TJ Lambert <tjlambert@microsoft.com>
2022-02-21 10:39:07 +01:00
Manuel de la Pena a6ca5917b6
[CI] If we disabled the api diff do not event spawn a job. (#13875) 2022-02-18 11:02:53 -05:00
Manuel de la Pena 0fae15ebf9
[CI] Allow several builds to upload binlogs and do not fail. (#14172) 2022-02-18 10:59:49 -05:00
Sebastien Pouliot e6e4ddbab2
[appcompare] Remove old/local copy of the tool and update comparison documentation (#14190)
There's a newer version of the tool availble as a (tool)
[nuget](https://www.nuget.org/packages/appcompare/)

The nicest part, for this use case, is that it can map renamed files
between the two app bundles being compared.
[Example](https://gist.github.com/spouliot/68a43a4f514315d52b35446016ba0d2e)
2022-02-18 13:04:28 +01:00
Rolf Bjarne Kvinge e25163f573
[.NET] Rename our product assemblies. Fixes #13748. (#13847)
Rename our product assemblies to:

* Microsoft.iOS.dll
* Microsoft.tvOS.dll
* Microsoft.macOS.dll
* Microsoft.MacCatalyst.dll

This makes it easy to distinguish between legacy Xamarin and .NET whenever the
product assembly is mentioned, and I've also chosen the platform part of the
name to match how the platforms are named elsewhere (this also makes it
possible to simplify our build logic, since we can remove a lot of special
casing).

Fixes https://github.com/xamarin/xamarin-macios/issues/13748.
2022-02-16 21:30:32 +01:00
Rolf Bjarne Kvinge 5b8250486f
[dotnet/msbuild] Run install_name_tool to fix the id for dylibs. Fixes #13999. (#14147)
Fixes https://github.com/xamarin/xamarin-macios/issues/13999.
2022-02-16 21:13:40 +01:00
Rolf Bjarne Kvinge 97afd484d2
[ObjCRuntime] Keep accepting IntPtr constructors in .NET as an alternative to NativeHandle constructors. Fixes #14046. (#14145)
As a part of the breaking changes in .NET, we introduced a new type,
`ObjCRuntime.NativeHandle`, to represent native handles.

This meant that constructors taking taking `IntPtr handle`:

```cs
public class MyUIViewController : UIViewController {
    protected MyUIViewController (IntPtr handle)
        : base (handle)
    {
    }
}
```

would have to be ported to take `NativeHandle handle`:

```cs
public class MyUIViewController : UIViewController {
    protected MyUIViewController (NativeHandle handle)
        : base (handle)
    {
    }
}
```

The unfortunate part is that there will be no compiler warnings or errors
flagging this, so users won't know to do it unless they either read the
documentation (🤣) or run into the problem, googles for a while, runs into
someone else who had the same problem, and applies their (probably broken)
fix.

So we change our logic to:

1. Look for and use an `(IntPtr)` (or `(IntPtr, bool)`) constructor in .NET if
   the `NativeHandle` version isn't found.
2. Show a warning.
3. Some time in the future maybe remove this hack/workaround.

Fixes https://github.com/xamarin/xamarin-macios/issues/14046.
2022-02-15 22:48:23 +01:00
Rolf Bjarne Kvinge 8b3b6a7adf
[dotnet/runtime] Fix a few issues with regards to extensions in .NET. Fixes #13742. (#14115)
* Propagate the IsAppExtension variable correctly.

* Don't try to call mono_domain_set_config for app extensions in .NET.

  It doesn't look like it's needed, and it also immediately aborts anyway, so
  if it turns out to be needed, another solution would have to be implemented.

Fixes https://github.com/xamarin/xamarin-macios/issues/13742.
2022-02-15 08:27:25 +01:00
Mike Bond 7f38b76cd6
[CI] Generate Software Bill of Materials (SBOM) manifest (#13656)
Related work item: VS #1458467

Per Executive Order (EO) produce a Software Bill of Materials (SBOM) capturing the produced package files using a dedicated task
https://eng.ms/docs/cloud-ai-platform/devdiv/one-engineering-system-1es/1es-docs/secure-supply-chain/ado-sbom-generator

SBOM manifest generation only runs as part of a CI build since the steps are integrated with the Upload packages to Azure job

As a result of this change you will find an artifact named sbom attached to each build. Within that artifact is a manifest.json file under a _manifest directory capturing all of the files that constitute the Software Bill of Materials

The sbom steps capture the *.nupkg, *.pkg and *.msi package files published by the build

Test build having the Upload packages to Azure step enabled
https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=5720455&view=results
2022-02-09 16:12:02 -05:00
Rolf Bjarne Kvinge e0f5cede53
[tools] Remove XAMCORE_4_0 condition in linker source. (#14091)
Thinks are working fine as-is (with this XAMCORE_4_0 variable set to false),
and I see no particular reason in the code to change it, nor does the original
implementation explain much (b2bcad7a94).

So just remove this XAMCORE_4_0 condition as if it had never existed.
2022-02-08 10:38:49 +01:00
Manuel de la Pena 825c7fd55f
[CI] Move to the new sdk-insertions workload. (#14079) 2022-02-07 11:38:28 -05:00
Rolf Bjarne Kvinge ef3b05478e
[tools/runtime] Enable exception marshalling by default for all platforms in .NET. (#14051)
When exception marshalling was originally implemented, for backwards
compatibility concerns it was only turned on by default for platforms that
really needed it (watchOS).

However, exception marshalling is by far the safest option, so in .NET we're
enabling it by default for all platforms (it's still possible to disable it
for those who wants to).

Ref: https://docs.microsoft.com/en-us/xamarin/ios/platform/exception-marshaling
2022-02-07 14:12:32 +01:00
Rolf Bjarne Kvinge 42c87ab2f7
[runtime] Make Runtime.Arch a readonly field in .NET. Fixes #5518. (#14076)
* Make Runtime.Arch a readonly field.
* Tell the AOT compiler Runtime.Arch is a constant value.
* Tell the linker to stub out the method we use to fetch the current
  architecture from native code (it turned out a bit complicated to set the
  Arch field when it's readonly - the solution I came up with was to call a
  P/Invoke).

Test case (size of the main executable): link all (debug)

* Before:  33.522.704 bytes
* After:   33.506.112 bytes
* Difference: -16.592 bytes (-0.05 %)

There were no size differences in release mode, nor were there any size
differences in the "don't link" test, neither for debug nor release mode.

Fixes https://github.com/xamarin/xamarin-macios/issues/5518.
2022-02-07 08:05:41 +01:00
Sebastien Pouliot 40acce48d9
[objcruntime] Remove `SupportsModernObjectiveC` from the registrar (#13954)
Since 32bits macOS support was dropped this is always `true` so it is not
needed anymore.
2022-01-28 10:10:22 +01:00
Manuel de la Pena 5f8eb5438d
[CI] Fix upload to azure. (#13877)
A recent change missed that pwsh does not like a ending ',' while we use
it in csharp.
2022-01-25 11:32:12 -05:00
Manuel de la Pena 7a40f26320
[CI] Fix a broken CI when we skip the api diff. (#13869) 2022-01-25 09:11:21 -05:00
Manuel de la Pena 70254d822d
[CI] Allow to skip ESRP to help speed up the CI testing. (#13868) 2022-01-25 09:11:03 -05:00
Manuel de la Pena 426b1beaa3
[CI] Improve the upload script to help with SBOM (#13860) 2022-01-25 09:08:05 -05:00
Manuel de la Pena 115332f729
[CI] Unify the cleaning of the bots. (#13859) 2022-01-24 17:44:25 -05:00
Manuel de la Pena 4fe9874cc8
[CI] Use correct pwd for the device bots. (#13858) 2022-01-24 11:30:03 -05:00
Manuel de la Pena 67a6e82990
[CI] Do not result in a build failure if we cannot remove the ui promt. (#13857) 2022-01-24 09:45:43 -05:00
Manuel de la Pena d0519351e8
[CI] Use old signing when running on a PR. (#13419) 2022-01-21 21:32:04 -05:00
Manuel de la Pena 02598ae1f3
[CI] Unify all the setup steps in a template. (#13835) 2022-01-21 21:31:35 -05:00
Manuel de la Pena d442e95079
[CI] Increate timeouts when reporting a device result. (#13841) 2022-01-21 21:31:00 -05:00
Manuel de la Pena 8c977fd52f
[CI] Parallel api diff (#13819)
If the lab has good capacity it reduces the PR build time by 10% by adding a new job and run the api diff in parallel.
2022-01-21 08:27:49 -05:00
Manuel de la Pena fa03429221
[CI] Call agent cleanser on device bots. (#13810) 2022-01-20 21:42:04 -05:00
Manuel de la Pena df1bc375c3
[CI] Allow to optionally skip API diff. (#13809)
Allow to skip it for several reasons:

1. We might want to seepd up a build during a release.
2. We want to make the build.yml template for pflexible, later we will
   have to instances, one for the diff one to run tests and build.
   Running those in parallel should buy us an hour in the total build.
2022-01-20 17:07:24 -05:00
Manuel de la Pena 543627e8e7
[CI] Bootstrap dotnet. (#13797) 2022-01-20 09:37:20 -05:00
Manuel de la Pena 300ecb3139
[CI] Allow to run macOS without devices. (#13785) 2022-01-19 11:35:36 -05:00
Manuel de la Pena 3e7330e559
[CI] Do not add not needed data in the device test comments. (#13743) 2022-01-18 10:49:53 -05:00
Manuel de la Pena 0fd461db67
[CI] Add missing warning and list element. (#13744) 2022-01-18 10:48:05 -05:00
Rolf Bjarne Kvinge 6564841c6a Merge remote-tracking branch 'origin/main' into dotnet-resolvedfiletopublish 2022-01-14 11:00:16 +01:00
Rolf Bjarne Kvinge 8cc4f3e6f8 [devops] Give our entire test run another 2 hours to complete. 2022-01-14 11:00:10 +01:00
Manuel de la Pena 3801e688bb
[CI] Refactor the artifacts parsing. (#13711) 2022-01-13 19:24:12 -05:00
Manuel de la Pena 1109fcea3a
[CI] Invert if to workaround a bad variable expansion. (#13698)
This is weird bug in the agent code.
2022-01-13 11:38:18 -05:00
Manuel de la Pena c5fb5dfa34
[CI] Refactor code out to a function. (#13672)
Make the code more readable, this is the first step to clean the scripts
and to be able to add a switch so that we can diff between comments for
device tests and general comments.
2022-01-12 20:09:26 -05:00
Manuel de la Pena 17fbe27c1a
[CI] Clean the WriteDiff function to follow the pwsh style. (#13674)
* Function names are {Verb}-{Action}
* Params start with a uppercase
* Function does not need to be exported, it is internal to the module.
2022-01-12 11:34:47 -05:00
Manuel de la Pena cea0cae2bf
[CI] Fix comment aligment and add a warning sign. (#13671)
Fix the comment so that it does not look like
94863148dc (commitcomment-63453915)
2022-01-11 19:50:30 -05:00
Manuel de la Pena db4b4548ea
[CI] Add missing env. (#13670) 2022-01-11 19:50:13 -05:00
Manuel de la Pena 33a41c6fe3
[CI] Upload the agent logs as an artifact. (#13667) 2022-01-11 19:48:32 -05:00
Manuel de la Pena 345f7a367e
[CI] Allow to retrieve the logs of the agent. (#13662) 2022-01-10 17:07:43 -05:00
Manuel de la Pena 94863148dc
[CI] Fix device tests (#13657)
Allow device tests to run. Tests do not pass yet, that has to be fixed in xharness.
2022-01-10 11:48:34 -05:00
Manuel de la Pena 148ab8cbe1
[CI] Use the correct dependency variable. (#13660) 2022-01-10 11:46:43 -05:00
Manuel de la Pena b52af4b4f9
[CI] Fix mac tests yaml error (#13653) 2022-01-06 16:25:28 -05:00
Manuel de la Pena 3f43eef35b
[CI] Add missing env. (#13570) 2021-12-15 08:55:01 -05:00
Rolf Bjarne Kvinge 69015b3cec
[dotnet] Honor 'TrimMode' to specify linker behavior if LinkMode/MtouchLink aren't set. Fixes #13518. (#13543)
* Change dotnet-linker to only care about whether we're actually trimming anything or not.
* Allow LinkMde/MtouchLink to not be set if TrimMode is set.
* Detect if any assemblies are linked or not by checking the global TrimMode
  property + any TrimMode properties on assemblies.

Fixes https://github.com/xamarin/xamarin-macios/issues/13518.
2021-12-15 09:27:00 +01:00
TJ Lambert b72ef031f7
[ApiDiff] Add Current PR Diffs in a similar style as API Diffs (#13512) 2021-12-14 22:19:36 -06:00
Manuel de la Pena 06bacc24a4
[CI] Allow to force a build to be usable for insertions. (#13563)
This change allows to have a parameter (false by default) that allows to
get a build to be able to do an insertion even when it is comming from a
not predefined branch.

Uses cases:

1. Trigger a buiild with no tests from a special branch to insert.
2. Work with the CI to test the deployment.
2021-12-14 18:08:59 -05:00
Manuel de la Pena 5c68aca748
[CI] Rearrange the parameters so that we have all booleans grouped. (#13564)
The UI uses the order in which the parmaeters are found in the file,
which makes it look ugly because it adds a text bos ni between all
options.
2021-12-14 17:19:33 -05:00
Manuel de la Pena bffe61eec2
[CI] Fix indentation mistake that made timeouts result in errors. (#13552) 2021-12-14 09:27:40 -05:00