We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 49ca5fb commit fc0fa43Copy full SHA for fc0fa43
4 files changed
build/AssemblyRedirectionSourceGenerator.cs
@@ -50,10 +50,15 @@ private static string GenerateSourceContents(SortedDictionary<string, AssemblyNa
50
#include "cor_profiler.h"
51
52
#ifdef _WIN32
53
+ #define STR(Z1) #Z1
54
+ #define AUTO_MAJOR STR(OTEL_AUTO_VERSION_MAJOR)
55
+
56
namespace trace
57
{
58
void CorProfiler::InitNetFxAssemblyRedirectsMap()
59
60
+ const USHORT auto_major = atoi(AUTO_MAJOR);
61
62
assembly_version_redirect_map_.insert({
63
{{GenerateEntries(assemblies)}}
64
});
@@ -73,7 +78,14 @@ private static string GenerateEntries(SortedDictionary<string, AssemblyNameDefin
73
78
foreach (var kvp in assemblies)
74
79
75
80
var v = kvp.Value.Version!;
76
- sb.AppendLine($" {{ L\"{kvp.Key}\", {{{v.Major}, {v.Minor}, {v.Build}, {v.Revision}}} }},");
81
+ if(kvp.Key != "OpenTelemetry.AutoInstrumentation")
82
+ {
83
+ sb.AppendLine($" {{ L\"{kvp.Key}\", {{{v.Major}, {v.Minor}, {v.Build}, {v.Revision}}} }},");
84
+ }
85
+ else
86
87
+ sb.AppendLine($" {{ L\"{kvp.Key}\", {{auto_major, 0, 0, 0}} }},");
88
77
89
}
90
91
return sb.ToString()
src/OpenTelemetry.AutoInstrumentation.Native/OpenTelemetry.AutoInstrumentation.Native.vcxproj
@@ -94,7 +94,7 @@
94
<ConformanceMode>true</ConformanceMode>
95
<SDLCheck>true</SDLCheck>
96
<MultiProcessorCompilation>true</MultiProcessorCompilation>
97
- <PreprocessorDefinitions>SPDLOG_COMPILED_LIB;SPDLOG_FMT_EXTERNAL;BIT64;HOST_64BIT;AMD64;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>SPDLOG_COMPILED_LIB;SPDLOG_FMT_EXTERNAL;BIT64;HOST_64BIT;AMD64;_UNICODE;UNICODE;OTEL_AUTO_VERSION_MAJOR=$(OTEL_AUTO_VERSION_MAJOR);OTEL_AUTO_VERSION_MINOR=$(OTEL_AUTO_VERSION_MINOR);OTEL_AUTO_VERSION_PATCH=$(OTEL_AUTO_VERSION_PATCH);%(PreprocessorDefinitions)</PreprocessorDefinitions>
98
<AdditionalIncludeDirectories>$(LIB_INCLUDES);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
99
<TreatWarningAsError>true</TreatWarningAsError>
100
</ClCompile>
@@ -116,7 +116,7 @@
116
117
118
119
- <PreprocessorDefinitions>SPDLOG_COMPILED_LIB;SPDLOG_FMT_EXTERNAL;_UNICODE;UNICODE;X86;HOST_X86;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>SPDLOG_COMPILED_LIB;SPDLOG_FMT_EXTERNAL;_UNICODE;UNICODE;X86;HOST_X86;OTEL_AUTO_VERSION_MAJOR=$(OTEL_AUTO_VERSION_MAJOR);OTEL_AUTO_VERSION_MINOR=$(OTEL_AUTO_VERSION_MINOR);OTEL_AUTO_VERSION_PATCH=$(OTEL_AUTO_VERSION_PATCH);%(PreprocessorDefinitions)</PreprocessorDefinitions>
120
121
122
@@ -143,7 +143,7 @@
143
144
145
146
- <PreprocessorDefinitions>SPDLOG_COMPILED_LIB;SPDLOG_FMT_EXTERNAL;_TARGET_64BIT;BIT64;HOST_64BIT;AMD64;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>SPDLOG_COMPILED_LIB;SPDLOG_FMT_EXTERNAL;_TARGET_64BIT;BIT64;HOST_64BIT;AMD64;_UNICODE;UNICODE;OTEL_AUTO_VERSION_MAJOR=$(OTEL_AUTO_VERSION_MAJOR);OTEL_AUTO_VERSION_MINOR=$(OTEL_AUTO_VERSION_MINOR);OTEL_AUTO_VERSION_PATCH=$(OTEL_AUTO_VERSION_PATCH);%(PreprocessorDefinitions)</PreprocessorDefinitions>
147
148
149
@@ -169,7 +169,7 @@
169
170
171
172
173
174
175
src/OpenTelemetry.AutoInstrumentation.Native/netfx_assembly_redirection.h
@@ -8,10 +8,15 @@
8
9
10
11
+#define STR(Z1) #Z1
12
+#define AUTO_MAJOR STR(OTEL_AUTO_VERSION_MAJOR)
13
14
15
16
17
18
19
20
21
{ L"Google.Protobuf", {3, 23, 4, 0} },
22
{ L"Grpc.Core", {2, 0, 0, 0} },
@@ -33,7 +38,7 @@ void CorProfiler::InitNetFxAssemblyRedirectsMap()
33
38
{ L"OpenTelemetry", {1, 0, 0, 0} },
34
39
{ L"OpenTelemetry.Api", {1, 0, 0, 0} },
35
40
{ L"OpenTelemetry.Api.ProviderBuilderExtensions", {1, 0, 0, 0} },
36
- { L"OpenTelemetry.AutoInstrumentation", {1, 0, 0, 0} },
41
+ { L"OpenTelemetry.AutoInstrumentation", {auto_major, 0, 0, 0} },
37
42
{ L"OpenTelemetry.Exporter.Console", {1, 0, 0, 0} },
43
{ L"OpenTelemetry.Exporter.OpenTelemetryProtocol", {1, 0, 0, 0} },
44
{ L"OpenTelemetry.Exporter.Prometheus.HttpListener", {1, 0, 0, 0} },
src/OpenTelemetry.AutoInstrumentation.Native/version.h
@@ -10,7 +10,7 @@
#define STRTMP4(V1, V2, V3, V4) #V1 "." #V2 "." #V3 "." #V4
#define STR4(V1, V2, V3, V4) STRTMP4(V1, V2, V3, V4)
#define VERSION_3PARTS STR3(OTEL_AUTO_VERSION_MAJOR, OTEL_AUTO_VERSION_MINOR, OTEL_AUTO_VERSION_PATCH)
-#define VERSION_4PARTS STR4(OTEL_AUTO_VERSION_MAJOR, OTEL_AUTO_VERSION_MINOR, OTEL_AUTO_VERSION_PATCH, 0)
+#define VERSION_4PARTS STR4(OTEL_AUTO_VERSION_MAJOR, 0, 0, 0)
const auto PROFILER_VERSION = VERSION_3PARTS;
-const auto FILE_VERSION = VERSION_4PARTS;
+const auto FILE_VERSION = VERSION_4PARTS;
0 commit comments