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

13973 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge a020f09979
[tests] Update the cecil tests to run on .NET assemblies. (#15969)
And not legacy assemblies if the legacy build is disabled.
2022-09-19 11:52:23 +02:00
Rolf Bjarne Kvinge 9e04da9006
[xharness] Fix typo in method name. (#15968) 2022-09-19 11:51:05 +02:00
Rolf Bjarne Kvinge 7908a319e6
[actions] Add GitHub action to automatically format code. (#15935)
Implement a GitHub action to automatically format our source code.

This is implemented in two steps:

1. A restricted action is used to check if the code has any formatting issues, and if so, creates a patch to fix the code.
2. Another action is used to commit and push the patch (and add a comment to the PR notifying the submitter about the problems found).

This is because the first action will call 'dotnet format', which might be insecure in that it can execute code from the repository. This is not safe in a context that is allowed to push commits (because there are secrets in the environment) - so anyone could create a PR that would be executed as a part of 'dotnet format' and then look for our secrets and make them public. The restricted action's environment does not have any secrets, and it's thus safe to execute random code.

The second action will only execute if the corresponding file is in main, so this PR need to be merged before this can be fully implemented, and as such I've made the autoformatting opt-in (by adding the `actions-enable-autoformat` label). Once everything is confirmed to work properly, it will become opt-out instead.

Also, for now only a very simple project is autoformatted (xibuild.csproj), but the
idea is to fix source code incrementally, and add to the list of projects/code
we autoformat.
2022-09-19 11:48:10 +02:00
dotnet-maestro[bot] eab2bca993
[main] Update dependencies from dotnet/installer (#15424)
This pull request updates the following dependencies

## Coherency Updates

The following updates ensure that dependencies with a *CoherentParentDependency*
attribute were produced in a build used as input to the parent dependency's build.
See [Dependency Description Format](https://github.com/dotnet/arcade/blob/master/Documentation/DependencyDescriptionFormat.md#dependency-description-overview)

- **Coherency Updates**:
  - **Microsoft.AspNetCore.App.Ref**: from 6.0.5 to 6.0.9 (parent: Microsoft.Dotnet.Sdk.Internal)

## From https://github.com/dotnet/installer
- **Subscription**: be6e1947-9e64-4217-c50e-08da52a3899f
- **Build**: 20220915.1
- **Date Produced**: September 15, 2022 7:51:35 AM UTC
- **Commit**: 1c38151cabb5771a1503aff6e5cecb435be4c69c
- **Branch**: refs/heads/release/6.0.4xx

- **Updates**:
  - **Microsoft.Dotnet.Sdk.Internal**: [from 6.0.301-rtm.22280.1 to 6.0.402-servicing.22465.1][147]
  - **Microsoft.AspNetCore.App.Ref**: [from 6.0.5 to 6.0.9][148]

[147]: 283e9cf...1c38151
[148]: https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore/branches?baseVersion=GCe5f183b&targetVersion=GC3fe12b9&_a=files

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Co-authored-by: GitHub Actions <github-actions@xamarin.com>
2022-09-19 11:38:44 +02:00
Rolf Bjarne Kvinge 8a1cb74f9f
Make it easy to figure out which versions we're building. (#15976)
Just do `make show-versions`:

    $ make show-versions
    Building:
        The legacy package(s):
            Xamarin.iOS 15.13.0.132
            Xamarin.Mac 8.13.0.132
        The .NET NuGet(s):
            Microsoft.iOS 15.4.436-ci.show-versions+sha.405ff7c275
            Microsoft.tvOS 15.4.436-ci.show-versions+sha.405ff7c275
            Microsoft.MacCatalyst 15.4.436-ci.show-versions+sha.405ff7c275
            Microsoft.macOS 12.3.436-ci.show-versions+sha.405ff7c275
2022-09-16 18:42:57 +02:00
Rolf Bjarne Kvinge 77a95b248d
[devops] Only add platforms we're building for into WorkloadRollback.json. (#15973)
Also move bash code from yml to a .sh file for easier reading, writing and
debugging.
2022-09-16 18:42:26 +02:00
Rolf Bjarne Kvinge 41d71ff313
[build] Fix a c&p mistake in the code to compute the prerelease identifier. (#15970) 2022-09-16 18:40:25 +02:00
Rolf Bjarne Kvinge f9c5070c0e
[tests] Remove unused/dead code. (#15967) 2022-09-16 18:37:55 +02:00
Rolf Bjarne Kvinge 4643e42b7d
[tests] Introspection does not use simlauncher64-sgen.framework in .NET. (#15966) 2022-09-16 18:37:34 +02:00
Rolf Bjarne Kvinge 01352fa675
[tools] We still need to build mtouch+mmp for .NET. (#15965)
Because we use mtouch and mmp to build the partial static registrar code for .NET.

Eventually we'll look into generating the partial static registrar some other
way, but that's for another time.
2022-09-16 18:37:13 +02:00
Rolf Bjarne Kvinge 57ee60106b
[tests] We do not need qa-dependencies.zip anymore. (#15964)
This was used in the old Xamarin days.
2022-09-16 18:36:51 +02:00
Chris Hamons efa2935a9d
[foundation] Add lowPowerModeEnabled to macOS (#15940)
- Fixes https://github.com/xamarin/xamarin-macios/issues/15932
2022-09-16 10:37:17 -05:00
Emanuel Fernandez Dell'Oca 4b49ddda8f
[msbuild] Hot Restart fixes (#15979)
Adds missing css files needed on Maui Blazor apps and avoids copying unnecessary files into the bundle (overdue task since the .NET migration).

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-09-16 17:31:04 +02:00
Rolf Bjarne Kvinge fbb39bc2cf
[dotnet] Fix markdown syntax in BundleContents.md (#15962) 2022-09-15 15:41:25 +02:00
Rolf Bjarne Kvinge 77bba5ce3a
[devops] Add some debug code to figure out a random error. (#15947)
The 'Expand tests.' step sometimes fails with:

> ##[error]Bash exited with code '1'.

Which is very unhelpful. Make bash more verbose to see if we can figure out what's going wrong.
2022-09-15 12:00:31 +02:00
Rolf Bjarne Kvinge 3545f9ce23
[devops] Remove unused file. (#15945)
It seems this file hasn't been used since b1ea4b51aa.
2022-09-15 11:59:49 +02:00
Rolf Bjarne Kvinge 1f3fb41d63
[devops] Improve check for crash reports before collecting them. (#15938)
Otherwise this happens if the directory is empty:

    + test -d /Users/runner/Library/Logs/DiagnosticReports
    + zip -9rj /Users/runner/work/1/s/crash-reports.zip /Users/runner/Library/Logs/DiagnosticReports

    zip error: Nothing to do! (try: zip -9rj /Users/runner/work/1/s/crash-reports.zip . -i /Users/runner/Library/Logs/DiagnosticReports)
2022-09-15 11:58:35 +02:00
Rolf Bjarne Kvinge 2d0c1c5462
[devops] Don't try to publish test results unless there are any tests results. (#15911)
Don't try to publish test results unless there are any tests results.

Fixes this [horribly/amusingly incorrect error][1] in the publish task:

    ##[error]Error: Failed find: ENOENT: no such file or directory, lstat '/System/Library/Frameworks/iTunesLibrary.framework/Versions/Versions'
    ##[section]Finishing: Publish NUnit Device Test Results

Also stop failing the task on failing tests, because we already have another task that fail if there are failing tests (the task that runs the tests).

[1]: https://github.com/microsoft/azure-pipelines-tasks/issues/16786
2022-09-15 10:58:35 +02:00
Rolf Bjarne Kvinge 40199966b6
[msbuild] Automatically add the 'com.apple.security.cs.allow-jit' entitlement for desktop release builds. Fixes #15745. (#15927)
* Add support for specifying custom entitlements with an MSBuild item group.
* Use this new support to automatically add the 'com.apple.security.cs.allow-jit'
  entitlement to .NET desktop apps when building for release, since all apps that
  go through notarization will need it in order to be able to use the JIT.

It's possible to override the default behavior by adding something like this to the project file:

    <ItemGroup>
        <CustomEntitlements Include="com.apple.security.cs.allow-jit" Type="Remove" />
    </ItemGroup>

Fixes https://github.com/xamarin/xamarin-macios/issues/15745.
2022-09-13 17:41:22 +02:00
Rolf Bjarne Kvinge 7df80a40da
[msbuild] Remove MS7068 so allow creating binding projects without native libraries. Fixes #15489. (#15926)
Fixes https://github.com/xamarin/xamarin-macios/issues/15489.
2022-09-13 17:40:43 +02:00
Rolf Bjarne Kvinge 594e88bfca
[tests] Adjust test for tvOS and watchOS. (#15939)
Probably regressed after 61e8ce443f.

Fixes https://github.com/xamarin/maccore/issues/2618.
2022-09-13 16:06:10 +02:00
Steve Hawley 227baba0b9
[.NET/CoreMedia] Use [UnmanagedCallersOnly] instead of [MonoPInvokeCallback] Partial Fix for #10470 (#15934) 2022-09-13 09:29:37 -04:00
Steve Hawley 878d16efb5
[.NET/MediaToolbox] Use [UnmanagedCallersOnly] instead of [MonoPInvokeCallback] Partial Fix for #10470 (#15942) 2022-09-13 09:28:52 -04:00
Rolf Bjarne Kvinge d769fa99cc
[msbuild] Only require a provisioning profile if we have non-empty entitlements. (#15918)
This is the behavior in legacy Xamarin (for mobile projects): if a project
contains a CodesignEntitlements=Entitlements.plist property, we require a
provisioning profile (and failing the build if none is found).

In .NET, the expected behavior is that if a file is in the project directory,
it should be detected automatically and handled accordingly. We didn't do this
for the initial release of .NET, but we implemented it later
(https://github.com/xamarin/xamarin-macios/pull/15729).

However, this turned out to be complicated, because many templates provide an
Entitlements.plist file, and now suddenly just the presence of such a file
would require a provisioning profile, which also means setting up the whole
rigmarole of Apple's certificates and provisioning profiles (and even
potentially getting a paid Apple Developer account).

This usually worked well in legacy Xamarin, because in templates only the
Release configuration would set the CodesignEntitlements=Entitlements.plist
property, and thus we'd only require a provisioning profile for release builds
(and the Entitlements.plist file would be ignored for Debug builds).

Here we change the default behavior when building for .NET so that we only
require a provisioning profile if the Entitlements.plist file is empty (i.e.
doesn't request any entitlements).

I've also implemented an override, where setting the
CodesignRequireProvisioningProfile=true property will override our default
logic.

Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1613459.
2022-09-13 10:51:41 +02:00
Mauro Agnoletti 1731c5c0dc
Updated Xamarin.Messaging to 1.7.14 (#15913) 2022-09-13 10:40:44 +02:00
Rolf Bjarne Kvinge 0d444c3d96
[tests] Remove unused file. (#15936)
The mini tests were removed [eons][1] ago, so remove the remaining file as well.

[1]: c4a89496fc
2022-09-13 08:50:59 +02:00
Rolf Bjarne Kvinge e56103479c
[devops] Don't create legacy iOS/Mac symlinks unless legacy build is enabled. (#15930)
* Move the bash in the yml file to a separate script file to ease reading, writing & debugging.
* Don't install any symlinks if legacy Xamarin isn't enabled.
* Only install the iOS / macOS symlink if the corresponding build is enabled.
2022-09-13 08:37:05 +02:00
Rolf Bjarne Kvinge 9db89b6188
[devops] Only install XI/XM package if corresponding build is enabled. (#15931)
Only install the XI and/or XM package if the corresponding part of the build is enabled.

Also don't install either if the legacy Xamarin build is disabled.
2022-09-13 08:36:11 +02:00
Steve Hawley 2a37989a4b
[.NET/CoreGraphics] Use [UnmanagedCallersOnly] instead of [MonoPInvokeCallback] Partial Fix for #10470 (#15906)
Completed the work for CoreGraphics.
One exception is PDFArray.cs which uses `SetupBlockUnsafe` (noted in the
issue)

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-09-12 09:46:01 -04:00
Rolf Bjarne Kvinge 1552a1e20b
[devops] Update and add tests (#15920) 2022-09-12 11:39:52 +02:00
Rolf Bjarne Kvinge c63f238d84
[msbuild] Put all the MSBuild tests in the same namespace. (#15919)
I always have to look through all the namespaces to figure out where a
specific test is, so this simplifies things a bit.

It's also where the tasks themselves are headed at some point.
2022-09-12 11:34:45 +02:00
Rolf Bjarne Kvinge b353c21108
[msbuild] Enable nullability in the CompileEntitlements task. (#15912)
Also remove the 'MergeProfileEntitlements' property, since its value is always
'true' and thus the property is redundant.
2022-09-12 11:21:44 +02:00
Rolf Bjarne Kvinge e84cca8cb6
[dotnet] Add binding templates for tvOS and macOS. Fixes #15839. (#15921)
Fixes https://github.com/xamarin/xamarin-macios/issues/15839.
2022-09-12 10:21:47 +02:00
Rolf Bjarne Kvinge 61e8ce443f
[tests] Skip SecRecord tests on macOS 11 (#15825)
It may hang on the bots.
2022-09-09 20:29:37 +02:00
Rolf Bjarne Kvinge b6cdde4280
[msbuild] Add support for keeping temporary output when looking for AOT compilers. (#15884) 2022-09-09 17:10:50 +02:00
Rolf Bjarne Kvinge 7e20a09b28
[msbuild] Ignore MSB3246 in Xamarin.iOS.Tasks.Windows to avoid a warning about a dll which isn't an assembly. (#15887) 2022-09-09 17:10:41 +02:00
Rolf Bjarne Kvinge ea855fda92
[devops] A missing test must still be reported (as a failing test). (#15901) 2022-09-09 16:53:31 +02:00
Rolf Bjarne Kvinge 316d371d83
[msbuild] Use 'netstandard2.0' as the target framework in every project. (#15796)
Fixes this compiler warning:

    /Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/Microsoft.Common.CurrentVersion.targets(1733,5): warning : ProjectReference 'xamarin-macios/msbuild/Messaging/Xamarin.Messaging.Build/Xamarin.Messaging.Build.csproj' was resolved using '.NETFramework,Version=v4.7.2' instead of the project target framework '.NETStandard,Version=v2.0'. This project may not be fully compatible with your project. [xamarin-macios/msbuild/Xamarin.iOS.Tasks.Windows/Xamarin.iOS.Tasks.Windows.csproj]
2022-09-09 13:22:16 +02:00
Rolf Bjarne Kvinge 2bb0e50ce4
[devops] Always send off a test summary. (#15883)
Even if it's just to say we couldn't compute a test summary.
2022-09-09 13:21:25 +02:00
Rolf Bjarne Kvinge 5abbae36ca
[devops] Fix double closing details tag when creating test results. (#15902)
Also simplify the code a bit to reduce duplicated code.
2022-09-09 10:50:55 +02:00
Rolf Bjarne Kvinge c232fc1583
[devops] Improve debug statements. (#15904)
* Special characters in powershell are rather, hrm, _uncommon_, in that
  they're prefixed with a backtick instead of backslash. Fix code accordingly.
* Use 'Write-Debug' instead of 'Write-Host' in a few places.
* Simplified/improved a few debug statements to make them clearer/less redundant.
* Added tabs in a few places to make debug statements indent properly.
* Fixed a typo.
2022-09-08 17:52:57 +02:00
Rolf Bjarne Kvinge 5d2b9511f4
[devops] Fix a few exceptions when parsing test results to report failures instead. (#15899) 2022-09-08 17:34:02 +02:00
Rolf Bjarne Kvinge c2f743d182
[devops] Improve a throw statement to have more information. (#15900) 2022-09-08 17:33:00 +02:00
Rolf Bjarne Kvinge 605ee8b58f
[devops] A crashed test is also a failed test, so don't report that all tests succeeded if there are any crashed tests. (#15903) 2022-09-08 17:32:04 +02:00
Steve Hawley 182761d9c1
[.NET/CoreVideo] Use [UnmanagedCallersOnly] instead of [MonoPInvokeCallback] Partial Fix for #10470 (#15892)
straightforward
2022-09-08 10:12:21 -04:00
Rolf Bjarne Kvinge aa8ded8e51
[runtime] Store assemblies' MVID in the generated static registrar code. (#15795)
This will increase app size a little bit: the space for the MVID + 4 bytes for each
assembly, but we'll be able to validate and show a helpful error message if the generated
static registrar code does not match the assembly loaded at runtime.

It's also a step toward per-assembly static registration (ref: #12067).
2022-09-08 10:34:05 +02:00
Rolf Bjarne Kvinge 9a52a6fbe7
[devops] Fix paths to VSDrops after latest changes to make relaunching jobs work. (#15891) 2022-09-08 07:59:14 +02:00
Haritha Mohan 35cb9ac366
[UIKit] Add nullability to file (#15857)
File did not have nullability enabled. Add nullability and made some
changes to code as safeguards.
2022-09-07 17:58:41 -04:00
Rolf Bjarne Kvinge 815d91fbc9
[devops] Fix tests. (#15885)
$Env:PWD doesn't seem to work on the bots, so try something else.
2022-09-07 21:14:10 +02:00
Rolf Bjarne Kvinge 2558c98c7c
[msbuild] Take the .NET version into account when computing the illink.dll location. (#15876)
We use illink.dll from the executing .NET version: if we're building with .NET
7, then we're using illink from .NET 7. This means we can't hard-code 'net6.0'
when computing the path to illink.dll for remote builds.

Fixes https://devdiv.visualstudio.com/DefaultCollection/DevDiv/_workitems/edit/1611403.
2022-09-07 21:10:25 +02:00