Skip to content

Support Native AOT#619

Merged
gregsdennis merged 230 commits into
masterfrom
native-aot
Feb 3, 2024
Merged

Support Native AOT#619
gregsdennis merged 230 commits into
masterfrom
native-aot

Conversation

@gregsdennis

@gregsdennis gregsdennis commented Jan 24, 2024

Copy link
Copy Markdown
Collaborator

This PR adds support for Native AOT and source generation through implementing framework multitargeting.

Resolves #390
Resolves #532
Replaces #618
Relates to #611

This is the root PR. Since I have other people helping with this effort (thanks!), satellite PRs will be created to pull into this one.

To do:

@github-actions

github-actions Bot commented Jan 24, 2024

Copy link
Copy Markdown

Test Results

    15 files  ±  0      15 suites  ±0   13s ⏱️ -4s
20 478 tests +268  19 114 ✅ +261  1 364 💤 + 7  0 ❌ ±0 
20 570 runs   -  16  19 203 ✅ + 22  1 367 💤  - 38  0 ❌ ±0 

Results for commit 3466574. ± Comparison against base commit 5f8949b.

This pull request removes 122 and adds 381 tests. Note that renamed tests count towards both.
    "other string"
    "string",
    42
  "foo": 42
  "foo": [
  42
  ]
Json.JsonE.Tests.Suite.SuiteRunner ‑ $map array index variable  |  {"$map":["a","b","c"],"each(y,i)":"${y}-$0-1234"}  |  {}
Json.JsonE.Tests.TruthyTests ‑ IsTruthy([
Json.JsonE.Tests.TruthyTests ‑ IsTruthy({
…
Json.JsonE.Tests.Suite.SuiteRunner ‑ $map array index variable  |  {"$map":["a","b","c"],"each(y,i)":"${y}-$0-1235"}  |  {}
Json.JsonE.Tests.TruthyTests ‑ IsTruthy([
  42
],True)
Json.JsonE.Tests.TruthyTests ‑ IsTruthy({
  "foo": 42
},True)
Json.Logic.Tests.Suite.MoreTests ‑ {"\u002B":3}  |  {}  |  3
Json.Logic.Tests.Suite.MoreTests ‑ {"\u002B":[1,{}]}  |  {}  |  null
Json.Logic.Tests.Suite.MoreTests ‑ {"\u003C":["","4",5]}  |  {}  |  true
Json.Logic.Tests.Suite.MoreTests ‑ {"\u003C":["123","456","789"]}  |  {}  |  true
Json.Logic.Tests.Suite.MoreTests ‑ {"\u003C":["123",456,"789"]}  |  {}  |  true
Json.Logic.Tests.Suite.MoreTests ‑ {"\u003C":["123a",456,"789"]}  |  {}  |  false
Json.Logic.Tests.Suite.MoreTests ‑ {"\u003C":["456",123]}  |  {}  |  false
…
This pull request skips 7 tests.
Json.JsonE.Tests.DevTest ‑ Check
Json.Schema.Tests.Suite.Output ‑ draft2019-09 / escape / tilde and forward slash in json-pointer / incorrect type must be reported, but a message is not required / basic
Json.Schema.Tests.Suite.Output ‑ draft2019-09 / readOnly / readOnly generates its value as an annotation / readOnly is true / basic
Json.Schema.Tests.Suite.Output ‑ draft2019-09 / type / validating type / incorrect type must be reported, but a message is not required / basic
Json.Schema.Tests.Suite.Output ‑ draft2020-12 / escape / tilde and forward slash in json-pointer / incorrect type must be reported, but a message is not required / basic
Json.Schema.Tests.Suite.Output ‑ draft2020-12 / readOnly / readOnly generates its value as an annotation / readOnly is true / basic
Json.Schema.Tests.Suite.Output ‑ draft2020-12 / type / validating type / incorrect type must be reported, but a message is not required / basic

♻️ This comment has been updated with latest results.

gregsdennis and others added 22 commits February 2, 2024 17:16
Add Read and Write collection helpers and start converting to them
…der-methods

Native aot with ~options builder methods~ just the right attributes on the test contexts
@gregsdennis gregsdennis marked this pull request as ready for review February 3, 2024 01:17
Comment thread Json.More/JsonElementProxy.cs Outdated
Comment thread JsonLogic/JsonLogic.csproj Outdated

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFrameworks>netstandard2.1;net8.0</TargetFrameworks>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we were dropping netstandard with this change?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. Actually, because of PolySharp, I might even be able to move back to NS 2.0! I'll check that.

We dropped support for .Net Core 3.1 because of an incompatiblity in a dependency of STJ v8, but I still want to have .Net Standard for support outside of .Net 8.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like Logic can be pushed down to .Net Standard 2.0. All I needed was to add a deconstructor for KeyValuePair<,>.

But Path is using all sorts of new APIs, like a lot of what's defined on spans.

@gregsdennis gregsdennis merged commit 0953b87 into master Feb 3, 2024
@gregsdennis gregsdennis deleted the native-aot branch February 3, 2024 04:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Parsing schema from string when compiled to NativeAOT with net8 Moving on from .Net Standard

4 participants