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

2783 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 77bac878d6
[IdentityLookupUI] Add this framework to Mac Catalyst. (#14385)
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-03-31 14:20:08 +02:00
Rolf Bjarne Kvinge e687c20dd6
[AppClip] Add this framework to Mac Catalyst. (#14378)
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-03-31 13:52:52 +02:00
VS MobileTools Engineering Service 2 23026fb034
[main] [devops] Fix computing the BRANCH_NAME variable. (#14579)
This is what Azure Devops defines:

* Build.SourceBranchName: the last path component of the branch.
* Build.SourceBranch: the complete ref spec for the branch.

We want the branch name without the 'refs/heads/' part. Unfortunately we can't
use Build.SourceBranchName, because for a branch name like
'release/6.0.3xx-rc1' the last path component is '6.0.3xx-rc1', not
'release/6.0.3xx-rc' - in other words it doesn't have all the information we
need.

That means we need to use the Build.SourceBranch value instead, and remove the
'refs/heads/' part. We already compute BRANCH_NAME like this everywhere else,
so just copy that implementation.


Backport of #14568

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-03-31 08:41:44 +02:00
Steve Hawley 41b076cc0e
Lets do options (#14540)
* Remove existing attributes

* Attribute Conversion

* let's add some options and put in feedback

* don't need this check anymore

* Don't copy paste code without reading, Steve

* fallout from no more nulls

* catch exception from options parsing, check for file existence, fix white space

* whitespace

* add --force-overwrite

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-03-30 14:48:08 -04:00
Manuel de la Pena e5b8b196f7
[xtro] Fix xtro on dotnet. (#14559)
Use the workloads versions to point to the correct dll path when running in a diff bot than the one were the build was done.
2022-03-30 11:32:25 -04:00
Rolf Bjarne Kvinge 3b282198a0
[devops] Build xibuild manually before running the tests. (#14563)
Some tests will build xibuild automatically when needed, some won't. This
means that the ones that don't won't succeed if executed before the ones that
do.

To avoid this scenario, just manually build xibuild before running the tests.
2022-03-30 15:34:29 +02:00
Rolf Bjarne Kvinge c7ffdc9255
[devops] Fix typo. (#14562) 2022-03-30 15:22:19 +02:00
Manuel de la Pena 00f6902acf
[CI] Use public bots to run tests. (#14558)
The internal bots are giving issues running xtro, public ones are ok.
There is no real reason to use the internal pool to run tests and we can
debug the bots in that pool better.

We move to run tests in the public bots unless told otherwise (when
using devices for example).
2022-03-30 09:20:32 -04:00
Rolf Bjarne Kvinge becdade8d2
[nnyeah] Fix path to nnyeah.dll. (#14554)
This makes rebuilds detect that the dll has already been built.
2022-03-29 15:34:06 -04:00
Rolf Bjarne Kvinge ee302b17c3
Revert "[nnyeah] Fix makefile to use msbuild. (#14533)" (#14546)
This reverts commit 073165fef6.

Fixes this build error:

/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/Microsoft.Common.CurrentVersion.targets(1232,5): error MSB3971: The reference assemblies for ".NETFramework,Version=v5.0" were not found. You might be using an older .NET SDK to target .NET 5.0 or higher. Update Visual Studio and/or your .NET SDK. [/Users/rolf/work/maccore/dotnet/xamarin-macios/tools/nnyeah/nnyeah/nnyeah.csproj]
gmake[2]: *** [Makefile:9: bin/Debug/net5.0/nnyeah.dll] Error 1
2022-03-29 15:45:09 +02:00
Manuel de la Pena 073165fef6
[nnyeah] Fix makefile to use msbuild. (#14533) 2022-03-28 16:54:56 -04:00
Steve Hawley 6487ec485e
Lets do warnings (#14510)
* Remove existing attributes

* Attribute Conversion

* Added some events

* init only properties and uint

* propagation error
2022-03-28 16:06:54 -04:00
Rolf Bjarne Kvinge 622a1c9d61
[devops] Keep dependency selection logic together. (#14519) 2022-03-28 20:36:00 +02:00
Manuel de la Pena b8cb374aee
[CI] Disable the windows integration tests until we have the lab setup. (#14507) 2022-03-28 12:15:43 -04:00
Manuel de la Pena f2c9749d4d
[CI] Add the job id tot he agent logs. (#14505)
It can happen that we use the same agent for more than one bot, if that
is the case, we need to make sure that we do not have the same name for
the logs. We use the job id + job name for that.
2022-03-28 11:54:04 -04:00
Manuel de la Pena 3f698c47d9
[nnyeah] Add tool to be made via makefiles. (#14513)
Adding the needed Makefile and the dir to the parent one so that the
tool is also built in the CI.


Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-03-28 11:52:59 -04:00
Manuel de la Pena af00cc664b
[nnyeah] Update usage to dotnet. (#14514) 2022-03-28 11:52:04 -04:00
Rolf Bjarne Kvinge 685cf52bff
[dotnet-linker] Always use 'dlsym' on Mac Catalyst to work around #14437. (#14483)
The problem is:

1. On Mac Catalyst we AOT-compile managed code by default (since we can't JIT).
2. We recently added a binding for the `ASAuthorizationAllSupportedPublicKeyCredentialDescriptorTransports` native function, which is only available on Mac Catalyst 15+. The containing framework (`AuthenticationServices`) is available in Mac Catalyst 13+ (which means we won't link weakly with the framework).
3. The AOT compiler emits a non-weak reference to the `ASAuthorizationAllSupportedPublicKeyCredentialDescriptorTransports` symbol.
4. macOS verifies that there aren't any undefined non-weak symbol references at launch.
5. The `ASAuthorizationAllSupportedPublicKeyCredentialDescriptorTransports` symbol doesn't exist on macOS 11, and thus the app crashes at launch on macOS 11.

I tried the same thing on iOS, and the problem doesn't occur because iOS doesn't to step 4 - the symbol reference are resolved at first use, which means that everything works just fine until the first time the P/Invoke is called (and then the app aborts).

The workaround is to tell the AOT compiler to not emit a direct reference to the P/Invoke (and use dlsym instead) - this fixes case 3) above. Drawbacks: dlsym is slower than a direct reference.

Fixes https://github.com/xamarin/xamarin-macios/issues/14437.
2022-03-28 08:58:37 +02:00
Rolf Bjarne Kvinge 1e8e4bb69b
[devops] Stop asking *all* tests print *all* stack traces. (#14499)
This makes stdout much more readable.

It also fixes https://github.com/xamarin/maccore/issues/2562.
2022-03-28 08:29:56 +02:00
Rolf Bjarne Kvinge d3ee7165f4
[devops] Fix typo on step name. (#14500) 2022-03-28 08:05:11 +02:00
Manuel de la Pena d36d87f11e
[CI] Checkout the head ref rather than the merge or a reset, this should fix issues with the test selector. (#14496) 2022-03-25 11:38:52 -04:00
Rolf Bjarne Kvinge cfdccdc086
[devops] Upload binlogs from the tests run as well as the build. (#14458) 2022-03-25 16:38:02 +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 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 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
Manuel de la Pena 97ca13a358
[CI] Do not use the ciBuild tag for cronjobs. (#13553)
The tag is used by the release pipeline to indentify builds that we can
release from. This will ensure we do not get releases from the cronjobs.
2021-12-14 09:27:18 -05:00
Rolf Bjarne Kvinge 7b753916d8
[dotnet-linker] We must store the availability attributes when linking. (#13547)
We must store the availability attributes when linking, so that the registrar
can access them when the linker is done linking the app.

Fixes this test failure:

* Xamarin.Registrar.MT4162_dotnet(iOS,"iOS",LinkAll)

Ref: https://github.com/xamarin/xamarin-macios/issues/13517
2021-12-14 08:20:05 +01:00
Rolf Bjarne Kvinge ce7e49d9df
[dotnet-linker] Touch the build output to avoid make confusion. (#13549)
Make gets confused sometimes if running a rule doesn't update the timestamp of
the target of those rules (and make may in certain cases end up with an
infinite loop).

Avoid this by making sure to always update the timestamp of the
dotnet-linker.dll we build, even if MSBuild decides no re-compilation was
necessary.
2021-12-14 08:19:41 +01:00
Rolf Bjarne Kvinge c85d7721d5
[dotnet] Pass -dead_strip to the native linker when we can. (#13541)
Pass -dead_strip to the native linker like we do for legacy Xamarin:

* If there are no custom linker arguments.
* If all third-party bindings in the app has SmartLink = true (this doesn't
  show up in the PR, but the logic exists for legacy Xamarin and is already
  executed for .NET, the resulting Application.DeadStrip value just wasn't
  taken into account).

This shrinks the app size a bot for a Hello World app:

* Before:     10.659.731 (https://gist.github.com/rolfbjarne/b5892a5c7fb8663d38e2b69f67bce90c)
* After:       9.940.240 (https://gist.github.com/rolfbjarne/8404394180fb9971bd2f1475b747c70a)
* Difference:   -719.491 (-6.7 %)
2021-12-13 20:41:43 +01:00
Manuel de la Pena bf26c64e72
[CI] Add missing import directive. (#13537) 2021-12-11 14:25:24 -05:00
Manuel de la Pena dee9381b4b
Revert "[CI] Use Build artifacts so that they are copied to the release pipeline. (#13501)" (#13538)
This reverts commit 3977d7531d.
2021-12-11 14:25:14 -05:00
Manuel de la Pena 9a07446244
[CI] Add a better comment when we add code in the static page. (#13528) 2021-12-10 08:25:09 +01:00
Manuel de la Pena 5c4db77a15
[CI] Increase timeouts so that we do not have failures. (#13529)
We have added more files and the API seems to take long sometimes,
increase the timeouts to avoid failures like in https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=5532523&view=logs&j=704af8c3-a112-593d-cee6-636e1ea22709&t=62b5d5ee-dc4f-530c-7279-a3bef6bd6bc7
2021-12-10 08:24:42 +01:00
Rolf Bjarne Kvinge a94e575806
[tools] Unify Application.link_flags and Application.gcc_flags from mtouch and mmp into Application.CustomLinkFlags. (#13509)
* [tools] Unify Application.link_flags and Application.gcc_flags from mtouch and mmp into Application.CustomLinkFlags.

* [tests] Update mtouch tests according to mtouch changes.
2021-12-09 17:16:45 +01:00
Manuel de la Pena eb7bb62b6b
[CI] Check that the mac tests are indeed present. (#13510)
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-12-08 17:14:19 -05:00
Rolf Bjarne Kvinge 90b8e89859
[src] Remove System.nint and System.nuint from .NET. Fixes #10508. (#13490)
* Remove System.nint and System.nuint from .NET
* Add support for C#'s nint/nuint types to the generator.
* Accept IntPtr/UIntPtr as target types for BindAs attributes for NSNumber conversions.
* Fix a few APIs to take/return NativeHandle instead of IntPtr.

Fixes https://github.com/xamarin/xamarin-macios/issues/10508.
2021-12-07 21:12:46 +01:00
Manuel de la Pena aff9d1902c
[CI] Remove all macOS Mohave. (#13508) 2021-12-07 14:41:06 -05:00
Manuel de la Pena 3977d7531d
[CI] Use Build artifacts so that they are copied to the release pipeline. (#13501) 2021-12-07 12:11:08 -05:00
Manuel de la Pena 8ec686c333
[CI] If we could not create a gist do not throw an error. (#13483) 2021-12-03 17:41:29 -05:00
Manuel de la Pena d0f5e32862
[CI] Move to use the job not the stage. (#13495) 2021-12-03 13:36:33 -05:00
Manuel de la Pena 598261e73d
[Make] Remove targets that are not longer needed and dependencies. (#13485) 2021-12-03 11:37:01 -05:00
Rolf Bjarne Kvinge 23ac0f520f [registrar] Accept IntPtr/UIntPtr as target types for BindAs attribute for NSNumber conversions. 2021-12-03 08:02:49 +01:00
Rolf Bjarne Kvinge f8b6699ab2 Merge remote-tracking branch 'origin/main' into arm64-sim 2021-12-02 09:38:36 +01:00
Rolf Bjarne Kvinge 5cc92ac564
[src] Add a new ObjCRuntime.NativeHandle type to represent native handles for .NET. Fixes #13126. (#13356)
Add a new struct, ObjCRuntime.NativeHandle, which will be used to represent
native handles for .NET (instead of using IntPtr). The main purpose is to be
able to use 'nint' as a number in API while not being prevented from using
native handles as well.

One example is NSMutableString, which has a constructor that takes a single
'nint capacity' parameter. With this change, we'll also be able to have a
constructor that takes a native handle in .NET - otherwise we'd have two
constructors with the same signature, because a C# 'nint' is just an 'IntPtr'.

This change required numerous changes pretty much everywhere. The work is
split up in commits as well as I was able to, and each commit explains what it
does.

Fixes https://github.com/xamarin/xamarin-macios/issues/13126.
2021-12-02 08:38:39 +01:00
Rolf Bjarne Kvinge 006bb5a7a0
[apidiff] Remove logic referencing the Mac Catalyst version of Xamarin.iOS.dll. (#13476)
We don't create a Mac Catalyst version of Xamarin.iOS.dll anymore, so there's
nothing to run an api diff on.
2021-12-01 17:27:18 +01:00
Rolf Bjarne Kvinge 3bb83a5a27 [tool] Use dlsym by default in the simulator to look up native functions. 2021-11-30 18:20:43 +01:00
Rolf Bjarne Kvinge 7d37ff3117 [tools] Change Application.IsAOTCompiled return true if we're targetting arm64 on a simulator 2021-11-30 18:20:43 +01:00
Rolf Bjarne Kvinge e7ad14d09c [tools] Set AOT mode to full if we're building for ARM64 for simulators 2021-11-30 18:20:43 +01:00
Rolf Bjarne Kvinge 0836b0c758 [mtouch] Add logic to determine whether we're building for simulator or device based on runtime identifier. 2021-11-30 18:20:43 +01:00
Rolf Bjarne Kvinge b4aae072c8 [runtime] Build for ARM64/simulators. 2021-11-30 18:20:42 +01:00
Manuel de la Pena d48ee5a585
[CI] Do call the isnertion tempalte on release pipelines. (#13438) 2021-11-29 11:14:00 -05:00
Rolf Bjarne Kvinge 6220b0fd11 [linker] Preserve the NativeHandle constructor now. 2021-11-26 14:25:21 +01:00
Rolf Bjarne Kvinge 698fbbbe49 [registrar] Teach the static registrar about the new NativeHandle type 2021-11-26 14:25:19 +01:00
Rolf Bjarne Kvinge 6ce8ac93c0 Merge remote-tracking branch 'origin/main' into src-remove-legacy-maccatalyst 2021-11-25 08:11:32 +01:00
Manuel de la Pena 2022a93cce
[CI] Allow to manually skip governance tests when triggering a build by hand. (#13379) 2021-11-22 15:23:22 -05:00
Rolf Bjarne Kvinge 5329b19f62
[introspection] Migrate .NET code to use the new .NET-style availability attributes. (#13363)
* [tools] Extract the logic to parse OSPlatformAttribute platform names to a separate file/class.

* [introspection] Migrate .NET code to use the new .NET-style availability attributes.

This also means using the 'ApplePlatform' enum instead of the 'PlatformName'
enum, because the latter will be removed in .NET.

* [FileProvider] Exclude some deprecated API from .NET.

* [AVFoundation] Adjust availability attribute for AVCaptureStillImageOutput.HighResolutionStillImageOutputEnabled.

* Update tests.
2021-11-22 20:54:07 +01:00
Rolf Bjarne Kvinge 88eb5e1ac8
Rename any *OSX_SDK_VERSION variables to *MACOS_SDK_VERSION. (#13411)
This makes it easier to iterate over all the *_SDK_VERSION variables in
template code, because they're all named using the standard platform names we
use elsewhere.
2021-11-22 18:48:05 +01:00
Manuel de la Pena e192be9465
[CI] Renable the steps to run the device tests (#13407) 2021-11-22 10:05:26 -05:00
Rolf Bjarne Kvinge 72c369ad7e
[devops] Install our provisioning profiles before the actual build as well. (#13412)
Install our test provisioning profiles + certificates before the build,
because we might need them during the build for the hotrestart prebuilt app.

Ref: https://github.com/xamarin/xamarin-macios/issues/13355.
2021-11-22 08:13:55 +01:00
Rolf Bjarne Kvinge 7d5cb3c2b9
[build] Add support for not building for Xamarin.Mac. (#13385)
While generally not useful, because we need Xamarin.Mac to build mlaunch, it
comes in handy sometimes to be able to disable the Mac build (if we do, we'll
automatically use the prebuilt mlaunch binary from macios-binaries).
2021-11-18 15:38:20 +01:00
Manuel de la Pena ee77d2ee11
[CI] Add display names so that we understand the ui better. (#13382) 2021-11-18 09:36:31 -05:00
Rolf Bjarne Kvinge 76d4b9f798
[mtouch] Remove duplicated source file from project file. (#13361)
Fixes:

> CSC : warning CS2002: Source file '.../xamarin-macios/tools/mtouch/Errors.Designer.cs' specified multiple times [.../xamarin-macios/tools/mtouch/mtouch.csproj]
2021-11-17 18:02:19 +01:00
Manuel de la Pena e29867c2b8
[CI] Move the signature to ESRP (#13376)
Move to use the ESRP service to perform the signing of the frameworks and pkgs.
2021-11-17 10:28:46 -05:00
Rolf Bjarne Kvinge 7a76bbeb64
[tools] HomeKit was added to Mac Catalyst in 14.0, so mark it as such. (#13333)
* [tools] HomeKit was added to Mac Catalyst in 14.0, so mark it as such.

Fixes this launch crash when executing on macOS 10.15:

    dyld: Library not loaded: /System/iOSSupport/System/Library/Frameworks/HomeKit.framework/Versions/A/HomeKit
      Referenced from: /Users/runner/work/1/s/artifacts/mac-test-package/tests/./linker/ios/dont link/dotnet/MacCatalyst/bin/Debug/net6.0-maccatalyst/maccatalyst-x64/dont link.app/Contents/MacOS/dont link
      Reason: image not found

* [introspection] Skip the default SKView constructor on all platforms, not only macOS.

Fixes a crash on Mac Catalyst.

* Fix SKView skipping logic.
2021-11-15 08:04:56 +01:00
Rolf Bjarne Kvinge 9154b6eddd
[mtouch] Fix logic to determine whether we're using Mono.framework on watchOS. (#13343)
The previous "8.0" sdk version check is incorrect (that's "iOS 8.0", the first
iOS version to add support for user frameworks). However, it started kicking
in for watchOS 8.0, and now suddenly we're trying to build all watchOS
extensions with Mono.framework, which is not what we want.

Instead modify the code to:

* Split by platform, keep the existing behavior for iOS, tvOS and Mac Catalyst
  (since "8.0" is the correct version check for all those platforms).
* Use the Mono framework in watchOS if either of the following are true:
	* In the main watchOS extension if it has nested extensions.
	* In any other extensions (because they'll be nested extensions).

Fixes: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1430408
2021-11-12 07:33:44 +01:00
Manuel de la Pena 4f8a0e624a
[CI] Remove a OS check not longer needed after the bots have been updated. (#13345) 2021-11-11 17:59:34 -05:00
Rolf Bjarne Kvinge 2d9b9a1004
[devops] Add a 30/60 minute timeout to the steps to install dependencies + run macOS tests. (#13341) 2021-11-11 20:07:43 +01:00
Rolf Bjarne Kvinge 7b2699c5ad
[compare-commits] Ignore *.binlog files when creating a diff of the generated files. (#13338)
Removes this from the generator diff, which happens on every build:

    diff --git a/build/common/bgen.exe.binlog b/build-new/common/bgen.exe.binlog
    index fc4ecd1fe..3b0503171 100644
    Binary files a/build/common/bgen.exe.binlog and b/build-new/common/bgen.exe.binlog differ
2021-11-11 15:33:43 +01:00
Rolf Bjarne Kvinge 06295499ed
[mtouch/mmp/dotnet-bundler] Rework getting the availability attributes so that it works for .NET as well. (#13327)
* Stop using AvailabilityBaseAttribute, this type will disappear in .NET.
* Handle System.Runtime.Versioning.SupportedOSPlatformAttribute instead of our own availability attributes for .NET.
* Add tests (somewhat hacked together, but they work).
2021-11-10 22:55:12 +01:00
Manuel de la Pena bc3df9ec21
[CI] Do not try to find the minor version until a bug is fixed. (#13334)
The agent is not reporting the OS version property and returns only
11.0. This has been fixed in:

https://github.com/microsoft/azure-pipelines-agent/pull/3605

But this was not yet landed.
2021-11-10 16:05:45 -05:00
Manuel de la Pena b34cb0f384
[CI] Remove 10.13 tests (#13326)
The internal image is not longer supported and we do not have
self-hosted bots for the version of the OS.

We remove the tests since they wont pick up any agent.
2021-11-09 16:00:35 -05:00
tj_devel709 0865c816ce [ApiDiff] Remove other MacCatalyst references 2021-11-09 10:58:10 -06:00
Manuel de la Pena 62b66735df
[CI] Provide the stage that does the different steps to prepare for an insertion. (#13313) 2021-11-09 07:33:29 -05:00
Manuel de la Pena b94f6f5e4a
[CI] Download all the artifacts based on a triggered build. (#13311) 2021-11-08 17:21:03 -05:00
Manuel de la Pena 9469f5780b
[CI] Do not set the stage to failure on mac tests fails. (#13285)
We want to use release pipelines but they do not like failing tests. In
device tests we set those in the pipeline to green yet we add a comment,
we do the same with the mac tests.
2021-11-08 17:20:27 -05:00
Manuel de la Pena 308750e473
[CI] Use images for older macOS. (#13284) 2021-11-08 17:19:32 -05:00
Rolf Bjarne Kvinge c038879251
[devops] Add a download link to the Html Report entry in the GH summary comment. (#13302)
Sometimes you just need the whole thing.
2021-11-08 21:03:20 +01:00
VS MobileTools Engineering Service 2 9daff111e6
Localized file check-in by OneLocBuild Task: Build definition ID 14411: Build ID 5419189 (#13301) 2021-11-08 14:22:09 -05:00
Manuel de la Pena 303019509d
[CI] Request min version for device tests in the host os. (#13286) 2021-11-08 11:41:18 -05:00
Rolf Bjarne Kvinge 1713d7dd6a
[WatchKit] Remove the WatchKit framework from iOS in .NET. (#13299)
Apple removed it from iOS a few years ago.
2021-11-08 16:17:26 +01:00
Rolf Bjarne Kvinge 384884f549
[mtouch/mmp] Fix code to report a warning, not only create it. (#13297) 2021-11-08 16:17:00 +01:00
Rolf Bjarne Kvinge ce132f781e
[api-diff] Bump to latest stable (xcode13.1 branch) + add support for different reference api urls for legacy iOS and Mac. (#13292)
* Update README with new releases.

* [api-diff] Bump to latest stable (xcode13.1 branch) + add support for different reference api urls for legacy iOS and Mac.

Also fix make logic to only have a single rule per hash, which avoids a few
make warnings about duplicate targets.
2021-11-08 16:15:58 +01:00
Rolf Bjarne Kvinge 17d544f2b0
[iAd] Remove this framework from .NET. (#13269)
* [iAd] Remove this framework from .NET.

* [src] Use a different response file with HAS_<framework> defines for .NET.

This allows us to have different HAS_<framework> values for the .NET build (to
take into account frameworks that has been removed).

* Make the .NET framework removal logic per-platform.

* Use a different pattern in the rule to not match another pattern rule.
2021-11-05 08:07:18 +01:00
Manuel de la Pena 2db351bab5
[CI] Use a vimage for 10.15 since we do not have actual bots. (#13259) 2021-11-04 11:54:08 -04:00
Rolf Bjarne Kvinge 4b81c5d143
[QTKit] Remove the QTKit framework from .NET. (#13224)
The QTKit framework does not exist on macOS anymore, so just remove our
bindings for it now that we can break compatibility.

Fixes a lot of errors like this when building with XAMCORE_4_0:

> build/dotnet/macos/generated-sources/Accessibility/AXCategoricalDataAxisDescriptor.g.cs(14,7): error CS0246: The type or namespace name 'QTKit' could not be found (are you missing a using directive or an assembly reference?)
> build/dotnet/macos/generated-sources/Accessibility/AXChart.g.cs(14,7): error CS0246: The type or namespace name 'QTKit' could not be found (are you missing a using directive or an assembly reference?)
> build/dotnet/macos/generated-sources/Accessibility/AXChartDescriptor.g.cs(14,7): error CS0246: The type or namespace name 'QTKit' could not be found (are you missing a using directive or an assembly reference?)
> build/dotnet/macos/generated-sources/Accessibility/AXChartDescriptorContentDirection.g.cs(14,7): error CS0246: The type or namespace name 'QTKit' could not be found (are you missing a using directive or an assembly reference?)
> build/dotnet/macos/generated-sources/Accessibility/AXCustomContent.g.cs(14,7): error CS0246: The type or namespace name 'QTKit' could not be found (are you missing a using directive or an assembly reference?)
> build/dotnet/macos/generated-sources/Accessibility/AXCustomContentImportance.g.cs(14,7): error CS0246: The type or namespace name 'QTKit' could not be found (are you missing a using directive or an assembly reference?)
> [...]
2021-11-03 08:48:34 +01:00
Rolf Bjarne Kvinge f0b72a004d
[apidiff] Fix rule to download reference assemblies. (#13174)
Make seems to ignore pattern rules without a recipe, so just add an empty
recipe for this pattern rule.

Fixes:

> make: *** No rule to make target `temp/downloads/dotnet-iOS-5315390/Microsoft.iOS.Ref/ref/net6.0/Xamarin.iOS.dll', needed by `references/dotnet/Microsoft.iOS.Ref/ref/net6.0/Xamarin.iOS.xml'.  Stop.
2021-10-29 15:51:55 +02:00
Rolf Bjarne Kvinge 8062817500 [apidiff] Remove API diff for legacy Xamarin.MacCatalyst. 2021-10-28 18:29:28 +02:00
Rolf Bjarne Kvinge 280347e1ee [src] Remove the legacy build of Xamarin.MacCatalyst.dll
We decided some time ago that Mac Catalyst will only be supported in .NET, so
this is not necessary.
2021-10-28 18:18:22 +02:00
Rolf Bjarne Kvinge 02431b9fc8
[.NET] Move the nfloat type to the ObjCRuntime namespace for .NET. (#13092)
Also move the NMath type from the System namespace to the ObjCRuntime namespace.

Ref: https://github.com/xamarin/xamarin-macios/issues/13087
2021-10-28 11:06:31 +02:00
Mike Bond 606908acd6
[CI] M1 - Mac Big Sur (11.5): Agent pool update (#13095) 2021-10-26 14:01:15 -07:00
Rolf Bjarne Kvinge c3574a53a3
[generator] Use '[U]IntPtr' in P/Invoke signatures instead of 'n[u]int'. (#13043)
* [generator] Use '[U]IntPtr' in the P/Invoke signature for native enums.

* Use '[U]IntPtr' as the parameter type in the P/Invoke signature for native enum
  parameters.
* Use '[U]IntPtr' in the P/Invoke method name for native enum parameters.
* Add an explicit conversion from UIntPtr to nuint (like we already have from IntPtr
  to nint).

This makes the code identical between .NET and legacy Xamarin when using C# n[u]ints,
because those are really [U]IntPtrs.

* Use IntPtr/UIntPtr for all nint/nuint types in P/Invokes, not only native enums.

* Add a few more casts

Fixes these generator tests:

* GeneratorTests.BGenTests.FieldEnumTests
* GeneratorTests.BGenTests.NativeEnum

* [registrar] Handle UIntPtr like we do IntPtr.

Fixes this error in numerous tests:

    error MT4169: Failed to generate a P/Invoke wrapper for objc_msgSend(System.IntPtr,System.IntPtr): The registrar cannot build a signature for type `System.Void' in method `ObjCRuntime.Messaging.objc_msgSend`.

* [NativeTypes] Make IntPtr and UIntPtr behave the same.

This fixes an issue where the linked output for a 32-bit mscorlib.dll and a
64-bit mscorlib.dll would be different, because different explicit operators
for UIntPtr would be kept.

The fix works because the conversion operators for nuint will not use
UIntPtr's explicit conversion operators anymore, it will just operate on plain
memory instead.
2021-10-25 10:56:02 +02:00
TJ Lambert 560d777b92
[ApiDiffs] Applying the New Dotnet ApiDiffs to Github (#13027) 2021-10-22 10:25:33 -05:00
Rachel Kang 410237ff14
Merge pull request #13056 from rachelkang/xcode13.0-intentsui-b1-b4
[IntentsUI] Update bindings for Xcode13.0 betas 1, 4
2021-10-22 11:02:05 -04:00
Rolf Bjarne Kvinge af23d61926
[runtime] Fix a toggle ref deadlock when retaining objects. Fixes #13066. (#13071)
The deadlock goes like this:

1. Thread A holds the framework_peer_release_lock lock, and tries to lock the
   refcount_mutex lock.
2. Thread B holds the refcount_mutex, and is waiting for the GC to complete
3. Thread C is trying to lock the framework_peer_release_lock while running
   the GC.

The fix is in thread A, by not doing anything at all with the
framework_peer_release_lock lock locked.

The code contains extensive comments explaining the situation and the solution.

Fixes https://github.com/xamarin/xamarin-macios/issues/13066.

Co-authored-by: Chris Hamons <chris.hamons@xamarin.com>
2021-10-22 09:05:07 +02:00
Rachel Kang 56b454a8cb
[IntentsUI] Update bindings for Xcode13.0 betas 1,4 2021-10-20 14:33:42 -04:00
TJ Lambert 5819dc7a10
[ApiDiffs] Creating Api Diffs for the Dotnet Assemblies (#12886) 2021-10-15 12:04:35 -05:00
VS MobileTools Engineering Service 2 b1b4285109
Localized file check-in by OneLocBuild Task: Build definition ID 14411: Build ID 5313177 (#12967) 2021-10-11 10:26:55 -05:00
Rolf Bjarne Kvinge 7339b27a43
[devops] Show a better message when ESRP fails (#12934)
* Show a better error in the GitHub comment if ESRP signing failed.
* Show a better message when supposedly signed packages fail signature validation.
2021-10-08 08:02:24 +02:00
Manuel de la Pena ed3d9fd74c
[CI] Add empty insertion pipeline to be used in release. (#12888) 2021-10-07 11:54:54 -04:00
Manuel de la Pena d86d23fdf5
[CI] Fix path to script. (#12949) 2021-10-07 07:30:41 +02:00
Rolf Bjarne Kvinge 7a6c6fcf80
[devops] Return a non-zero exit code if tests fail on older macOS versions. (#12937)
Return a non-zero exit code if tests fail on older macOS versions, but keep
running tests. This way the step shows up as orange if something fails (and
not green, which is confusing).
2021-10-06 18:56:40 +02:00
VS MobileTools Engineering Service 2 c0032bee1a
Localized file check-in by OneLocBuild Task: Build definition ID 14411: Build ID 5286115 (#12916) 2021-10-06 08:31:25 -05:00
Rolf Bjarne Kvinge 63de01c21c
[tests] Fix packaging of Xamarin.Mac tests. (#12776)
I recently deleted the generated makefile support for building and running our
test suites. It turned out that it was used for building the packaged
Xamarin.Mac tests, so it wasn't as unused as I thought.

So fix the building and packaging of Xamarin.Mac tests to not use the
(non-existent) makefile targets, but instead replicate it with manual make
code.

Also take the opportunity to add packaging and execution of the .NET versions
of these test suites we execute on other macOS versions (both for macOS and
the Mac Catalyst).

* [devops] Use stricter matching when finding the Xamarin.Mac pkg link.

Otherwise the branch name in any package could end up matching the pattern we
were looking for:

	XM_PACKAGE=https://bosstoragemirror.blob.core.windows.net/wrench/tests-package-xamarin-mac-tests/15759261d425ae08494b0a26862a0b1356c5f8ec/5268864/package/Microsoft.iOS.Bundle.15.0.101-ci.tests-package-xamarin-mac-tests.68.pkg

is just clearly wrong.
2021-10-06 08:10:07 +02:00
Manuel de la Pena 3e3baf1463
[CI] Rollback changes. (#12931) 2021-10-04 18:37:17 -04:00
Manuel de la Pena c6106d87e1
[CI] Service connections cannot be variables. 2021-10-04 18:22:00 -04:00
Manuel de la Pena 36185fac8a [CI] Move auth to a template. 2021-10-04 18:19:12 -04:00
Manuel de la Pena 68747ec1de
[CI] YAML gets confused by the $() syntax. 2021-10-04 18:10:38 -04:00
Manuel de la Pena c096a7ba59
[CI] Use correct var everywhere. 2021-10-04 18:05:10 -04:00
Manuel de la Pena 2565328c0e
[CI] Pass var correctly. 2021-10-04 18:03:20 -04:00
Manuel de la Pena e7f6c454d1
[CI] Fix if to ensure we can execute in the public instance. 2021-10-04 17:59:35 -04:00
Manuel de la Pena f343ee7ade
[CI] Cannot use condition. (#12930)
Using a condition will result in the template being generated which
results in the security check to run. We need to use a template and not
a condition to avoid it.
2021-10-04 17:51:31 -04:00