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

2638 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 1c4a64c0c4
[EventKitUI] Add this framework to Mac Catalyst. (#14374)
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-04-01 14:29:30 +02:00
Rolf Bjarne Kvinge eda8f4822d
Bump our system/stable .NET to 6.0.201. (#14552) 2022-03-31 21:56:33 +02:00
Rolf Bjarne Kvinge 24b64e2349
[devops] Improve failure reporting for tests on older macOS bots. (#14486)
Try hard to always add a GitHub comment after (trying to) running macOS tests on other bots.

We now:

* Create a file with a generic error message at the very beginning.
* Update the error message if something we detect goes wrong (with a better error message).
* Delete the file in case of success.
* Check for the file at the very end, reporting any contents as a failure, and only if it doesn't exist, then we report success.

This way we'll pretty much always report _something_.
2022-03-31 21:56:08 +02:00
Steve Hawley 891610b533
[nnyeah] Warn on IConvertible (#14586)
set up warnings on IConvertible calls
2022-03-31 09:36:43 -04:00
Rolf Bjarne Kvinge 20713353ec
[devops] Add a GitHub comment if the build fails. (#14541) 2022-03-31 15:15:05 +02:00
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