Skip to content
This repository has been archived by the owner on Feb 22, 2025. It is now read-only.

Commit

Permalink
Merge branch 'main' into sdk-update
Browse files Browse the repository at this point in the history
  • Loading branch information
lachmatt authored Feb 15, 2024
2 parents 8d9ca58 + 6a383e0 commit b64961c
Show file tree
Hide file tree
Showing 102 changed files with 8,240 additions and 188 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,12 @@ jobs:
run: |
docker run --rm \
--mount type=bind,source="${GITHUB_WORKSPACE}",target=/project \
--env NugetPackageDirectory=/project/$(relativeNugetPackageDirectory) \
--env NugetPackageDirectory=/project/${relativeNugetPackageDirectory} \
--env tracerHome=/project/${relativeTracerHome} \
--env artifacts=/project/${relativeArtifacts} \
--env SIGNALFX_CLR_ENABLE_NGEN=${SIGNALFX_CLR_ENABLE_NGEN} \
dd-trace-dotnet/${{ matrix.base-image }}-builder \
dotnet /build/bin/Debug/_build.dll Clean BuildTracerHome ZipMonitoringHome
/bin/sh -c 'git config --global --add safe.directory /project && ./tracer/build.sh Clean BuildTracerHome ZipMonitoringHome'
- name: Publish Linux x64-musl packages
uses: actions/upload-artifact@v3.1.2
with:
Expand Down Expand Up @@ -226,12 +226,12 @@ jobs:
run: |
docker run --rm \
--mount type=bind,source="${GITHUB_WORKSPACE}",target=/project \
--env NugetPackageDirectory=/project/$(relativeNugetPackageDirectory) \
--env NugetPackageDirectory=/project/${relativeNugetPackageDirectory} \
--env tracerHome=/project/${relativeTracerHome} \
--env artifacts=/project/${relativeArtifacts} \
--env SIGNALFX_CLR_ENABLE_NGEN=${SIGNALFX_CLR_ENABLE_NGEN} \
dd-trace-dotnet/${{ matrix.base-image }}-tester \
dotnet /build/bin/Debug/_build.dll Clean BuildTracerHome BuildAndRunManagedUnitTests
/bin/sh -c 'git config --global --add safe.directory /project && ./tracer/build.sh Clean BuildTracerHome BuildAndRunManagedUnitTests'
- name: Publish managed tests results
uses: actions/upload-artifact@v3.1.2
with:
Expand Down Expand Up @@ -301,12 +301,12 @@ jobs:
run: |
docker run --rm \
--mount type=bind,source="${GITHUB_WORKSPACE}",target=/project \
--env NugetPackageDirectory=/project/$(relativeNugetPackageDirectory) \
--env NugetPackageDirectory=/project/${relativeNugetPackageDirectory} \
--env tracerHome=/project/${relativeTracerHome} \
--env artifacts=/project/${relativeArtifacts} \
--env SIGNALFX_CLR_ENABLE_NGEN=${SIGNALFX_CLR_ENABLE_NGEN} \
dd-trace-dotnet/${{ matrix.base-image }}-builder \
dotnet /build/bin/Debug/_build.dll Clean BuildTracerHome BuildAndRunNativeUnitTests
/bin/sh -c 'git config --global --add safe.directory /project && ./tracer/build.sh Clean BuildTracerHome BuildAndRunNativeUnitTests'
- name: Publish native tests results
uses: actions/upload-artifact@v3.1.2
with:
Expand Down Expand Up @@ -424,12 +424,12 @@ jobs:
run: |
docker run --rm \
--mount type=bind,source="${GITHUB_WORKSPACE}",target=/project \
--env NugetPackageDirectory=/project/$(relativeNugetPackageDirectory) \
--env NugetPackageDirectory=/project/${relativeNugetPackageDirectory} \
--env tracerHome=/project/${relativeTracerHome} \
--env artifacts=/project/${relativeArtifacts} \
--env SIGNALFX_CLR_ENABLE_NGEN=${SIGNALFX_CLR_ENABLE_NGEN} \
dd-trace-dotnet/${{ matrix.base-image }}-builder \
dotnet /build/bin/Debug/_build.dll Info Clean BuildTracerHome BuildLinuxIntegrationTests -Framework ${{ matrix.framework }}
/bin/sh -c 'git config --global --add safe.directory /project && ./tracer/build.sh Info Clean BuildTracerHome BuildLinuxIntegrationTests -Framework ${{ matrix.framework }}'
- name: Build dependencies
run: docker-compose build --build-arg SERVERLESS_ARTIFACTS_PATH=.${relativeTracerHome} StartDependencies
- name: Start dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
--env tracerHome=/shared/bin/monitoring-home/tracer \
--env artifacts=/project/tracer/src/bin/artifacts \
dd-trace-dotnet/${baseImage}-builder \
dotnet /build/bin/Debug/_build.dll Clean BuildTracerHome ZipMonitoringHome
/bin/sh -c 'git config --global --add safe.directory /project && ./tracer/build.sh Clean BuildTracerHome ZipMonitoringHome'
- name: Upload Linux x64 packages
uses: actions/upload-artifact@v3.1.2
with:
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ services:
args:
- DOTNETSDK_VERSION=${dotnetCoreSdkLatestVersion:-7.0.202}
image: dd-trace-dotnet/${baseImage:-centos7}-tester
command: dotnet /build/bin/Debug/_build.dll RunLinuxIntegrationTests --framework ${framework:-netcoreapp3.1} --code-coverage
command: /bin/sh -c './tracer/build.sh RunLinuxIntegrationTests --framework ${framework:-netcoreapp3.1} --code-coverage'
volumes:
- ./:/project
environment:
Expand Down
13 changes: 0 additions & 13 deletions tracer/build/_build/PrepareRelease/SetAllVersions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -310,19 +310,6 @@ public override void Run()
"src/Datadog.Trace/TracerConstants.cs",
FourPartVersionReplace);

// Four-part Sfx tag version update (Tests)
SynchronizeVersion(
"test/Datadog.Trace.ClrProfiler.IntegrationTests/CI/MsTestV2Tests.cs",
FourPartAssertVersionReplace);

SynchronizeVersion(
"test/Datadog.Trace.ClrProfiler.IntegrationTests/CI/NUnitTests.cs",
FourPartAssertVersionReplace);

SynchronizeVersion(
"test/Datadog.Trace.ClrProfiler.IntegrationTests/CI/XUnitTests.cs",
FourPartAssertVersionReplace);

// Native clr profiler updates
SynchronizeVersion(
"src/Datadog.Trace.ClrProfiler.Native/CMakeLists.txt",
Expand Down
42 changes: 39 additions & 3 deletions tracer/build/_build/UpdateVendors/VendoredDependency.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ static VendoredDependency()

Add(
libraryName: "MessagePack",
version: "1.9.3",
downloadUrl: "https://github.com/neuecc/MessagePack-CSharp/archive/v1.9.3.zip",
pathToSrc: new[] { "MessagePack-CSharp-1.9.3", "src", "MessagePack" },
version: "1.9.11",
downloadUrl: "https://github.com/neuecc/MessagePack-CSharp/archive/refs/tags/v1.9.11.zip",
pathToSrc: new[] { "MessagePack-CSharp-1.9.11", "src", "MessagePack" },
transform: filePath => RewriteCsFileWithStandardTransform(filePath, originalNamespace: "MessagePack"));

Add(
Expand Down Expand Up @@ -223,6 +223,42 @@ private bool TryGetValue(string key, [NotNullWhen(true)]out JsonProperty? item)
builder.Replace("\"ProtoBuf.ProtoIgnoreAttribute\"", "\"Datadog.Trace.Vendors.ProtoBuf.ProtoIgnoreAttribute\"");
builder.Replace("\"ProtoBuf.ProtoMemberAttribute\"", "\"Datadog.Trace.Vendors.ProtoBuf.ProtoMemberAttribute\"");
}
// Special MessagePack processing
if (originalNamespace.StartsWith("MessagePack"))
{
var fileName = Path.GetFileNameWithoutExtension(filePath);
if (fileName == "StandardClassLibraryFormatter")
{
builder.Replace(" public sealed class ValueTaskFormatter<T>", "#if NETCOREAPP\n public sealed class ValueTaskFormatter<T>");
builder.Replace(" }\n\n#endif\n}", " }\n#endif\n\n#endif\n}");
}
else if (fileName == "ValueTupleFormatter")
{
builder.Replace("#if NETSTANDARD || NETFRAMEWORK", "#if NETSTANDARD || NETCOREAPP");
}
else if (fileName == "DynamicAssembly")
{
builder.Replace("#if NETSTANDARD || NETFRAMEWORK", "#if NETSTANDARD || NETFRAMEWORK || NETCOREAPP");
}
else if (fileName == "LZ4Codec.Helper")
{
builder.Replace("#if NETSTANDARD || NETFRAMEWORK", "#if ENABLE_UNSAFE_MSGPACK");
}
else if (fileName == "StandardResolver")
{
builder.Replace("#if !(NETSTANDARD || NETFRAMEWORK)", "#if !(NETSTANDARD || NETFRAMEWORK || NETCOREAPP)");
}
else if (fileName == "DynamicGenericResolver")
{
builder.Replace(" // ValueTask", "#if NETCOREAPP\n // ValueTask");
builder.Replace(" // ValueTuple", "#if NETCOREAPP\n // ValueTuple");
builder.Replace(" // Tuple", "#endif\n // Tuple");
builder.Replace(" // ArraySegement", "#endif\n // ArraySegment");
builder.Replace("GetTypeInfo().IsConstructedGenericType()", "IsConstructedGenericType");
}

builder.Replace("#if NETSTANDARD || NETFRAMEWORK\n [System.Runtime.CompilerServices.MethodImpl", "#if NETSTANDARD || NETFRAMEWORK || NETCOREAPP\n [System.Runtime.CompilerServices.MethodImpl");
}

// Debugger.Break() is a dangerous method that may crash the process. We don't
// want to take any risk of calling it, ever, so replace it with a noop.
Expand Down
2 changes: 1 addition & 1 deletion tracer/build/_build/_build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<PackageReference Include="AWSSDK.SimpleSystemsManagement" Version="3.7.3.11" />
<PackageReference Include="Microsoft.Extensions.FileSystemGlobbing" Version="6.0.0" />
<PackageReference Include="Microsoft.TeamFoundationServer.Client" Version="16.170.0" />
<PackageReference Include="NuGet.CommandLine" Version="5.11.5">
<PackageReference Include="NuGet.CommandLine" Version="5.11.6">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
6 changes: 0 additions & 6 deletions tracer/build/_build/docker/alpine.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@ WORKDIR /project

FROM base as builder

# Copy the build project in and build it
WORKDIR /project
COPY . /build
RUN dotnet build /build

FROM base as tester

Expand All @@ -51,7 +48,4 @@ RUN curl -sSL https://dot.net/v1/dotnet-install.sh --output dotnet-install.sh \
&& ./dotnet-install.sh --runtime aspnetcore --version 6.0.11 --install-dir /usr/share/dotnet --no-path \
&& rm dotnet-install.sh

# Copy the build project in and build it
WORKDIR /project
COPY . /build
RUN dotnet build /build
7 changes: 0 additions & 7 deletions tracer/build/_build/docker/debian.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ WORKDIR /project

FROM base as builder

# Copy the build project in and build it
COPY . /build
RUN dotnet build /build
WORKDIR /project

FROM base as tester
Expand All @@ -86,10 +83,6 @@ RUN if [ "$(uname -m)" = "x86_64" ]; \
&& ./dotnet-install.sh --runtime aspnetcore --version 6.0.11 --install-dir /usr/share/dotnet --no-path \
&& rm dotnet-install.sh


# Copy the build project in and build it
COPY . /build
RUN dotnet build /build
WORKDIR /project

ENV IsDebian=true
4 changes: 2 additions & 2 deletions tracer/dependabot/Datadog.Dependabot.Vendors.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
<!-- https://www.nuget.org/packages/StatsdClient/6.0.0 -->
<PackageReference Include="StatsdClient" Version="6.0.0" />

<!-- https://www.nuget.org/packages/MessagePack/1.9.3 -->
<PackageReference Include="MessagePack" Version="1.9.3" />
<!-- https://www.nuget.org/packages/MessagePack/1.9.11 -->
<PackageReference Include="MessagePack" Version="1.9.11" />

<!-- https://www.nuget.org/packages/Newtonsoft.Json/13.0.1 -->
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
// <copyright file="MessagePackBinaryExtensions.cs" company="Datadog">
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2 License.
// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2017 Datadog, Inc.
// </copyright>

#if NETCOREAPP
using System;

namespace Datadog.Trace.Vendors.MessagePack
{
internal static partial class MessagePackBinary
{
public static int WriteRaw(ref byte[] bytes, int offset, ReadOnlySpan<byte> rawMessagePackBlock)
{
EnsureCapacity(ref bytes, offset, rawMessagePackBlock.Length);
rawMessagePackBlock.CopyTo(bytes.AsSpan(offset, rawMessagePackBlock.Length));
return rawMessagePackBlock.Length;
}

public static int WriteBytes(ref byte[] bytes, int offset, ReadOnlySpan<byte> rawMessagePackBlock)
{
var count = rawMessagePackBlock.Length;
if (count <= byte.MaxValue)
{
var size = count + 2;
EnsureCapacity(ref bytes, offset, size);

bytes[offset] = MessagePackCode.Bin8;
bytes[offset + 1] = (byte)count;

rawMessagePackBlock.CopyTo(bytes.AsSpan(offset + 2, count));
return size;
}
else if (count <= ushort.MaxValue)
{
var size = count + 3;
EnsureCapacity(ref bytes, offset, size);

unchecked
{
bytes[offset] = MessagePackCode.Bin16;
bytes[offset + 1] = (byte)(count >> 8);
bytes[offset + 2] = (byte)(count);
}

rawMessagePackBlock.CopyTo(bytes.AsSpan(offset + 3, count));
return size;
}
else
{
var size = count + 5;
EnsureCapacity(ref bytes, offset, size);

unchecked
{
bytes[offset] = MessagePackCode.Bin32;
bytes[offset + 1] = (byte)(count >> 24);
bytes[offset + 2] = (byte)(count >> 16);
bytes[offset + 3] = (byte)(count >> 8);
bytes[offset + 4] = (byte)(count);
}

rawMessagePackBlock.CopyTo(bytes.AsSpan(offset + 5, count));
return size;
}
}

public static int WriteStringBytes(ref byte[] bytes, int offset, ReadOnlySpan<byte> utf8stringBytes)
{
var byteCount = utf8stringBytes.Length;
if (byteCount <= MessagePackRange.MaxFixStringLength)
{
EnsureCapacity(ref bytes, offset, byteCount + 1);
bytes[offset] = (byte)(MessagePackCode.MinFixStr | byteCount);
utf8stringBytes.CopyTo(bytes.AsSpan(offset + 1, byteCount));
return byteCount + 1;
}
else if (byteCount <= byte.MaxValue)
{
EnsureCapacity(ref bytes, offset, byteCount + 2);
bytes[offset] = MessagePackCode.Str8;
bytes[offset + 1] = unchecked((byte)byteCount);
utf8stringBytes.CopyTo(bytes.AsSpan(offset + 2, byteCount));
return byteCount + 2;
}
else if (byteCount <= ushort.MaxValue)
{
EnsureCapacity(ref bytes, offset, byteCount + 3);
bytes[offset] = MessagePackCode.Str16;
bytes[offset + 1] = unchecked((byte)(byteCount >> 8));
bytes[offset + 2] = unchecked((byte)byteCount);
utf8stringBytes.CopyTo(bytes.AsSpan(offset + 3, byteCount));
return byteCount + 3;
}
else
{
EnsureCapacity(ref bytes, offset, byteCount + 5);
bytes[offset] = MessagePackCode.Str32;
bytes[offset + 1] = unchecked((byte)(byteCount >> 24));
bytes[offset + 2] = unchecked((byte)(byteCount >> 16));
bytes[offset + 3] = unchecked((byte)(byteCount >> 8));
bytes[offset + 4] = unchecked((byte)byteCount);
utf8stringBytes.CopyTo(bytes.AsSpan(offset + 5, byteCount));
return byteCount + 5;
}
}
}
}
#endif
1 change: 1 addition & 0 deletions tracer/src/Datadog.Trace/Vendors/MessagePack/Attributes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// <auto-generated />
// This file was automatically generated by the UpdateVendors tool.
//------------------------------------------------------------------------------
#pragma warning disable CS0618, CS0649, CS1574, CS1580, CS1581, CS1584, CS1591, CS1573, CS8018, SYSLIB0011, SYSLIB0032
using System;

namespace Datadog.Trace.Vendors.MessagePack
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// <auto-generated />
// This file was automatically generated by the UpdateVendors tool.
//------------------------------------------------------------------------------
#pragma warning disable CS0618, CS0649, CS1574, CS1580, CS1581, CS1584, CS1591, CS1573, CS8018, SYSLIB0011, SYSLIB0032
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
Expand Down
1 change: 1 addition & 0 deletions tracer/src/Datadog.Trace/Vendors/MessagePack/FloatBits.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// <auto-generated />
// This file was automatically generated by the UpdateVendors tool.
//------------------------------------------------------------------------------
#pragma warning disable CS0618, CS0649, CS1574, CS1580, CS1581, CS1584, CS1591, CS1573, CS8018, SYSLIB0011, SYSLIB0032
using System;
using System.Runtime.InteropServices;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
// <auto-generated />
// This file was automatically generated by the UpdateVendors tool.
//------------------------------------------------------------------------------
#pragma warning disable CS0618, CS0649, CS1574, CS1580, CS1581, CS1584, CS1591, CS1573, CS8018, SYSLIB0011, SYSLIB0032
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;

#if NETSTANDARD || NETFRAMEWORK || NETCOREAPP
#if NETSTANDARD || NETFRAMEWORK
using System.Collections.Concurrent;
#endif

Expand Down Expand Up @@ -247,7 +248,7 @@ public int Serialize(ref byte[] bytes, int offset, TCollection value, IFormatter
{
while (e.MoveNext())
{
#if NETSTANDARD || NETFRAMEWORK || NETCOREAPP
#if NETSTANDARD || NETFRAMEWORK
offset += formatter.Serialize(ref bytes, offset, e.Current, formatterResolver);
#else
offset += formatter.Serialize(ref bytes, (int)offset, (TElement)e.Current, (IFormatterResolver)formatterResolver);
Expand Down Expand Up @@ -278,7 +279,7 @@ public int Serialize(ref byte[] bytes, int offset, TCollection value, IFormatter
while (e.MoveNext())
{
count++;
#if NETSTANDARD || NETFRAMEWORK || NETCOREAPP
#if NETSTANDARD || NETFRAMEWORK
var writeSize = formatter.Serialize(ref bytes, offset, e.Current, formatterResolver);
#else
var writeSize = formatter.Serialize(ref bytes, (int)offset, (TElement)e.Current, (IFormatterResolver)formatterResolver);
Expand Down Expand Up @@ -348,7 +349,7 @@ public TCollection Deserialize(byte[] bytes, int offset, IFormatterResolver form
{
return collection.Count;
}
#if NETSTANDARD || NETFRAMEWORK || NETCOREAPP
#if NETSTANDARD || NETFRAMEWORK
else
{
var c2 = sequence as IReadOnlyCollection<TElement>;
Expand Down Expand Up @@ -952,7 +953,7 @@ public IDictionary Deserialize(byte[] bytes, int offset, IFormatterResolver form
}
}

#if NETSTANDARD || NETFRAMEWORK || NETCOREAPP
#if NETSTANDARD || NETFRAMEWORK

internal sealed class ObservableCollectionFormatter<T> : CollectionFormatterBase<T, ObservableCollection<T>>
{
Expand Down
Loading

0 comments on commit b64961c

Please sign in to comment.