-
Notifications
You must be signed in to change notification settings - Fork 829
Annotate Serilog for trimming #1690
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
Conversation
2.1.0 Release
2.2.0 Release
Release 2.2.1
2.3.0 Release
2.4.0 Release
2.5.0 Release
2.6.0 Release
Release 2.7.1
2.8.0 Release
2.9.0 Release
2.10.0 Release
2.11.0 Release
Thanks @agocke! To get the build green with these changes, the worker image in AppVeyor.yml will need to be updated to VS2022 (IIRC). |
|
…erilog#1706) This reverts commit 50f6cd0.
Thanks! Looks like there have been a few changes between when I originally wrote this and now, so it needs a little fixup. I'll move to draft until I can address the last remaining warnings. |
i pulled the ITuple parts of this into the main line. would you mind rebasing Could you also add a sample app that consumes serilog and uses trimming. So we can smoke test the changes |
@SimonCropp All updated. Happy to add a sample. Where would you like it? FYI, there should be some correctness assurance via the |
Great! It looks like there are still some problems to resolve -
(From the failed CI build) |
@nblumhardt Thanks, sorry for the delay, took a little digging to track this down. The remaining errors appear to be caused by a bug and an unimplemented feature, both of which were fixed in the .NET 7 SDK. Unfortunately, those fixes don't apply in your build because you're using the .NET 6 SDK (and even if you built using .NET 7, your global.json forces the 6.0 version). I'm not sure what your preferred fix is. I could introduce some hacks, but using the 7.0 SDK seems more reliable. |
given 7.0 SDK should be out this week, i dont think hacks to work with 6sdk will be necessary |
Looks like appveyor Ubuntu is missing .net 7. Not sure if there’s a way to speed that up, or if we just need to wait for them to update. |
It's been a couple months and I still don't see any updates for Ubuntu .NET. It would be good to know if they have plans to install 7.0, or if they stick on 6.0. |
@nblumhardt @SimonCropp What do you think about switching from Appveyor to GitHub Actions? I got the impression that GitHub Actions has richer tuning possible and evolves faster. |
I suggest to include "smoke test" directly into ci pipeline like it was done here https://github.com/graphql-dotnet/graphql-dotnet/blob/master/.github/workflows/test-code.yml#L74-L83, PR - graphql-dotnet/graphql-dotnet#3506 |
Another suggestion - use PolySharp as was done here https://github.com/graphql-dotnet/graphql-dotnet/blob/master/src/Directory.Build.props#L29 . PolySharp allows to get rid of annoying ifdefs scuttered across the codebase. |
I think I managed to add an apt install command that works. Now things are failing because I think I made 8+ element tuples work on net5+ and there's a test that says they shouldn't 😄 |
@@ -28,19 +30,19 @@ | |||
</PropertyGroup> | |||
|
|||
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.1' "> | |||
<DefineConstants>$(DefineConstants);FEATURE_DEFAULT_INTERFACE;FEATURE_SPAN;FEATURE_ASYNCDISPOSABLE;FEATURE_DICTIONARYTRYADD</DefineConstants> | |||
<DefineConstants>$(DefineConstants);FEATURE_DEFAULT_INTERFACE;FEATURE_SPAN;FEATURE_ITUPLE;FEATURE_ASYNCDISPOSABLE;FEATURE_DICTIONARYTRYADD</DefineConstants> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FEATURE_ITUPLE
is not needed anymore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What should I use instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing, this is merge artifact.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that's correct; there's still a reference to it in PropertyValueConverter
, and the CSPROJ targets .NET 4.6 where it's unsupported.
https://github.com/serilog/serilog/blob/dev/src/Serilog/Capturing/PropertyValueConverter.cs#L249
Still some work to do once we've finalized framework version support.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I confused it with another feature.
appveyor.yml
Outdated
@@ -4,6 +4,8 @@ image: | |||
- Visual Studio 2022 | |||
- Ubuntu | |||
configuration: Release | |||
install: | |||
- sh: sudo apt-get update && sudo apt-get install -y dotnet-sdk-7.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NET7 was configured in #1806
we have net7 installing and running on linux on the main branch. what am i missing? |
I think I just missed that -- I have to fix up the tests but that may be it. |
This one's now been open a long time; I think there's still more to explore (could we just polyfill Thanks @agocke! |
PolySharp does this |
Most of serilog is trim-compatible. The main incompatibility is
configuration settings which scan assemblies at run time.
Serilog.Settings.Configuration is the more difficult challenge.