Skip to content

Commit

Permalink
SE.Redis DC backend / HybridCache : add net8.0 TFM (#56122)
Browse files Browse the repository at this point in the history
* add net8.0 TFM for distributed caching SE.Redis impl - this is for Garnet on Aspire which targets LTS hence 8

* prefer Versions.props variable over hard-coding net8.0

* PR feedback
  • Loading branch information
mgravell authored Jun 20, 2024
1 parent 79cab58 commit 7712869
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/UpdatingMajorVersionAndTFM.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Once dotnet/runtime has updated their TFM, we update ours in the dependency upda
### Required changes

* In [eng/Versions.props](/eng/Versions.props), increment `DefaultNetCoreTargetFramework` by 1.
* In [eng/Versions.props](/eng/Versions.props), **if and only if** the new TFM is LTS, update `CurrentLtsTargetFramework` to match `DefaultNetCoreTargetFramework`
* In [eng/SourceBuild.props](/eng/SourceBuild.props), update `SourceBuildTargetFrameworkFilter` to include the current TFM.
* Do a global repo search for the current version string, and update almost everything by 1 (e.g. find `net8`, replace with `net9`). See the PR linked above for examples - this shouldn't be done blindly, but on a case-by-case basis. Most things should be updated, and most choices should be obvious.
* Exceptions to this are [eng/tools/RepoTasks/RepoTasks.csproj](/eng/tools/RepoTasks/RepoTasks.csproj) and [eng/tools/RepoTasks/RepoTasks.tasks](/eng/tools/RepoTasks/RepoTasks.tasks). These build without the workarounds from [eng/tools/GenerateFiles/Directory.Build.targets.in](/eng/tools/GenerateFiles/Directory.Build.targets.in), and need to be kept at the previous TFM until we get an SDK containing a runtime with the new TFM. Generally this means we have to hard-code the previous TFM for these files, rather than using `DefaultNetCoreTargetFramework`.
Expand Down
4 changes: 4 additions & 0 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@
src\Razor\test\testassets\Directory.Build.props when this changes.
-->
<DefaultNetCoreTargetFramework>net9.0</DefaultNetCoreTargetFramework>
<!-- this should usually match for LTS builds, and be off-by-one otherwise;
example use-case here is OOB packages where Aspire wants to be able to consume
new features specific to OOB -->
<CurrentLtsTargetFramework>net8.0</CurrentLtsTargetFramework>
</PropertyGroup>
<PropertyGroup Label="Arcade settings">
<!-- Opt-in to Arcade tools for building VSIX projects. -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
net 5.0 : [DynamicallyAccessedMembers], EncodingExtensions.GetString/GetBytes, IsExternalInit
net 7.0 : ArgumentNullException.ThrowIfNull
-->
<TargetFrameworks>$(DefaultNetCoreTargetFramework);$(DefaultNetFxTargetFramework);netstandard2.0;netstandard2.1</TargetFrameworks>
<TargetFrameworks>$(DefaultNetCoreTargetFramework);$(DefaultNetFxTargetFramework);netstandard2.0;netstandard2.1;$(CurrentLtsTargetFramework)</TargetFrameworks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageTags>cache;distributedcache;hybrid</PackageTags>
<ExcludeFromSourceOnlyBuild>true</ExcludeFromSourceOnlyBuild>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<Description>Distributed cache implementation of Microsoft.Extensions.Caching.Distributed.IDistributedCache using Redis.</Description>
<TargetFrameworks>$(DefaultNetCoreTargetFramework);$(DefaultNetFxTargetFramework);netstandard2.0</TargetFrameworks>
<TargetFrameworks>$(DefaultNetCoreTargetFramework);$(DefaultNetFxTargetFramework);netstandard2.0;$(CurrentLtsTargetFramework)</TargetFrameworks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageTags>cache;distributedcache;redis</PackageTags>
<ExcludeFromSourceOnlyBuild>true</ExcludeFromSourceOnlyBuild>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#nullable enable
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#nullable enable
Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache
Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache.Dispose() -> void
Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache.Get(string! key) -> byte[]?
Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache.GetAsync(string! key, System.Threading.CancellationToken token = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task<byte[]?>!
Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache.RedisCache(Microsoft.Extensions.Options.IOptions<Microsoft.Extensions.Caching.StackExchangeRedis.RedisCacheOptions!>! optionsAccessor) -> void
Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache.Refresh(string! key) -> void
Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache.RefreshAsync(string! key, System.Threading.CancellationToken token = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task!
Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache.Remove(string! key) -> void
Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache.RemoveAsync(string! key, System.Threading.CancellationToken token = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task!
Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache.Set(string! key, byte[]! value, Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions! options) -> void
Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache.SetAsync(string! key, byte[]! value, Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions! options, System.Threading.CancellationToken token = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task!
Microsoft.Extensions.Caching.StackExchangeRedis.RedisCacheOptions
Microsoft.Extensions.Caching.StackExchangeRedis.RedisCacheOptions.Configuration.get -> string?
Microsoft.Extensions.Caching.StackExchangeRedis.RedisCacheOptions.Configuration.set -> void
Microsoft.Extensions.Caching.StackExchangeRedis.RedisCacheOptions.ConfigurationOptions.get -> StackExchange.Redis.ConfigurationOptions?
Microsoft.Extensions.Caching.StackExchangeRedis.RedisCacheOptions.ConfigurationOptions.set -> void
Microsoft.Extensions.Caching.StackExchangeRedis.RedisCacheOptions.ConnectionMultiplexerFactory.get -> System.Func<System.Threading.Tasks.Task<StackExchange.Redis.IConnectionMultiplexer!>!>?
Microsoft.Extensions.Caching.StackExchangeRedis.RedisCacheOptions.ConnectionMultiplexerFactory.set -> void
Microsoft.Extensions.Caching.StackExchangeRedis.RedisCacheOptions.InstanceName.get -> string?
Microsoft.Extensions.Caching.StackExchangeRedis.RedisCacheOptions.InstanceName.set -> void
Microsoft.Extensions.Caching.StackExchangeRedis.RedisCacheOptions.ProfilingSession.get -> System.Func<StackExchange.Redis.Profiling.ProfilingSession!>?
Microsoft.Extensions.Caching.StackExchangeRedis.RedisCacheOptions.ProfilingSession.set -> void
Microsoft.Extensions.Caching.StackExchangeRedis.RedisCacheOptions.RedisCacheOptions() -> void
Microsoft.Extensions.DependencyInjection.StackExchangeRedisCacheServiceCollectionExtensions
static Microsoft.Extensions.DependencyInjection.StackExchangeRedisCacheServiceCollectionExtensions.AddStackExchangeRedisCache(this Microsoft.Extensions.DependencyInjection.IServiceCollection! services, System.Action<Microsoft.Extensions.Caching.StackExchangeRedis.RedisCacheOptions!>! setupAction) -> Microsoft.Extensions.DependencyInjection.IServiceCollection!

0 comments on commit 7712869

Please sign in to comment.