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

3444 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 5d6a92eaf0 [net8.0] Merge main into net8.0. 2023-06-12 18:56:10 +02:00
Rolf Bjarne Kvinge 859a48a73a
[tools] Automatically re-create ProductConstants.cs when the current commit changes. (#18426)
This fixes a frequent issue where building locally again would create
test apps where the registrar would fail due to mismatched runtime versions.
2023-06-12 18:44:25 +02:00
Rolf Bjarne Kvinge 6f1c0ea534 [net8.0] Merge main into net8.0. 2023-06-08 13:32:48 +02:00
Rolf Bjarne Kvinge 9e2143032f
Use Enum.GetValues<T> instead of Enum.GetValues in numerous places for .NET. (#18382)
NativeAOT warns about Enum.GetValues and suggests using Enum.GetValues<T>
instead, so do just that.
2023-06-07 08:47:55 +02:00
Rolf Bjarne Kvinge f47040e099 Merge remote-tracking branch 'origin/main' into bump-main-in-net8.0-2023-06-05 2023-06-06 18:22:29 +02:00
Rolf Bjarne Kvinge b03a9b3b87
[tools] Bump Xcode version in SdkVersions.cs. (#18406) 2023-06-06 14:49:41 +02:00
Rolf Bjarne Kvinge e6e25497a0 [net8.0] Merge main into net8.0. 2023-06-05 10:54:13 +02:00
Rolf Bjarne Kvinge 53e62dc1a0
[devops] Upgrade the PoliCheck and PostAnalysis tasks to v2. (#18381)
Fixes these warnings in Azure DevOps:

	* Please upgrade the version of this build task in your build to major version: 2. For more information, please see: https://aka.ms/gdn-v1-deprecation
	Governance Checks • Governance Checks • PoliCheck

	* Please upgrade the version of this build task in your build to major version: 2. For more information, please see: https://aka.ms/gdn-v1-deprecation
	Governance Checks • Governance Checks • Post Analysis

---------

Co-authored-by: Alex Soto <alex@alexsoto.me>
2023-06-02 09:20:33 +02:00
Rolf Bjarne Kvinge 722bc0c555
[devops] Collect test results and upload them for the Windows tests. (#18386)
Also make the tests log to stdout so that we can see what happened (i.e. went
wrong) from the logs.
2023-06-01 10:39:38 +02:00
Manuel de la Pena d2b6a5afb6
[CI] Move the script to run the tests to a file rather than being inline. (#18379) 2023-05-31 10:28:01 -04:00
Steve Hawley 62634bdc7a
[dotnet] add redirect-class-handles to optimizations. (#18354)
Add redirect-class-handles to optimization options.
2023-05-30 14:45:25 -04:00
Manuel de la Pena c5ef1a0a43
[CI] Use the template to generate a matrix strategy which reduces the yaml explosion. (#18312)
The final result is the same, but because a matrix strategy is a native
element of azure pipeline, it does not get expanded. This makes our
pipeline to be reduce to under 10.000 lines of yaml when it was around
40.000. This should unblock the dev of
https://github.com/xamarin/xamarin-macios/pull/18279
2023-05-30 10:26:53 -04:00
Rolf Bjarne Kvinge 92da968558 [net8.0] Merge main into net8.0. 2023-05-30 08:51:24 +02:00
TJ Lambert 67ee512660
[Localization] Change PAT for automated PRs (#18345)
Let's try using this new PAT from VSEng in our automation to bring
translations from the Localization branch in PRs.

Tested here on a test branch:
https://github.com/xamarin/xamarin-macios/pull/18326

Co-authored-by: tj-devel709 <tjlambert@microsoft.com>
2023-05-26 11:47:04 -05:00
Rolf Bjarne Kvinge 22e510c063 [net8.0] Merge main into net8.0. 2023-05-25 07:54:38 +02:00
Rolf Bjarne Kvinge 48f22eb1ed
Merge branch 'net8.0' into bump-main-in-net8.0-2023-05-19 2023-05-24 20:35:50 +02:00
dotnet-maestro[bot] ea4c29c438
[net8.0] Update dependencies from dotnet/installer (#18305)
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.NET.ILLink.Tasks**: from 8.0.0-preview.5.23260.3 to 8.0.0-preview.5.23272.14 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.AspNetCore.App.Ref**: from 8.0.0-preview.5.23262.1 to 8.0.0-preview.5.23273.2 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.NETCore.App.Ref**: from 8.0.0-preview.5.23260.3 to 8.0.0-preview.5.23272.14 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100.Transport**: from 8.0.0-preview.5.23252.1 to 8.0.0-preview.5.23265.1 (parent: Microsoft.NETCore.App.Ref)
  - **Microsoft.NETCore.App.Ref**: from 8.0.0-preview.5.23260.3 to 8.0.0-preview.5.23272.14 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.DotNet.Cecil**: from 0.11.4-alpha.23252.1 to 0.11.4-alpha.23265.2 (parent: Microsoft.NETCore.App.Ref)

## From https://github.com/dotnet/installer
- **Subscription**: f9b68d84-9c90-4bd0-5499-08db4112d57e
- **Build**: 20230523.15
- **Date Produced**: May 24, 2023 12:03:24 AM UTC
- **Commit**: 4b48b408f9b777eddd4e87f6b9efab4b5b1723a6
- **Branch**: refs/heads/main

- **Updates**:
  - **Microsoft.Dotnet.Sdk.Internal**: [from 8.0.100-preview.5.23267.7 to 8.0.100-preview.5.23273.15][21]
  - **Microsoft.NET.ILLink.Tasks**: [from 8.0.0-preview.5.23260.3 to 8.0.0-preview.5.23272.14][22]
  - **Microsoft.AspNetCore.App.Ref**: [from 8.0.0-preview.5.23262.1 to 8.0.0-preview.5.23273.2][23]
  - **Microsoft.NETCore.App.Ref**: [from 8.0.0-preview.5.23260.3 to 8.0.0-preview.5.23272.14][22]
  - **Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100.Transport**: [from 8.0.0-preview.5.23252.1 to 8.0.0-preview.5.23265.1][24]
  - **Microsoft.NETCore.App.Ref**: [from 8.0.0-preview.5.23260.3 to 8.0.0-preview.5.23272.14][22]
  - **Microsoft.DotNet.Cecil**: [from 0.11.4-alpha.23252.1 to 0.11.4-alpha.23265.2][25]

[21]: dda516cbd7...4b48b408f9
[22]: 888bac3044...8163d1643a
[23]: 059939bda4...39564d529f
[24]: ab09b0b8d6...7a90ec9edc
[25]: c32f0be86d...f283c62293
2023-05-24 20:35:32 +02:00
Manuel de la Pena 88e3e258de
[CI] Move a number of bash scripts from inline scripts to file based scripts (#18311)
This allow stop minize the expanded size of the yaml.
2023-05-23 10:50:14 -04:00
VS MobileTools Engineering Service 2 a054c52d54
Localized file check-in by OneLocBuild Task: Build definition ID 17751: Build ID 7800490 (#18306)
This is the pull request automatically created by the OneLocBuild task
in the build process to check-in localized files generated based upon
translation source files (.lcl files) handed-back from the downstream
localization pipeline. If there are issues in translations, visit
https://aka.ms/icxLocBug and log bugs for fixes. The OneLocBuild wiki is
https://aka.ms/onelocbuild and the localization process in general is
documented at https://aka.ms/AllAboutLoc.
2023-05-23 08:26:52 +02:00
Rolf Bjarne Kvinge ab73088c0b [net8.0] Merge main into net8.0. 2023-05-19 08:06:07 +02:00
Rolf Bjarne Kvinge 1337268bbf
[dotnet-linker] Add a tasks.json to ease development with VSCode. (#18292) 2023-05-19 07:59:24 +02:00
Rolf Bjarne Kvinge 464cf6986e
[tools] Add helper tool to create launch.json for dotnet-linker. (#18294)
This tool takes a binlog as input, and creates a launch.json for dotnet-linker
that will execute the linker as was done in the binlog.

This is very useful for debugging custom linker steps, since they can be
debugged in VSCode now.
2023-05-19 07:45:21 +02:00
Rolf Bjarne Kvinge cdbf30cb92
[dotnet-linker] Add a 'vscode' target that will launch VSCode with the paths configured to use the local .NET. (#18293) 2023-05-19 07:45:06 +02:00
Rolf Bjarne Kvinge 0bc12c8def
Add a managed static registrar. Fixes #17324. (#18268)
Add a new version of the static registrar (called the managed static
registrar), which most notably doesn't use metadata tokens (because NativeAOT
doesn't support metadata tokens). In addition, the new registrar also takes
advantage of new features in both C# and the runtime, in order to be more
performant.

I won't go into detail about everything here, because it would be rather long,
but I've added documentation for the new registrar (the first commit, so start
reviewing there).

Fixes https://github.com/xamarin/xamarin-macios/issues/17324.
2023-05-19 07:30:33 +02:00
Manuel de la Pena 6e216f0e4c
[DevOps] Provide a script that will allow use to debug the expanded yaml. (#18289)
This pr provides a script that will allow to create a dry run in vsts
and will return the expanded yaml after the yaml compiler has been
executed, this will be written in the given output file.

Usage:

Basic usage: Query the expanded template from the ci pipeline in main:

```pwsh
./preview_yaml.ps1 -AccessToken $pat -OutputFile ./full.yaml
```

Query the expansion in the pr pipeline:
```pwsh
./preview_yaml.ps1 -AccessToken $pat -OutputFile ./full.yaml -Pipeline "pr"
```

Query the expansion in the ci pipeline for a diff branch than main:
```pwsh
./preview_yaml.ps1 -AccessToken $pat -OutputFile ./full.yaml -Branch "trigger-issues"
```

The output file is ALLWAYS overriden.
2023-05-18 15:30:04 -04:00
Manuel de la Pena 9f503ea48a
[DevOps] Do not sign the sbom on the prs. (#18288)
That step is failing or Prs with the following messsage:

`
##[error]The signing feature is not available for your organization yet.
`

Yet we do not need or care about the sbom on a pr. We can remove it and
that way not get the error and use less resources.
2023-05-18 15:20:47 -04:00
Rolf Bjarne Kvinge a9c52baa28 [net8.0] Merge main into net8.0. 2023-05-18 17:26:48 +02:00
Steve Hawley d57f205feb
[dotnet] Turn class-redirector into a Task (#18244)
Rework the class-redirector as an MSBuild Task.
2023-05-18 10:55:37 -04:00
Rolf Bjarne Kvinge 65590ba8c0 Merge remote-tracking branch 'origin/main' into msr 2023-05-18 15:19:39 +02:00
GitHub Actions Autoformatter 03488a28b7 Auto-format source code 2023-05-18 10:12:06 +00:00
Rolf Bjarne Kvinge 666ec96bf5 [dotnet-linker] Simplify generated code for constructors of generic types.
We can't create an instance of a generic type in the UnmanagedCallersOnly trampoline,
so simplify the code to not even try, and instead just throw the final exception.
2023-05-18 11:54:10 +02:00
Git History Editor d540050538 [dotnet-linker] Add a missing cast to make generated code more verifiable 2023-05-18 11:54:10 +02:00
Git History Editor aa75c706dc [dotnet-linker] Keep track of when we called MethodBase.Invoke and an 'object' reference is left on the stack.
Keep track of when we called MethodBase.Invoke and an 'object' reference is left
on the stack, so that we can cast to the appropiate type later on when we know how
the value is converted to the corresponding native type.

This fixes a few cases of the managed static registrar creating unverifiable IL.
2023-05-18 11:54:10 +02:00
Git History Editor ed7b4b6485 [dotnet-linker] Keep better track of when we're calling MethodBase.Invoke.
Keep better track of whether we're calling MethodBase.Invoke to call the target method,
which allows us to detect certain error scenarios (and show a corresponding error).
2023-05-18 11:54:10 +02:00
Git History Editor 469fdb5bed [dotnet-linker] Fix detecting when we must call the object-based Runtime.GetNSObject
We can't call the generic Runtime.GetNSObject<T> method when we don't know the final
type of the returned object, which happens for open types. However, we must always
call the generic Runtime.GetNSObject<T> when we know the final type, so that we have
the correct object type on the evaluation stack.

Fix this by properly detecting open types and only calling Runtime.GetNSObject in
that case.
2023-05-18 11:54:09 +02:00
Rolf Bjarne Kvinge a7371cf53c [dotnet-linker] Remove dead code. 2023-05-18 11:54:09 +02:00
Rolf Bjarne Kvinge 799095e761 [dotnet-linker] Ensure we call Runtime.CopyAndAutorelease in all applicable code paths. 2023-05-18 11:54:09 +02:00
Rolf Bjarne Kvinge 643015e9cb [dotnet-linker] Make sure local variables are initialized before use in generated method bodies. 2023-05-18 11:54:09 +02:00
Rolf Bjarne Kvinge 50cc0bedbe [net8.0] Merge main into net8.0. 2023-05-17 08:28:14 +02:00
Rolf Bjarne Kvinge cdac4507a2
[devops] Stop building test dependencies on each test run. (#18096)
Stop building the test dependencies on each test run, and instead use the archived test dependencies we have from the main build:

* Stop running 'make all' in tests/ on every separate test run.
* Add a lot more stuff in the package-test-libraries.zip archive.
* Extract all the new stuff on every test run. We add stuff from outside the tests/
  directory, so adjust archive creation and extraction to use the root directory
  of the repository as the root of the zip archive as well.
* Also add the introspection dependencies to the same archive to simplify the logic.
* Fix xharness to not store absolute paths in generated projects.
* Fix test project to not automatically run make in tests/test-libraries when running
  on the bots.

Building the test dependencies takes ~10 minutes for each test run, so this saves
about that time for each test run.
2023-05-15 18:41:49 +02:00
GitHub Actions Autoformatter a248260de4 Auto-format source code 2023-05-15 16:38:58 +00:00
Rolf Bjarne Kvinge 50ba357808 [runtime] Change NSObject.AllocateNSObject<T> to not take the flags parameter.
It's only called from one place, and the flags are constant, so just hardcode
the value in the method instead of taking it as an input. This simplifies the
generated managed static registrar code a little bit.
2023-05-15 18:33:36 +02:00
Rolf Bjarne Kvinge 429b8e399b [dotnet-linker] Improve a comment. 2023-05-15 18:33:36 +02:00
Rolf Bjarne Kvinge 25ad7b262b [dotnet-linker] Always use 'IntPtr' as the type of for the first argument in UnmanagedCallersOnly methods in the managed static registrar.
This fixes invalid IL in a few cases.
2023-05-15 18:33:35 +02:00
Rolf Bjarne Kvinge 2828d7fd50 [dotnet-tool] Expand a bit in a comment. 2023-05-15 16:13:40 +02:00
Rolf Bjarne Kvinge fd673848d7 [dotnet-linker] Add missing newline. 2023-05-15 16:13:40 +02:00
Rolf Bjarne Kvinge e4830a84aa [dotnet-linker] Improve method naming a bit according to reviews. 2023-05-15 16:13:40 +02:00
Rolf Bjarne Kvinge 4053da70e0 [tools] Add availability attributes in new code. 2023-05-15 16:13:40 +02:00
Rolf Bjarne Kvinge 587058fec4 [tools] Simplify code a little bit. 2023-05-15 16:13:40 +02:00
Rolf Bjarne Kvinge 6d33409c8f [dotnet-linker] Improve code in AppBundleRewriter according to review.
Add a few more helper methods to get method references, that simplifies calling code.
2023-05-15 16:13:40 +02:00