Skip to content

Commit eff0f8e

Browse files
authored
Update to .NET 10.0 SDK (#600)
* update to .NET 10.0 SDK * drop support for .NET 6.0 * update devcontainer for .NET 10.0 * use free arm64 runner to build devcontainer * compare spans to the empty span where appropriate
1 parent 77038d3 commit eff0f8e

File tree

17 files changed

+106
-51
lines changed

17 files changed

+106
-51
lines changed

.devcontainer/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM mcr.microsoft.com/devcontainers/dotnet:1-9.0-bookworm-slim AS dotnet
1+
FROM mcr.microsoft.com/devcontainers/dotnet:2-10.0-noble AS dotnet
22

33
#====================================================================
44

@@ -10,7 +10,7 @@ USER vscode
1010
COPY --chown=vscode:vscode . /tmp/build/
1111

1212
# Populate the nuget cache with all of our dependencies
13-
RUN for project in /tmp/build/csharp*; do \
13+
RUN for project in /tmp/build/?sharp*; do \
1414
dotnet restore $project; \
1515
done
1616

.github/workflows/ci.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ jobs:
2525
steps:
2626
- name: Checkout
2727
uses: actions/checkout@v6
28-
- name: Setup .NET SDK v9.0.x
28+
- name: Setup .NET SDK v10.0.x
2929
uses: actions/setup-dotnet@v5
3030
with:
31-
dotnet-version: 9.0.x
31+
dotnet-version: 10.0.x
3232
- name: Code formating check
3333
run: |
3434
dotnet tool restore
@@ -126,10 +126,10 @@ jobs:
126126
run: brew install bison
127127

128128
# .NET Setup (and also MSBuild for Windows).
129-
- name: Setup .NET SDK v9.0.x
129+
- name: Setup .NET SDK v10.0.x
130130
uses: actions/setup-dotnet@v5
131131
with:
132-
dotnet-version: 9.0.x
132+
dotnet-version: 10.0.x
133133
- name: Setup MSBuild
134134
if: runner.os == 'Windows'
135135
uses: microsoft/setup-msbuild@v2
@@ -193,10 +193,10 @@ jobs:
193193
run: |
194194
mkdir bin
195195
cp -rv artifacts/*-native-library/* bin/
196-
- name: Setup .NET SDK v9.0.x
196+
- name: Setup .NET SDK v10.0.x
197197
uses: actions/setup-dotnet@v5
198198
with:
199-
dotnet-version: 9.0.x
199+
dotnet-version: 10.0.x
200200
- name: Get version
201201
id: get-version
202202
shell: pwsh
@@ -235,7 +235,7 @@ jobs:
235235
- windows-2022
236236
- windows-2025
237237
- windows-11-arm
238-
dotnet: [net6.0, net8.0, net9.0]
238+
dotnet: [net8.0, net9.0, net10.0]
239239
include:
240240
- os: windows-2022
241241
dotnet: net472
@@ -255,20 +255,20 @@ jobs:
255255
with:
256256
name: nuget-package
257257
path: nuget
258-
- name: Setup .NET SDK v6.0.x
259-
if: matrix.dotnet == 'net6.0'
260-
uses: actions/setup-dotnet@v5
261-
with:
262-
dotnet-version: 6.0.x
263258
- name: Setup .NET SDK v8.0.x
264259
if: matrix.dotnet == 'net8.0'
265260
uses: actions/setup-dotnet@v5
266261
with:
267262
dotnet-version: 8.0.x
268263
- name: Setup .NET SDK v9.0.x
264+
if: matrix.dotnet == 'net9.0'
269265
uses: actions/setup-dotnet@v5
270266
with:
271267
dotnet-version: 9.0.x
268+
- name: Setup .NET SDK v10.0.x
269+
uses: actions/setup-dotnet@v5
270+
with:
271+
dotnet-version: 10.0.x
272272
- name: Add local NuGet feed
273273
run: |
274274
dotnet new nugetconfig
@@ -298,10 +298,10 @@ jobs:
298298
name: nuget-package
299299
path: nuget
300300

301-
- name: Setup .NET SDK v8.0.x
301+
- name: Setup .NET SDK v10.0.x
302302
uses: actions/setup-dotnet@v5
303303
with:
304-
dotnet-version: 8.0.x
304+
dotnet-version: 10.0.x
305305

306306
- name: Add local NuGet feed
307307
run: |
@@ -367,10 +367,10 @@ jobs:
367367
with:
368368
name: nuget-package
369369
path: nuget
370-
- name: Setup .NET SDK v9.0.x
370+
- name: Setup .NET SDK v10.0.x
371371
uses: actions/setup-dotnet@v5
372372
with:
373-
dotnet-version: 9.0.x
373+
dotnet-version: 10.0.x
374374
# if version contains "-" treat it as pre-release
375375
# example: 1.0.0-beta1
376376
- name: Create release

.github/workflows/devcontainer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
strategy:
3232
fail-fast: false
3333
matrix:
34-
runner: [ubuntu-latest, ubuntu-22.04-arm64]
34+
runner: [ubuntu-latest, ubuntu-24.04-arm]
3535
runs-on: ${{ matrix.runner }}
3636
steps:
3737
- name: Set up Docker Buildx

csharp.benchmark/ParquetSharp.Benchmark.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
55
<TargetFramework>net8.0</TargetFramework>
6-
<LangVersion>9.0</LangVersion>
6+
<LangVersion>10.0</LangVersion>
77
<Nullable>enable</Nullable>
88
<AssemblyName>ParquetSharp.Benchmark</AssemblyName>
99
<RootNamespace>ParquetSharp.Benchmark</RootNamespace>

csharp.test/ParquetSharp.Test.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net8.0</TargetFrameworks>
4+
<TargetFrameworks>net10.0</TargetFrameworks>
55
<!-- Avoid building for other frameworks when testing locally. -->
66
<!-- This is to speed up the build process and avoid errors when the required runtimes are not installed. -->
7-
<TargetFrameworks Condition="'$(CI)' == 'true'">$(TargetFrameworks);net6.0;net9.0</TargetFrameworks>
7+
<TargetFrameworks Condition="'$(CI)' == 'true'">$(TargetFrameworks);net8.0;net9.0</TargetFrameworks>
88
<TargetFrameworks Condition="'$(CI)' == 'true' AND '$(OS)'=='Windows_NT'">$(TargetFrameworks);net472</TargetFrameworks>
9-
<LangVersion>9.0</LangVersion>
9+
<LangVersion>10.0</LangVersion>
1010
<Nullable>enable</Nullable>
1111
<AssemblyName>ParquetSharp.Test</AssemblyName>
1212
<RootNamespace>ParquetSharp.Test</RootNamespace>

csharp/ColumnReader.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,10 +227,9 @@ public long ReadBatch(long batchSize, Span<TValue> values, out long valuesRead)
227227

228228
public unsafe long ReadBatch(long batchSize, Span<short> defLevels, Span<short> repLevels, Span<TValue> values, out long valuesRead)
229229
{
230-
if (values == null) throw new ArgumentNullException(nameof(values));
231230
if (values.Length < batchSize) throw new ArgumentOutOfRangeException(nameof(values), "batchSize is larger than length of values");
232-
if (defLevels != null && defLevels.Length < batchSize) throw new ArgumentOutOfRangeException(nameof(defLevels), "batchSize is larger than length of defLevels");
233-
if (repLevels != null && repLevels.Length < batchSize) throw new ArgumentOutOfRangeException(nameof(repLevels), "batchSize is larger than length of repLevels");
231+
if (!defLevels.IsEmpty && defLevels.Length < batchSize) throw new ArgumentOutOfRangeException(nameof(defLevels), "batchSize is larger than length of defLevels");
232+
if (!repLevels.IsEmpty && repLevels.Length < batchSize) throw new ArgumentOutOfRangeException(nameof(repLevels), "batchSize is larger than length of repLevels");
234233

235234
var type = typeof(TValue);
236235

csharp/ColumnWriter.cs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -284,14 +284,12 @@ public void WriteBatch(ReadOnlySpan<TValue> values)
284284
/// <remarks>
285285
/// The lengths of <paramref name="defLevels"/> and <paramref name="repLevels"/> must be at least <paramref name="numValues"/>.
286286
/// </remarks>
287-
/// <exception cref="ArgumentNullException">Thrown if <paramref name="values"/> is null.</exception>
288287
/// <exception cref="ArgumentOutOfRangeException">Thrown if <paramref name="numValues"/> is larger
289288
/// than the length of <paramref name="defLevels"/> or <paramref name="repLevels"/>.</exception>
290289
public unsafe void WriteBatch(int numValues, ReadOnlySpan<short> defLevels, ReadOnlySpan<short> repLevels, ReadOnlySpan<TValue> values)
291290
{
292-
if (values == null) throw new ArgumentNullException(nameof(values));
293-
if (defLevels != null && defLevels.Length < numValues) throw new ArgumentOutOfRangeException(nameof(defLevels), "numValues is larger than length of defLevels");
294-
if (repLevels != null && repLevels.Length < numValues) throw new ArgumentOutOfRangeException(nameof(repLevels), "numValues is larger than length of repLevels");
291+
if (!defLevels.IsEmpty && defLevels.Length < numValues) throw new ArgumentOutOfRangeException(nameof(defLevels), "numValues is larger than length of defLevels");
292+
if (!repLevels.IsEmpty && repLevels.Length < numValues) throw new ArgumentOutOfRangeException(nameof(repLevels), "numValues is larger than length of repLevels");
295293

296294
var type = typeof(TValue);
297295

@@ -363,10 +361,6 @@ public unsafe void WriteBatchSpaced(
363361
int numValues, ReadOnlySpan<short> defLevels, ReadOnlySpan<short> repLevels,
364362
ReadOnlySpan<byte> validBits, long validBitsOffset, ReadOnlySpan<TValue> values)
365363
{
366-
if (values == null) throw new ArgumentNullException(nameof(values));
367-
if (defLevels == null) throw new ArgumentNullException(nameof(defLevels));
368-
if (repLevels == null) throw new ArgumentNullException(nameof(repLevels));
369-
if (validBits == null) throw new ArgumentNullException(nameof(validBits));
370364
//if (values.Length < numValues) throw new ArgumentOutOfRangeException("numValues is larger than length of values");
371365
if (defLevels.Length < numValues) throw new ArgumentOutOfRangeException(nameof(defLevels), "numValues is larger than length of defLevels");
372366
if (repLevels.Length < numValues) throw new ArgumentOutOfRangeException(nameof(repLevels), "numValues is larger than length of repLevels");

csharp/ParquetSharp.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net6;net471;netstandard2.1</TargetFrameworks>
5-
<LangVersion>9.0</LangVersion>
4+
<TargetFrameworks>net8.0;net471;netstandard2.1</TargetFrameworks>
5+
<LangVersion>10.0</LangVersion>
66
<Nullable>enable</Nullable>
77
<AssemblyName>ParquetSharp</AssemblyName>
88
<RootNamespace>ParquetSharp</RootNamespace>

csharp/PublicAPI.Shipped.txt

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ ParquetSharp.Arrow.SchemaManifest.SchemaFields.get -> System.Collections.Generic
121121
ParquetSharp.BsonLogicalType
122122
ParquetSharp.ByteArray
123123
ParquetSharp.ByteArray.ByteArray() -> void
124-
ParquetSharp.ByteArray.ByteArray(System.IntPtr pointer, int length) -> void
125124
ParquetSharp.ByteArray.Equals(ParquetSharp.ByteArray other) -> bool
126125
ParquetSharp.ByteArrayReaderCache<TPhysical, TLogical>
127126
ParquetSharp.ByteArrayReaderCache<TPhysical, TLogical>.Add(TPhysical physical, TLogical logical) -> TLogical
@@ -398,7 +397,6 @@ ParquetSharp.FileMetaData.WriterVersion.get -> ParquetSharp.ApplicationVersion!
398397
ParquetSharp.FixedLenByteArray
399398
ParquetSharp.FixedLenByteArray.Equals(ParquetSharp.FixedLenByteArray other) -> bool
400399
ParquetSharp.FixedLenByteArray.FixedLenByteArray() -> void
401-
ParquetSharp.FixedLenByteArray.FixedLenByteArray(System.IntPtr pointer) -> void
402400
ParquetSharp.Float16LogicalType
403401
ParquetSharp.IColumnDescriptorVisitor<TReturn>
404402
ParquetSharp.IColumnDescriptorVisitor<TReturn>.OnColumnDescriptor<TPhysical, TLogical, TElement>() -> TReturn
@@ -419,11 +417,8 @@ ParquetSharp.IntLogicalType
419417
ParquetSharp.IntLogicalType.BitWidth.get -> int
420418
ParquetSharp.IntLogicalType.IsSigned.get -> bool
421419
ParquetSharp.IO.Buffer
422-
ParquetSharp.IO.Buffer.Buffer(System.IntPtr data, long size) -> void
423420
ParquetSharp.IO.Buffer.Capacity.get -> long
424-
ParquetSharp.IO.Buffer.Data.get -> System.IntPtr
425421
ParquetSharp.IO.Buffer.Dispose() -> void
426-
ParquetSharp.IO.Buffer.MutableData.get -> System.IntPtr
427422
ParquetSharp.IO.Buffer.Size.get -> long
428423
ParquetSharp.IO.Buffer.ToArray() -> byte[]!
429424
ParquetSharp.IO.BufferOutputStream
@@ -441,11 +436,9 @@ ParquetSharp.IO.ManagedRandomAccessFile.ManagedRandomAccessFile(System.IO.Stream
441436
ParquetSharp.IO.OutputStream
442437
ParquetSharp.IO.OutputStream.Dispose() -> void
443438
ParquetSharp.IO.OutputStream.OutputStream() -> void
444-
ParquetSharp.IO.OutputStream.OutputStream(System.IntPtr handle) -> void
445439
ParquetSharp.IO.RandomAccessFile
446440
ParquetSharp.IO.RandomAccessFile.Dispose() -> void
447441
ParquetSharp.IO.RandomAccessFile.RandomAccessFile() -> void
448-
ParquetSharp.IO.RandomAccessFile.RandomAccessFile(System.IntPtr handle) -> void
449442
ParquetSharp.IO.ResizableBuffer
450443
ParquetSharp.JsonLogicalType
451444
ParquetSharp.ListLogicalType
@@ -477,7 +470,6 @@ ParquetSharp.LogicalReadConverterFactory.LogicalReadConverterFactory() -> void
477470
ParquetSharp.LogicalType
478471
ParquetSharp.LogicalType.Dispose() -> void
479472
ParquetSharp.LogicalType.Equals(ParquetSharp.LogicalType? other) -> bool
480-
ParquetSharp.LogicalType.LogicalType(System.IntPtr handle) -> void
481473
ParquetSharp.LogicalType.Type.get -> ParquetSharp.LogicalTypeEnum
482474
ParquetSharp.LogicalTypeEnum
483475
ParquetSharp.LogicalTypeEnum.Bson = 13 -> ParquetSharp.LogicalTypeEnum
@@ -686,7 +678,6 @@ ParquetSharp.Schema.Node.Equals(ParquetSharp.Schema.Node? other) -> bool
686678
ParquetSharp.Schema.Node.FieldId.get -> int
687679
ParquetSharp.Schema.Node.LogicalType.get -> ParquetSharp.LogicalType!
688680
ParquetSharp.Schema.Node.Name.get -> string!
689-
ParquetSharp.Schema.Node.Node(System.IntPtr handle) -> void
690681
ParquetSharp.Schema.Node.NodeType.get -> ParquetSharp.Schema.NodeType
691682
ParquetSharp.Schema.Node.Parent.get -> ParquetSharp.Schema.Node?
692683
ParquetSharp.Schema.Node.Path.get -> ParquetSharp.Schema.ColumnPath!
@@ -813,14 +804,12 @@ readonly ParquetSharp.ApplicationVersion.Patch -> int
813804
readonly ParquetSharp.ApplicationVersion.PreRelease -> string!
814805
readonly ParquetSharp.ApplicationVersion.Unknown -> string!
815806
readonly ParquetSharp.ByteArray.Length -> int
816-
readonly ParquetSharp.ByteArray.Pointer -> System.IntPtr
817807
readonly ParquetSharp.Column.Length -> int
818808
readonly ParquetSharp.Column.LogicalSystemType -> System.Type!
819809
readonly ParquetSharp.Column.LogicalTypeOverride -> ParquetSharp.LogicalType?
820810
readonly ParquetSharp.Column.Name -> string!
821811
readonly ParquetSharp.Date.Days -> int
822812
readonly ParquetSharp.DateTimeNanos.Ticks -> long
823-
readonly ParquetSharp.FixedLenByteArray.Pointer -> System.IntPtr
824813
readonly ParquetSharp.Int96.A -> int
825814
readonly ParquetSharp.Int96.B -> int
826815
readonly ParquetSharp.Int96.C -> int

csharp/PublicAPI/net6/PublicAPI.Shipped.txt renamed to csharp/PublicAPI/net10.0/PublicAPI.Shipped.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
11
#nullable enable
2+
ParquetSharp.ByteArray.ByteArray(nint pointer, int length) -> void
3+
ParquetSharp.FixedLenByteArray.FixedLenByteArray(nint pointer) -> void
4+
ParquetSharp.IO.Buffer.Buffer(nint data, long size) -> void
5+
ParquetSharp.IO.Buffer.Data.get -> nint
6+
ParquetSharp.IO.Buffer.MutableData.get -> nint
7+
ParquetSharp.IO.OutputStream.OutputStream(nint handle) -> void
8+
ParquetSharp.IO.RandomAccessFile.RandomAccessFile(nint handle) -> void
9+
ParquetSharp.LogicalType.LogicalType(nint handle) -> void
210
ParquetSharp.LogicalTypeFactory.DateAsDateOnly.get -> bool
311
ParquetSharp.LogicalTypeFactory.DateAsDateOnly.set -> void
412
ParquetSharp.LogicalTypeFactory.TimeAsTimeOnly.get -> bool
513
ParquetSharp.LogicalTypeFactory.TimeAsTimeOnly.set -> void
14+
ParquetSharp.Schema.Node.Node(nint handle) -> void
15+
readonly ParquetSharp.ByteArray.Pointer -> nint
16+
readonly ParquetSharp.FixedLenByteArray.Pointer -> nint
617
static ParquetSharp.LogicalRead.ConvertDateOnly(System.ReadOnlySpan<int> source, System.ReadOnlySpan<short> defLevels, System.Span<System.DateOnly?> destination, short definedLevel) -> void
718
static ParquetSharp.LogicalRead.ConvertDateOnly(System.ReadOnlySpan<int> source, System.Span<System.DateOnly> destination) -> void
819
static ParquetSharp.LogicalRead.ConvertHalf(System.ReadOnlySpan<ParquetSharp.FixedLenByteArray> source, System.ReadOnlySpan<short> defLevels, System.Span<System.Half?> destination, short definedLevel) -> void

0 commit comments

Comments
 (0)