Skip to content

Commit

Permalink
Merge branch 'main' into fix_maintainer_build
Browse files Browse the repository at this point in the history
  • Loading branch information
marcalff authored Jan 23, 2024
2 parents e564ef1 + a232328 commit c4e61be
Show file tree
Hide file tree
Showing 5 changed files with 200 additions and 5 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,59 @@ jobs:
CXX_STANDARD: '20'
run: ./ci/do_ci.sh cmake.c++20.stl.test

cmake_test_cxx23_gcc:
name: CMake C++23 test(GCC)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: setup
env:
CMAKE_VERSION: 3.20.6
run: |
sudo -E ./ci/setup_ci_environment.sh
sudo -E ./ci/setup_cmake.sh
- name: run tests
env:
CXX_STANDARD: '23'
run: ./ci/do_ci.sh cmake.c++23.test
- name: run tests (enable stl)
env:
CXX_STANDARD: '23'
run: ./ci/do_ci.sh cmake.c++23.stl.test

cmake_test_cxx23_clang:
name: CMake C++23 test(Clang with libc++)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: setup
env:
CC: /usr/bin/clang
CXX: /usr/bin/clang++
CXXFLAGS: "-stdlib=libc++"
CMAKE_VERSION: 3.20.6
run: |
sudo -E ./ci/setup_ci_environment.sh
sudo -E ./ci/setup_cmake.sh
- name: run tests
env:
CC: /usr/bin/clang
CXX: /usr/bin/clang++
CXXFLAGS: "-stdlib=libc++"
CXX_STANDARD: '23'
run: ./ci/do_ci.sh cmake.c++23.test
- name: run tests (enable stl)
env:
CC: /usr/bin/clang
CXX: /usr/bin/clang++
CXXFLAGS: "-stdlib=libc++"
CXX_STANDARD: '23'
run: ./ci/do_ci.sh cmake.c++23.stl.test

cmake_otprotocol_test:
name: CMake test (with otlp-exporter)
runs-on: ubuntu-20.04
Expand Down
28 changes: 27 additions & 1 deletion ci/do_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,19 @@ elif [[ "$1" == "cmake.c++20.test" ]]; then
cmake ${CMAKE_OPTIONS[@]} \
-DCMAKE_CXX_FLAGS="-Werror $CXXFLAGS" \
-DWITH_ASYNC_EXPORT_PREVIEW=ON \
-DWITH_STL=CXX20 \
${IWYU} \
"${SRC_DIR}"
eval "$MAKE_COMMAND"
make test
exit 0
elif [[ "$1" == "cmake.c++23.test" ]]; then
cd "${BUILD_DIR}"
rm -rf *
cmake ${CMAKE_OPTIONS[@]} \
-DCMAKE_CXX_FLAGS="-Werror $CXXFLAGS" \
-DWITH_ASYNC_EXPORT_PREVIEW=ON \
-DWITH_STL=CXX23 \
${IWYU} \
"${SRC_DIR}"
eval "$MAKE_COMMAND"
Expand Down Expand Up @@ -267,7 +280,20 @@ elif [[ "$1" == "cmake.c++20.stl.test" ]]; then
-DWITH_METRICS_EXEMPLAR_PREVIEW=ON \
-DCMAKE_CXX_FLAGS="-Werror $CXXFLAGS" \
-DWITH_ASYNC_EXPORT_PREVIEW=ON \
-DWITH_STL=ON \
-DWITH_STL=CXX20 \
${IWYU} \
"${SRC_DIR}"
eval "$MAKE_COMMAND"
make test
exit 0
elif [[ "$1" == "cmake.c++23.stl.test" ]]; then
cd "${BUILD_DIR}"
rm -rf *
cmake ${CMAKE_OPTIONS[@]} \
-DWITH_METRICS_EXEMPLAR_PREVIEW=ON \
-DCMAKE_CXX_FLAGS="-Werror $CXXFLAGS" \
-DWITH_ASYNC_EXPORT_PREVIEW=ON \
-DWITH_STL=CXX23 \
${IWYU} \
"${SRC_DIR}"
eval "$MAKE_COMMAND"
Expand Down
49 changes: 45 additions & 4 deletions ext/src/dll/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,55 @@ if(WITH_OTLP_HTTP)
PRIVATE opentelemetry_exporter_otlp_http_log)
endif()

find_program(
_vswhere_tool
NAMES vswhere
PATHS "$ENV{ProgramFiles\(x86\)}/Microsoft Visual Studio/Installer")
if(NOT ${vswhere})
message(
FATAL_ERROR "Could not locate vswhere.exe - unable to locate dumpbin.exe")
endif()

execute_process(
COMMAND "${_vswhere_tool}" -latest -find **/dumpbin.exe
OUTPUT_VARIABLE DUMPBIN_PATHS
RESULT_VARIABLE _vs_where_exitcode
OUTPUT_STRIP_TRAILING_WHITESPACE)

message(STATUS "DUMPBIN PATHS: ${DUMPBIN_PATHS} ${RESULT_VARIABLE}")

string(REPLACE "\n" ";" DUMPBIN_PATHS_LIST ${DUMPBIN_PATHS})

list(POP_FRONT DUMPBIN_PATHS_LIST DUMPBIN_PATH)

message(STATUS "DUMPBIN PATH: ${DUMPBIN_PATH}")

# find Powershell executable find_program(DUMPBIN_PATH NAMES dumpbin REQUIRED)

# find Powershell executable
find_program(POWERSHELL_PATH NAMES pwsh powershell REQUIRED)

set(OPENTELEMETRY_INPUT_DEF "${CMAKE_CURRENT_SOURCE_DIR}/input.txt")

add_custom_command(
OUTPUT ${OPENTELEMETRY_EXPORT_DEF}
OUTPUT ${OPENTELEMETRY_INPUT_DEF}
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/input.src"
COMMAND
${CMAKE_CXX_COMPILER}
"-D$<JOIN:$<TARGET_PROPERTY:opentelemetry_cpp,COMPILE_DEFINITIONS>,;-D>" /EP
${CMAKE_CURRENT_SOURCE_DIR}/opentelemetry_cpp.src >
${OPENTELEMETRY_EXPORT_DEF}
COMMAND_EXPAND_LISTS VERBATIM)
${CMAKE_CURRENT_SOURCE_DIR}/input.src > ${OPENTELEMETRY_INPUT_DEF}
VERBATIM COMMAND_EXPAND_LISTS)

add_custom_command(
OUTPUT ${OPENTELEMETRY_EXPORT_DEF}
DEPENDS "${OPENTELEMETRY_INPUT_DEF}"
"${CMAKE_CURRENT_SOURCE_DIR}/make_def.ps1"
COMMAND
${POWERSHELL_PATH} "-ExecutionPolicy" "Bypass" "-File"
"${CMAKE_CURRENT_SOURCE_DIR}/make_def.ps1" "-dumpbin" "${DUMPBIN_PATH}"
"-bindir" ${PROJECT_BINARY_DIR} "-inputfile" ${OPENTELEMETRY_INPUT_DEF}
"-targetfile" ${OPENTELEMETRY_EXPORT_DEF}
VERBATIM)

if(OPENTELEMETRY_INSTALL)
install(
Expand Down
67 changes: 67 additions & 0 deletions ext/src/dll/input.src
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

// clang-format off
Create@OStreamSpanExporterFactory@trace@exporter@v1@opentelemetry
Create@SimpleSpanProcessorFactory@trace@sdk@v1@opentelemetry
Create@TracerProviderFactory@trace@sdk@v1@opentelemetry
Create@LoggerProviderFactory@logs@sdk@v1@opentelemetry
Create@BatchLogRecordProcessorFactory@logs@sdk@v1@opentelemetry
Create@SimpleLogRecordProcessorFactory@logs@sdk@v1@opentelemetry
Create@MultiLogRecordProcessorFactory@logs@sdk@v1@opentelemetry
ForceFlush@TracerProvider@trace@sdk@v1@opentelemetry
ForceFlush@LoggerProvider@logs@sdk@v1@opentelemetry
OStreamLogRecordExporter@logs@exporter@v1@opentelemetry
Create@OStreamMetricExporterFactory@metrics@exporter@v1@opentelemetry
Create@PeriodicExportingMetricReaderFactory@metrics@sdk@v1@opentelemetry
Create@MeterProviderFactory@metrics@sdk@v1@opentelemetry
Create@MeterContextFactory@metrics@sdk@v1@opentelemetry
Create@ViewFactory@metrics@sdk@v1@opentelemetry
Create@MeterSelectorFactory@metrics@sdk@v1@opentelemetry
Create@InstrumentSelectorFactory@metrics@sdk@v1@opentelemetry
AddMetricReader@MeterContext@metrics@sdk@v1@opentelemetry
AddMetricReader@MeterProvider@metrics@sdk@v1@opentelemetry
AddView@MeterProvider@metrics@sdk@v1@opentelemetry

#if defined(WITH_OTLP_GRPC) || defined(WITH_OTLP_HTTP)
GetOtlpDefaultTracesTimeout@otlp@exporter@v1@opentelemetry
GetOtlpDefaultTracesHeaders@otlp@exporter@v1@opentelemetry
GetOtlpDefaultLogsTimeout@otlp@exporter@v1@opentelemetry
GetOtlpDefaultLogsHeaders@otlp@exporter@v1@opentelemetry
GetOtlpDefaultMetricsTimeout@otlp@exporter@v1@opentelemetry
GetOtlpDefaultMetricsHeaders@otlp@exporter@v1@opentelemetry
GetOtlpDefaultTracesSslCertificatePath@otlp@exporter@v1@opentelemetry
GetOtlpDefaultMetricsSslCertificatePath@otlp@exporter@v1@opentelemetry
GetOtlpDefaultLogsSslCertificatePath@otlp@exporter@v1@opentelemetry
GetOtlpDefaultTracesSslCertificateString@otlp@exporter@v1@opentelemetry
GetOtlpDefaultMetricsSslCertificateString@otlp@exporter@v1@opentelemetry
GetOtlpDefaultLogsSslCertificateString@otlp@exporter@v1@opentelemetry
#endif // defined(WITH_OTLP_GRPC) || defined(WITH_OTLP_HTTP)

#if defined(WITH_OTLP_GRPC)
Create@OtlpGrpcExporterFactory@otlp@exporter@v1@opentelemetry
Create@OtlpGrpcMetricExporterFactory@otlp@exporter@v1@opentelemetry
Create@OtlpGrpcLogRecordExporterFactory@otlp@exporter@v1@opentelemetry
OtlpGrpcExporterOptions@otlp@exporter@v1@opentelemetry
OtlpGrpcMetricExporterOptions@otlp@exporter@v1@opentelemetry
OtlpGrpcLogRecordExporterOptions@otlp@exporter@v1@opentelemetry
GetOtlpDefaultGrpcTracesEndpoint@otlp@exporter@v1@opentelemetry
GetOtlpDefaultGrpcMetricsEndpoint@otlp@exporter@v1@opentelemetry
GetOtlpDefaultGrpcLogsEndpoint@otlp@exporter@v1@opentelemetry
GetOtlpDefaultGrpcTracesIsInsecure@otlp@exporter@v1@opentelemetry
GetOtlpDefaultGrpcMetricsIsInsecure@otlp@exporter@v1@opentelemetry
GetOtlpDefaultGrpcLogsIsInsecure@otlp@exporter@v1@opentelemetry
#endif // defined(WITH_OTLP_GRPC)

#if defined(WITH_OTLP_HTTP)
Create@OtlpHttpExporterFactory@otlp@exporter@v1@opentelemetry
Create@OtlpHttpMetricExporterFactory@otlp@exporter@v1@opentelemetry
Create@OtlpHttpLogRecordExporterFactory@otlp@exporter@v1@opentelemetry
OtlpHttpExporterOptions@otlp@exporter@v1@opentelemetry
OtlpHttpMetricExporterOptions@otlp@exporter@v1@opentelemetry
OtlpHttpLogRecordExporterOptions@otlp@exporter@v1@opentelemetry
GetOtlpDefaultHttpTracesEndpoint@otlp@exporter@v1@opentelemetry
GetOtlpDefaultHttpMetricsEndpoint@otlp@exporter@v1@opentelemetry
GetOtlpDefaultHttpLogsEndpoint@otlp@exporter@v1@opentelemetry
#endif // defined(WITH_OTLP_HTTP)
// clang-format on
8 changes: 8 additions & 0 deletions ext/src/dll/make_def.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

param ($dumpbin, $bindir, $inputfile, $targetfile)

"LIBRARY opentelemetry_cpp`r`nEXPORTS`r`n" > $targetfile

Get-ChildItem -Verbose -Path $bindir/sdk/*,$bindir/exporters/* -Include *.lib -Recurse | % { & "$dumpbin" /SYMBOLS $_ | Select-String -Pattern @(Get-Content -Verbose -Path "$inputfile" | Where-Object { $_.Trim() -ne '' } | % { "External\s+\|\s+(\?+[0-9]?$_[^\s]*)\s+\((.*)\)$" }) | % { "; $($_.matches.groups[2])`r`n$($_.matches.groups[1])" } >> $targetfile }

0 comments on commit c4e61be

Please sign in to comment.