Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: '3'
services:
npgsql-dev:
# Source for tags: https://mcr.microsoft.com/v2/dotnet/sdk/tags/list
image: mcr.microsoft.com/dotnet/sdk:8.0.100-preview.3
image: mcr.microsoft.com/dotnet/sdk:8.0.100-preview.4
volumes:
- ..:/workspace:cached
tty: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
pull_request:

env:
dotnet_sdk_version: '8.0.100-preview.3.23178.7'
dotnet_sdk_version: '8.0.100-preview.4.23260.5'
postgis_version: 3
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
# Windows comes with PG pre-installed, and defines the PGPASSWORD environment variable. Remove it as it interferes
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ on:
- cron: '21 0 * * 4'

env:
dotnet_sdk_version: '8.0.100-preview.3.23178.7'
dotnet_sdk_version: '8.0.100-preview.4.23260.5'
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true

jobs:
analyze:
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/native-aot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
pull_request:

env:
dotnet_sdk_version: '8.0.100-preview.3.23178.7'
dotnet_sdk_version: '8.0.100-preview.4.23260.5'
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true

jobs:
Expand Down Expand Up @@ -68,10 +68,14 @@ jobs:
size="$(ls -l test/Npgsql.NativeAotTests/bin/Release/net8.0/linux-x64/native/Npgsql.NativeAotTests | cut -d ' ' -f 5)"
echo "Binary size is $size bytes ($((size / (1024 * 1024))) mb)" >> $GITHUB_STEP_SUMMARY

# Temporarily disabled due to NativeAOT bug, see dotnet/runtime#86376
- name: Dump mstat
if: ${{ false }}
run: dotnet run --project test/MStatDumper/MStatDumper.csproj -c release -f net8.0 -- "test/Npgsql.NativeAotTests/obj/Release/net8.0/linux-x64/native/Npgsql.NativeAotTests.mstat" md >> $GITHUB_STEP_SUMMARY

# Temporarily disabled due to NativeAOT bug, see dotnet/runtime#86376
- name: Upload mstat
if: ${{ false }}
uses: actions/[email protected]
with:
name: npgsql.mstat
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rich-code-nav.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- '*'

env:
dotnet_sdk_version: '8.0.100-preview.3.23178.7'
dotnet_sdk_version: '8.0.100-preview.4.23260.5'
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true

jobs:
Expand Down
5 changes: 4 additions & 1 deletion src/Npgsql/NpgsqlException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ public virtual bool IsTransient
/// </summary>
/// <param name="info">The SerializationInfo that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The StreamingContext that contains contextual information about the source or destination.</param>
#if NET8_0_OR_GREATER
[Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.")]
#endif
protected internal NpgsqlException(SerializationInfo info, StreamingContext context) : base(info, context) {}

#endregion
}
}
8 changes: 7 additions & 1 deletion src/Npgsql/PostgresException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ static string GetMessage(string sqlState, string messageText, int position, stri
internal static PostgresException Load(NpgsqlReadBuffer buf, bool includeDetail, ILogger exceptionLogger)
=> new(ErrorOrNoticeMessage.Load(buf, includeDetail, exceptionLogger));

#if NET8_0_OR_GREATER
[Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.")]
#endif
internal PostgresException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
Expand Down Expand Up @@ -140,6 +143,9 @@ internal PostgresException(SerializationInfo info, StreamingContext context)
/// </summary>
/// <param name="info">The <see cref="SerializationInfo"/> to populate with data.</param>
/// <param name="context">The destination (see <see cref="StreamingContext"/>) for this serialization.</param>
#if NET8_0_OR_GREATER
[Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.")]
#endif
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
base.GetObjectData(info, context);
Expand Down Expand Up @@ -371,4 +377,4 @@ public override bool IsTransient
public string? Routine { get; }

#endregion
}
}
3 changes: 2 additions & 1 deletion test/Npgsql.NativeAotTests/Npgsql.NativeAotTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
<PublishAot>true</PublishAot>
<!-- We need to override TargetFrameworks here to avoid build failures -->
<TargetFrameworks>net8.0</TargetFrameworks>
<IlcGenerateMstatFile>true</IlcGenerateMstatFile>
<!-- Temporarily disabled due to NativeAOT bug, see dotnet/runtime#86376 -->
<IlcGenerateMstatFile>false</IlcGenerateMstatFile>
<InvariantGlobalization>true</InvariantGlobalization>
<StripSymbols>true</StripSymbols>
<UseSystemResourceKeys>true</UseSystemResourceKeys>
Expand Down
8 changes: 8 additions & 0 deletions test/Npgsql.Tests/ExceptionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ public void NpgsqlException_IsTransient()
Assert.False(new NpgsqlException("", new Exception("Inner Exception")).IsTransient);
}

#pragma warning disable SYSLIB0051
#pragma warning disable 618
[Test]
public void PostgresException_IsTransient()
{
Expand Down Expand Up @@ -243,8 +245,11 @@ PostgresException CreateWithSqlState(string sqlState)
return new PostgresException(info, default);
}
}
#pragma warning restore SYSLIB0051
#pragma warning restore 618

#pragma warning disable SYSLIB0011
#pragma warning disable SYSLIB0050
#pragma warning disable 618
[Test]
public void Serialization()
Expand Down Expand Up @@ -283,7 +288,9 @@ public void Serialization()
SerializationInfo CreateSerializationInfo() => new(typeof(PostgresException), new FormatterConverter());
#pragma warning restore 618
#pragma warning restore SYSLIB0011
#pragma warning disable SYSLIB0050

#pragma warning disable SYSLIB0051
[Test]
[IssueLink("https://github.com/npgsql/npgsql/issues/3204")]
public void Base_exception_property_serialization()
Expand All @@ -301,4 +308,5 @@ public void Base_exception_property_serialization()
Assert.That(ex.Source, Is.EqualTo(info.GetValue("Source", typeof(string))));
Assert.That(ex.StackTrace, Is.EqualTo(info.GetValue("StackTraceString", typeof(string))));
}
#pragma warning restore SYSLIB0051
}
3 changes: 3 additions & 0 deletions test/Npgsql.Tests/Npgsql.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@
<ItemGroup>
<ProjectReference Include="../../src/Npgsql/Npgsql.csproj" />
</ItemGroup>
<PropertyGroup>
<EnableUnsafeBinaryFormatterSerialization>true</EnableUnsafeBinaryFormatterSerialization>
</PropertyGroup>
</Project>