Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[net10.0] Merge main into net10.0. #21917

Merged
merged 143 commits into from
Jan 17, 2025

Conversation

rolfbjarne
Copy link
Member

No description provided.

rolfbjarne and others added 30 commits December 18, 2024 08:45
)

Fixes this exception at startup when there's already an xharness server running:

    Running xharness in server mode. Press Ctrl-C to exit (or click Quit / press Q in the browser page)
    Unexpected exception: System.ObjectDisposedException: Cannot access a disposed object.
    Object name: 'System.Net.HttpListener'.
       at System.Net.HttpListener.get_Prefixes()
       at Xharness.Jenkins.TestServer.RunAsync(Jenkins jenkins, HtmlReportWriter htmlReportWriter) in /Users/rolf/work/maccore/xharness/xamarin-macios/tests/xharness/Jenkins/TestServer.cs:line 27
       at Xharness.Jenkins.Jenkins.Run() in /Users/rolf/work/maccore/xharness/xamarin-macios/tests/xharness/Jenkins/Jenkins.cs:line 220
Xamarin.Messaging major version 3 means the replacement of the
underlying MQTT library used for message communication. We've replaced
the System.Net.Mqtt with MQTTnet (repo under the dotnet org). More
details here: xamarin/Xamarin.Messaging#818

For this reason, we also need to remove any System.Net.Mqtt reference
from signing lists or ILMerge, and add MQTTnet instead.

This PR also removes the System.Security.Cryptography.ProtectedData
runtime implementation handling, since the new version used by Messaging
(8.0.0) doesn't include a specific Windows runtime implementation, so we
don't need to do this extra MSBuild handling to reference the right
assemblies anymore
…ally deprecated. (#21822)

This fixes a few unnecessary ignores we have.
This pull request updates the following dependencies

## From https://github.com/dotnet/xharness

- **Subscription**: 601bc5e1-1cae-44b5-cf5f-08db9342aa2f
- **Build**: 20241210.1
- **Date Produced**: December 10, 2024 12:03:16 PM UTC
- **Commit**: 3119edb6d70fb252e6128b0c7e45d3fc2f49f249
- **Branch**: refs/heads/main

- **Updates**:
  - **Microsoft.DotNet.XHarness.iOS.Shared**: [from 10.0.0-prerelease.24604.1 to 10.0.0-prerelease.24610.1][1]

[1]: dotnet/xharness@5979ebc...3119edb
…ixes #19028. (#20822)

If a library references resources, until now we've pre-compile/pre-processed
some of those before embedding them the library. This applies to resources of
the following item groups:

* AtlasTexture
* BundleResource
* Collada
* CoreMLModel
* ImageAsset
* InterfaceDefinition
* SceneKitAsset

However, pre-processing resources as a few problems:

* It requires a native (Xcode) toolchain.
   * This is unfortunate when building from Windows: the current approach is
     that when building a library as a referenced project, the remoting part
     is skipped, so all such resources are just dropped.
   * It also means building on Linux doesn't work.
* It makes it impossible to merge resources with the same name, if we wanted
  to do that.

So I'm adding support for bundling the original resources in library projects.

This is enabled using the MSBuild property `BundleOriginalResources=true`,
which is turned off by default for .NET 9 and turned on by default for .NET 10+.

Additionally I've added `PartialAppManifest` items to the list of bundled
resources from class libraries.

This means that there are numerous task we don't have to remote to the Mac
anymore (when bundling original resources) - in particular libraries can be
fully built on Windows (or any other platform) now.

Fixes #19028.
Fixes #19513.
* Fix local checkout to only pass the extra http header if we have a SYSTEM_ACCESSTOKEN.
* Use a bash array to store authorization arguments, because quoting each
  argument actually works when expanding an array into arguments - in
  particular expanding an empty array expands into nothing (this avoids a
  problem where DEPENDENCY_AUTH would be expanded into an empty (and quoted)
  string, which would execute doing 'git ""', and "" is not a git command.)
* Fix clone command to not forget the 'clone' part of 'git clone ...'
…it types. (#21829)

These show up / fail on macOS 15.2+.
…etup. (#21841)

It's not necessary; this already happens on the bots before the test run
anyway, so any work done here is redundant on the bots. It's even timing out
(after two minutes) on some test runs, which means this should save up to two
minutes for the msbuild tests on the bots.
…s struct. (#21843)

This way we keep track of the different changes of the availability not
only from the current enum value but from any possible changes in the
parent containers. This can be the enum itself or a class in case we
have a nested enum declaration.

---------

Co-authored-by: Copilot <[email protected]>
Co-authored-by: GitHub Actions Autoformatter <[email protected]>
…model (#21847)

This way, when we start generating the code we do not need to calculate
the changes and this structure will take into account any changes in the
class availability.

---------

Co-authored-by: Copilot <[email protected]>
Co-authored-by: GitHub Actions Autoformatter <[email protected]>
This way we have all the needed data when generated the generated code
taking into account the availability of the parent objects.

---------

Co-authored-by: GitHub Actions Autoformatter <[email protected]>
…el. (#21853)

Add the data in the model as well as the availability data to the
accessors. We have not modified the events data model in this PR, we
only focused on properties.

Added ToString implementations to simplify the test debugger and fixed a
bug in one of the constructors in which the structure was not creating a
copy of the dictionary but was keeping the ref that was passed to the
structure, this resulted in undesirable side effects when modifying the
collection.

---------

Co-authored-by: GitHub Actions Autoformatter <[email protected]>
…#21855)

Add the supported platforms as part of the data model and update tests
accodingly.

---------

Co-authored-by: GitHub Actions Autoformatter <[email protected]>
We add the name and a collection with the namespaces that contains the
type. This way we do not need to query the symbol when generating code
and we can simply use the data in the structure.

---------

Co-authored-by: Copilot <[email protected]>
Co-authored-by: GitHub Actions Autoformatter <[email protected]>
Since we are calculating which enum values were added as part of the
code change we can retrieve at that time the field data information.
This way we reduce the number of times we query the semantic model in
the code generation. This opens the door to use the code changes
structure to generate the smart enums and reduce the number of allocated
objects.

---------

Co-authored-by: GitHub Actions Autoformatter <[email protected]>
…ange struct. (#21858)

Reduce the amount of work we need to do in the code generation by
precalculating the availability of the class. This way we can later use
the code change struct to generate the code.

---------

Co-authored-by: GitHub Actions Autoformatter <[email protected]>
The code changes structure should have all the needed data to perform
the code generation. This allows to do the following:

1. Remove the need of using a symbol context. The structure should be
enough.
2. With the removal of the context, we can move to use a readonly ref
parameter to the emit method.

This allows to reduce the memory footprint by:

1. Using the stack more.
2. Reduce the number of structurs that are copied. in parameters allow
use to use the structs 'as' ref types.

---------

Co-authored-by: GitHub Actions Autoformatter <[email protected]>
…bly. (#21661)

This speeds up the inner dev loop, because:

* The dedup assembly must be AOT-compiled for arm64
* arm64 is the default target architecture on more and more devices/macs
* AOT-compilation is slow

So disabling the dedup optimization in this case makes the build faster,
because we don't have to AOT-compile something that doesn't exist.

Build times of a new MAUI app (`dotnet new maui`):

| -                              | with dedup   | without dedup |
| ------------------------------ | -----------: | ------------: |
| Simulator (Debug)              |         18 s |           8 s |
| Device (Debug)                 |         32 s |          22 s |
| Device (Release, interpreter)  |         43 s |          18 s |
| Device (Release, fullaot)      |       1m20 s |        1m40 s |

App size:

| -                              | with dedup | without dedup |
| ------------------------------ | ---------: | ------------: |
| Device (Debug)                 |     126 MB |         88 MB |
| Device (Release, interpreter)  |      19 MB |         14 MB |
| Device (Release, fullaot)      |      42 MB |         69 MB |

Note that disabling dedup when using the interpreter makes the app
smaller as well.
Two PRs changed the same test, one update the string, the other one
added new tests. The CI ran but it was not merged with main resulting in
the tests passing in the PR but failing on main
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

This is needed to generate any possible casting when interacting with
the native platform.

---------

Co-authored-by: GitHub Actions Autoformatter <[email protected]>
@vs-mobiletools-engineering-service2

This comment has been minimized.

…ld of the platform assemblies. (#21975)

This involved creating a tool that takes a response file and generates the corresponding
csproj.

These are fully functional project files, that build successfully (but not necessarily
correctly, I haven't verified that part).
…ne. (#21973)

This way all such errors are reported at once, and it's not necessary to
rebuild to find the next error.
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

mandel-macaque and others added 4 commits January 15, 2025 17:26
#21980)

Add the initial implementation of a syntax factory that can be used to
generate the C# calls needed by the bindings.

This implementation only contains the Getter methods needed to retrieve
fields in order to keep PRs in a reasonable size.

Example usage when writing bindings:

```csharp
sb.AppendRaw($@"
if ({property.Name} is null)
    {property.Name} = {FieldConstantGetter (property)};
return {property.Name}
";
```

The API takes advantage of the fact that the data model has all the
needed info and the makes the code cleaner when importing it with a
status using.

---------

Co-authored-by: GitHub Actions Autoformatter <[email protected]>
Co-authored-by: Rolf Bjarne Kvinge <[email protected]>
The linker tests do trimmer-unsafe things by design, so just ignore any
trimmer warnings.
@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [PR Build] Build passed (Detect API changes) ✅

Pipeline on Agent
Hash: f21a0ccc1f66d912112e79c214aa7edb2d612427 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [PR Build] Build passed (Build packages) ✅

Pipeline on Agent
Hash: f21a0ccc1f66d912112e79c214aa7edb2d612427 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [PR Build] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: f21a0ccc1f66d912112e79c214aa7edb2d612427 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ API diff for current PR / commit

.NET ( No breaking changes )

❗ API diff vs stable (Breaking changes)

.NET ( ❗ Breaking changes ❗ )

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: f21a0ccc1f66d912112e79c214aa7edb2d612427 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

❌ [CI Build] Windows Integration Tests failed ❌

❌ Failed ❌

Pipeline on Agent
Hash: f21a0ccc1f66d912112e79c214aa7edb2d612427 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [PR Build] Tests on macOS M1 - Mac Monterey (12) passed 💻

All tests on macOS M1 - Mac Monterey (12) passed.

Pipeline on Agent
Hash: f21a0ccc1f66d912112e79c214aa7edb2d612427 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [PR Build] Tests on macOS X64 - Mac Sonoma (14) passed 💻

All tests on macOS X64 - Mac Sonoma (14) passed.

Pipeline on Agent
Hash: f21a0ccc1f66d912112e79c214aa7edb2d612427 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [PR Build] Tests on macOS M1 - Mac Ventura (13) passed 💻

All tests on macOS M1 - Mac Ventura (13) passed.

Pipeline on Agent
Hash: f21a0ccc1f66d912112e79c214aa7edb2d612427 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [PR Build] Tests on macOS arm64 - Mac Sequoia (15) passed 💻

All tests on macOS arm64 - Mac Sequoia (15) passed.

Pipeline on Agent
Hash: f21a0ccc1f66d912112e79c214aa7edb2d612427 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

🔥 [CI Build] Test results 🔥

Test results

❌ Tests failed on VSTS: test results

0 tests crashed, 4 tests failed, 112 tests passed.

Failures

❌ dotnettests tests (iOS)

1 tests failed, 0 tests passed.
  • DotNet tests: Failed (Execution failed with exit code 1)

Html Report (VSDrops) Download

❌ dotnettests tests (MacCatalyst)

1 tests failed, 0 tests passed.
  • DotNet tests: Failed (Execution failed with exit code 1)

Html Report (VSDrops) Download

❌ dotnettests tests (macOS)

1 tests failed, 0 tests passed.
  • DotNet tests: Failed (Execution failed with exit code 1)

Html Report (VSDrops) Download

❌ dotnettests tests (tvOS)

1 tests failed, 0 tests passed.
  • DotNet tests: Failed (Execution failed with exit code 1)

Html Report (VSDrops) Download

Successes

✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. Html Report (VSDrops) Download
✅ generator: All 5 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 6 tests passed. Html Report (VSDrops) Download
✅ linker: All 44 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 10 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 11 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 9 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 8 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download

Pipeline on Agent
Hash: f21a0ccc1f66d912112e79c214aa7edb2d612427 [PR build]

@rolfbjarne
Copy link
Member Author

Test failures are unrelated, and will be fixed with #22001 and #21990.

@rolfbjarne rolfbjarne merged commit 0683a2e into net10.0 Jan 17, 2025
42 of 48 checks passed
@rolfbjarne rolfbjarne deleted the dev/rolf/bump-main-in-net10.0-2025-01-07 branch January 17, 2025 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants