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. #22161

Open
wants to merge 143 commits into
base: net10.0
Choose a base branch
from

Conversation

rolfbjarne
Copy link
Member

No description provided.

mandel-macaque and others added 30 commits January 16, 2025 06:29
…ds. (#21983)

This commit has the following important changes to carefully review:

1. We move to make the method name otpional in the GetConstant and
SetConstant. This is done by the CallerMemberName attribute which will
add the name automatically to match the caller. This is done at compile
time and is equal to nameof. This way we reduce typing and typos.
2. Added a tuple to return the getter and setter. This way we make sure
that when we add support for a new kind of field, that we add both.
3. For those fields that we cannot set, we return a throw expression.
Ideally this will never happen because we will make sure the analyzer
stops us from trying to use Set properties on unsupported type.
4. Added support for casting in the Setter. We are using a lambda
factory that captures the type of the property ONLY when is needed, this
should be lazy enough.

With this change we should be able to fully generate field properties.

---------

Co-authored-by: GitHub Actions Autoformatter <[email protected]>
Add some extra tests to cover more properties combinations.

PS: I thought we had a bug, we didn't but is always nice to cover more
cases.

---------

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

The method takes into account the property associated with the accessor
and any possible export method that has been added to the accessor
itself.

The setter label for the default case uses the Registrar.core code.

---------

Co-authored-by: GitHub Actions Autoformatter <[email protected]>
* It's causing trimmer warnings in our tests.
* It's not used.

So just remove it.
Add code that starts generating field properties. This commits loops
over the field properties and emit the following code:

* Auto generated attributes for the properties.
* SupportedOS attributes for properties.
* SupportedOS attributes for accessors.
* Acessors with no implementation.
* Advice attribute for notification fields.

The code also keeps track of the notifications to later allow to
generate the helper clases.

---------

Co-authored-by: GitHub Actions Autoformatter <[email protected]>
Co-authored-by: Rolf Bjarne Kvinge <[email protected]>
…22005)

We want to be able to know if a symbol is:

* An Interface
* An enumerator with a native attribute.
* If the interger used a C# keyword to be created.

---------

Co-authored-by: GitHub Actions Autoformatter <[email protected]>
Co-authored-by: Copilot <[email protected]>
…abled. (#22008)

The script could not handle setting the roslyn analyzer reporting, we
need to add a single property for that in the csproj.
…ions (#21997)

Properties can also do it. Allow to set the flag and provide a method
that will allow use to know if an accessor should marshal the native
exceptions or not.

---------

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

Add a new flag that can be used to let the generator know that a exposed
method or property can have a custom marshalling call.

Later the analyzer will make sure that only when the appropiate flag is
set, that the extra name parameters are allowed.

---------

Co-authored-by: GitHub Actions Autoformatter <[email protected]>
Allow the transformer to choose the topic for a base declaration by
looking at the attribute data.

---------

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

In this change we are making the necesary changes to share the data
model code between the generator and the transformer.

When we talk about sharing code in C# the average dotnet developer would
create a csproj with the shared code and would reference it. In normal
circumtances this is not a bad option, but our case is different and
here are some of the reasons we cannot take that path:

1. Roslyn code generators with more than one dll are problematic to
distribute. You can already see how bad it is by looking at the dll
shared between the code generator and the analyzer. The shared library
has to be added as an analyzer so that it loads with the generator. We
want to keep the number of dlls to a minimun.
2. While the data models are similar, they are not identical. The
attributes used by the code generator and the old api defintions are
different. We would around this by splitting the definitions in 2 files:
a - A common file with all date that does not depend on the attributes.
b - A application specific file that contains the properties needed by
the common parts BUT that uses structures specific for the application.
An example is the ExportData. The ExportData is a generic in the
generator (which contains flags) while it is not in the transformer. We
also split the TryCreate and Constructor methods since those need to
init the application specific parths.

In this commit we do not implement the transformer parts since that
would make the diff hader. We are only moving code around and adding
dummy implementations for the transformer project to compile.

---------

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

Add the code that will parse an attribute data for a
Foundation.ExportAttribute.

---------

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

If we are generating code, specially in the transformer, that does not
have a specific platform, we need to generate the correct trivia to
ensure that methods are not generated in the wrong platform.

---------

Co-authored-by: GitHub Actions Autoformatter <[email protected]>
Allow the command line to be used with more than one rsp. That allows to
pass all the rsp for the different platforms we support allowing us to
merge the compilation results later to be used by the transformation.

---------

Co-authored-by: GitHub Actions Autoformatter <[email protected]>
@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.

…ws when bundling original resources.

Otherwise the binding resource package isn't created, because no library
projects are built remotely when bundling original resources.

Fixes this error in the BundleStructureWithRemoteMac test:

    Errors
        D:\AzDO\_work\16\s\xamarin-macios\tests\dotnet\Windows\bin\dotnet\packs\Microsoft.iOS.Sdk.net10.0_18.2\18.2.10345-ci.pr.gh22105\targets\Xamarin.Shared.Sdk.targets(1655,3): clang++ exited with code 1:
    Undefined symbols for architecture arm64:
      "_theUltimateAnswer", referenced from:
          <initial-undefines>
    ld: symbol(s) not found for architecture arm64
    clang++: error: linker command failed with exit code 1 (use -v to see invocation) [d:\AzDO\_work\16\s\xamarin-macios\tests\dotnet\BundleStructure\iOS\BundleStructure.csproj]
@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.

@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
Copy link
Collaborator

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

Pipeline on Agent
Hash: 31a0546ff71a357ae721c10dd1534e138ee42771 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

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

Pipeline on Agent
Hash: 31a0546ff71a357ae721c10dd1534e138ee42771 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

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

Pipeline on Agent
Hash: 31a0546ff71a357ae721c10dd1534e138ee42771 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

❌ [CI Build] Windows Integration Tests failed ❌

❌ Failed ❌

Pipeline on Agent
Hash: 31a0546ff71a357ae721c10dd1534e138ee42771 [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: 31a0546ff71a357ae721c10dd1534e138ee42771 [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: 31a0546ff71a357ae721c10dd1534e138ee42771 [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: 31a0546ff71a357ae721c10dd1534e138ee42771 [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: 31a0546ff71a357ae721c10dd1534e138ee42771 [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: 31a0546ff71a357ae721c10dd1534e138ee42771 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@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, 108 tests passed.

Failures

❌ linker tests [attempt 3]

4 tests failed, 40 tests passed.
  • dont link/iOS - simulator/Release: BuildFailure
  • dont link/tvOS - simulator/Release: BuildFailure
  • trimmode copy/iOS - simulator/Release: BuildFailure
  • trimmode copy/tvOS - simulator/Release: BuildFailure

Html Report (VSDrops) Download

Successes

✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (tvOS): 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 4 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 8 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: 31a0546ff71a357ae721c10dd1534e138ee42771 [PR build]

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.

6 participants