From d0c5093b32dcddd37e71f82a9c7c7572f37d7094 Mon Sep 17 00:00:00 2001 From: Ryan Burn Date: Fri, 1 Jun 2018 12:43:54 -0400 Subject: [PATCH 01/12] Update dynamic loading API. --- CMakeLists.txt | 2 +- include/opentracing/dynamic_load.h | 15 ++++++++++----- mocktracer/src/dynamic_load.cpp | 23 ++++++++++++++--------- src/dynamic_load_unix.cpp | 5 +++-- version.h.in | 1 + 5 files changed, 29 insertions(+), 17 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0cf3c88..874167d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,7 @@ project(opentracing-cpp) # ============================================================================== # Version information -set(OPENTRACING_ABI_VERSION "1") +set(OPENTRACING_ABI_VERSION "2") set(OPENTRACING_VERSION_MAJOR "1") set(OPENTRACING_VERSION_MINOR "4") set(OPENTRACING_VERSION_PATCH "2") diff --git a/include/opentracing/dynamic_load.h b/include/opentracing/dynamic_load.h index 1d265ef..fa4cb1f 100644 --- a/include/opentracing/dynamic_load.h +++ b/include/opentracing/dynamic_load.h @@ -12,9 +12,10 @@ // prefer to use the function DynamicallyLoadTracingLibrary over calling it // directly. // -// It takes the parameter `opentracing_version` representing the version of -// opentracing used by the caller. Upon success it returns the code `0` and -// sets `tracer_factory` to point to an instance of TracerFactory. +// It takes the parameter `opentracing_version` and `opentracing_abi_version` +// representing the version of opentracing used by the caller. Upon success it +// returns the code `0` and sets `tracer_factory` to point to an instance of +// TracerFactory. // // On failure, it returns a non-zero error code and sets `error_category` to // point to an std::error_category for the returned error code. @@ -22,10 +23,13 @@ // Example usage, // // const std::error_category* error_category = nullptr; +// std::string error_message; // opentracing::TracerFactory* tracer_factory = nullptr; -// int rcode = opentracing_make_factory( +// int rcode = OpenTracingMakeTracerFactory( // OPENTRACING_VERSION, +// OPENTRACING_ABI_VERSION, // &static_cast(error_category), +// static_cast(&error_message), // &static_cast(tracer_factory)); // if (rcode == 0) { // // success @@ -39,7 +43,8 @@ extern "C" { #ifdef OPENTRACING_BUILD_DYNAMIC_LOADING int __attribute((weak)) OpenTracingMakeTracerFactory(const char* opentracing_version, - const void** error_category, + const char* opentracing_abi_version, + const void** error_category, void* error_message, void** tracer_factory); #endif } // extern "C" diff --git a/mocktracer/src/dynamic_load.cpp b/mocktracer/src/dynamic_load.cpp index 3aad32a..a5d8639 100644 --- a/mocktracer/src/dynamic_load.cpp +++ b/mocktracer/src/dynamic_load.cpp @@ -4,27 +4,32 @@ #include #include -int OpenTracingMakeTracerFactory(const char* opentracing_version, +int OpenTracingMakeTracerFactory(const char* /*opentracing_version*/, + const char* opentracing_abi_version, const void** error_category, - void** tracer_factory) { + void* error_message, + void** tracer_factory) try { if (error_category == nullptr || tracer_factory == nullptr) { fprintf(stderr, "`error_category` and `tracer_factory` must be non-null.\n"); std::terminate(); } - if (std::strcmp(opentracing_version, OPENTRACING_VERSION) != 0) { + if (std::strcmp(opentracing_abi_version, OPENTRACING_ABI_VERSION) != 0) { *error_category = static_cast(&opentracing::dynamic_load_error_category()); + auto& message = *static_cast(error_message); + message = + "incompatible OpenTracing ABI versions; " + "expected " OPENTRACING_ABI_VERSION " but got "; + message.append(opentracing_abi_version); return opentracing::incompatible_library_versions_error.value(); } - *tracer_factory = - new (std::nothrow) opentracing::mocktracer::MockTracerFactory{}; - if (*tracer_factory == nullptr) { - *error_category = static_cast(&std::generic_category()); - return static_cast(std::errc::not_enough_memory); - } + *tracer_factory = new opentracing::mocktracer::MockTracerFactory{}; return 0; +} catch (const std::bad_alloc&) { + *error_category = static_cast(&std::generic_category()); + return static_cast(std::errc::not_enough_memory); } diff --git a/src/dynamic_load_unix.cpp b/src/dynamic_load_unix.cpp index f1a0676..cc06e4e 100644 --- a/src/dynamic_load_unix.cpp +++ b/src/dynamic_load_unix.cpp @@ -54,8 +54,9 @@ DynamicallyLoadTracingLibrary(const char* shared_library, const void* error_category = nullptr; void* tracer_factory = nullptr; - const auto rcode = make_tracer_factory(OPENTRACING_VERSION, &error_category, - &tracer_factory); + const auto rcode = make_tracer_factory( + OPENTRACING_VERSION, OPENTRACING_ABI_VERSION, &error_category, + static_cast(&error_message), &tracer_factory); if (rcode != 0) { if (error_category != nullptr) { return make_unexpected(std::error_code{ diff --git a/version.h.in b/version.h.in index 3a562bb..8143f5d 100644 --- a/version.h.in +++ b/version.h.in @@ -2,6 +2,7 @@ #define OPENTRACING_VERSION_H #define OPENTRACING_VERSION "${OPENTRACING_VERSION_STRING}" +#define OPENTRACING_ABI_VERSION "${OPENTRACING_ABI_VERSION}" // clang-format off #define BEGIN_OPENTRACING_ABI_NAMESPACE \ From 7a521f88bc29a4513f0c2f1e1a2764cac7e3dd54 Mon Sep 17 00:00:00 2001 From: Ryan Burn Date: Sun, 3 Jun 2018 19:48:42 -0400 Subject: [PATCH 02/12] Add comments for ABI versioning. --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 874167d..d4e2763 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,14 @@ project(opentracing-cpp) # ============================================================================== # Version information +# Increment ABI version for any ABI-breaking change. +# +# Also, whenever the ABI is between versions and in development +# suffix the ABI version number with "_unstable". set(OPENTRACING_ABI_VERSION "2") + +# Version number follows semver +# See https://semver.org/ set(OPENTRACING_VERSION_MAJOR "1") set(OPENTRACING_VERSION_MINOR "4") set(OPENTRACING_VERSION_PATCH "2") From 4d3bf1af528d3eec586384e3a8dcd39cf21a355a Mon Sep 17 00:00:00 2001 From: Ryan Burn Date: Tue, 19 Jun 2018 13:45:26 -0400 Subject: [PATCH 03/12] Make sure error_message is set when dynamic loading. --- src/dynamic_load_unix.cpp | 11 +++++++---- src/dynamic_load_windows.cpp | 11 +++++++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/dynamic_load_unix.cpp b/src/dynamic_load_unix.cpp index fc88b09..c60a089 100644 --- a/src/dynamic_load_unix.cpp +++ b/src/dynamic_load_unix.cpp @@ -65,13 +65,16 @@ DynamicallyLoadTracingLibrary(const char* shared_library, OPENTRACING_VERSION, OPENTRACING_ABI_VERSION, &error_category, static_cast(&error_message), &tracer_factory); if (rcode != 0) { - if (error_category != nullptr) { - return make_unexpected(std::error_code{ - rcode, *static_cast(error_category)}); - } else { + if (error_category == nullptr) { error_message = "failed to construct a TracerFactory: unknown error code"; return make_unexpected(dynamic_load_failure_error); } + const auto error_code = std::error_code{ + rcode, *static_cast(error_category)}; + if (error_message.empty()) { + error_message = error_code.message(); + } + return make_unexpected(error_code); } if (tracer_factory == nullptr) { diff --git a/src/dynamic_load_windows.cpp b/src/dynamic_load_windows.cpp index 20080cd..ba8cbcf 100644 --- a/src/dynamic_load_windows.cpp +++ b/src/dynamic_load_windows.cpp @@ -78,13 +78,16 @@ expected DynamicallyLoadTracingLibrary( OPENTRACING_VERSION, OPENTRACING_ABI_VERSION, &error_category, static_cast(&error_message), &tracer_factory); if (rcode != 0) { - if (error_category != nullptr) { - return make_unexpected(std::error_code{ - rcode, *static_cast(error_category)}); - } else { + if (error_category == nullptr) { error_message = "failed to construct a TracerFactory: unknown error code"; return make_unexpected(dynamic_load_failure_error); } + const auto error_code = std::error_code{ + rcode, *static_cast(error_category)}; + if (error_message.empty()) { + error_message = error_code.message(); + } + return make_unexpected(error_code); } if (tracer_factory == nullptr) { From 3a763aeafdccb5141cc3e4dcffa6c84a26695fab Mon Sep 17 00:00:00 2001 From: Ryan Burn Date: Tue, 19 Jun 2018 13:45:48 -0400 Subject: [PATCH 04/12] Run clang-format. --- include/opentracing/dynamic_load.h | 20 +++++++++---------- include/opentracing/ext/tags.h | 2 +- include/opentracing/propagation.h | 2 +- include/opentracing/symbols.h | 2 +- include/opentracing/tracer.h | 2 +- .../mocktracer/in_memory_recorder.h | 2 +- .../include/opentracing/mocktracer/json.h | 5 +++-- .../opentracing/mocktracer/json_recorder.h | 2 +- .../include/opentracing/mocktracer/tracer.h | 7 ++++--- 9 files changed, 22 insertions(+), 22 deletions(-) diff --git a/include/opentracing/dynamic_load.h b/include/opentracing/dynamic_load.h index 99a350b..f8f9837 100644 --- a/include/opentracing/dynamic_load.h +++ b/include/opentracing/dynamic_load.h @@ -1,8 +1,8 @@ #ifndef OPENTRACING_DYNAMIC_LOAD_H #define OPENTRACING_DYNAMIC_LOAD_H -#include #include +#include #include #include #include @@ -48,11 +48,11 @@ using OpenTracingMakeTracerFactoryType = int( #define OPENTRACING_DECLARE_IMPL_FACTORY(X) \ extern "C" { \ - \ -extern __declspec(dllexport) \ + \ + extern __declspec(dllexport) \ OpenTracingMakeTracerFactoryType* const OpenTracingMakeTracerFactory; \ - \ -__declspec(selectany) OpenTracingMakeTracerFactoryType* const \ + \ + __declspec(selectany) OpenTracingMakeTracerFactoryType* const \ OpenTracingMakeTracerFactory = X; \ } // extern "C" @@ -60,8 +60,8 @@ __declspec(selectany) OpenTracingMakeTracerFactoryType* const \ #define OPENTRACING_DECLARE_IMPL_FACTORY(X) \ extern "C" { \ - \ -__attribute((weak)) extern OpenTracingMakeTracerFactoryType* const \ + \ + __attribute((weak)) extern OpenTracingMakeTracerFactoryType* const \ OpenTracingMakeTracerFactory; \ \ OpenTracingMakeTracerFactoryType* const OpenTracingMakeTracerFactory = X; \ @@ -69,8 +69,6 @@ __attribute((weak)) extern OpenTracingMakeTracerFactoryType* const \ #endif - - namespace opentracing { BEGIN_OPENTRACING_ABI_NAMESPACE // Returns the std::error_category class used for opentracing dynamic loading @@ -145,8 +143,8 @@ class DynamicTracingLibraryHandle { // // See DynamicTracingLibraryHandle, TracerFactory OPENTRACING_API expected -DynamicallyLoadTracingLibrary( - const char* shared_library, std::string& error_message) noexcept; +DynamicallyLoadTracingLibrary(const char* shared_library, + std::string& error_message) noexcept; END_OPENTRACING_ABI_NAMESPACE } // namespace opentracing diff --git a/include/opentracing/ext/tags.h b/include/opentracing/ext/tags.h index cd4c140..da05a02 100644 --- a/include/opentracing/ext/tags.h +++ b/include/opentracing/ext/tags.h @@ -1,8 +1,8 @@ #ifndef OPENTRACING_EXT_TAGS_H #define OPENTRACING_EXT_TAGS_H -#include #include +#include #include namespace opentracing { diff --git a/include/opentracing/propagation.h b/include/opentracing/propagation.h index bb889c5..c4edc6a 100644 --- a/include/opentracing/propagation.h +++ b/include/opentracing/propagation.h @@ -1,8 +1,8 @@ #ifndef OPENTRACING_PROPAGATION_H #define OPENTRACING_PROPAGATION_H -#include #include +#include #include #include #include diff --git a/include/opentracing/symbols.h b/include/opentracing/symbols.h index d34f473..b359ced 100644 --- a/include/opentracing/symbols.h +++ b/include/opentracing/symbols.h @@ -18,7 +18,7 @@ #define OPENTRACING_API __declspec(dllexport) #else // OPENTRACING_STATIC #define OPENTRACING_API __declspec(dllimport) -#endif // OPENTRACING_EXPORTS +#endif // OPENTRACING_EXPORTS #endif // OPENTRACING_STATIC #endif // _MSC_VER diff --git a/include/opentracing/tracer.h b/include/opentracing/tracer.h index 2beadab..8eb9aba 100644 --- a/include/opentracing/tracer.h +++ b/include/opentracing/tracer.h @@ -1,10 +1,10 @@ #ifndef OPENTRACING_TRACER_H #define OPENTRACING_TRACER_H -#include #include #include #include +#include #include #include #include diff --git a/mocktracer/include/opentracing/mocktracer/in_memory_recorder.h b/mocktracer/include/opentracing/mocktracer/in_memory_recorder.h index 709816d..31ff4df 100644 --- a/mocktracer/include/opentracing/mocktracer/in_memory_recorder.h +++ b/mocktracer/include/opentracing/mocktracer/in_memory_recorder.h @@ -1,8 +1,8 @@ #ifndef OPENTRACING_MOCKTRACER_IN_MEMORY_RECORDER_H #define OPENTRACING_MOCKTRACER_IN_MEMORY_RECORDER_H -#include #include +#include #include #include diff --git a/mocktracer/include/opentracing/mocktracer/json.h b/mocktracer/include/opentracing/mocktracer/json.h index d80dde1..0d35e90 100644 --- a/mocktracer/include/opentracing/mocktracer/json.h +++ b/mocktracer/include/opentracing/mocktracer/json.h @@ -1,15 +1,16 @@ #ifndef OPENTRACING_MOCKTRACER_JSON_H #define OPENTRACING_MOCKTRACER_JSON_H -#include #include +#include #include namespace opentracing { BEGIN_OPENTRACING_ABI_NAMESPACE namespace mocktracer { // Serialize provided spans to JSON. -OPENTRACING_MOCK_TRACER_API void ToJson(std::ostream& writer, const std::vector& spans); +OPENTRACING_MOCK_TRACER_API void ToJson(std::ostream& writer, + const std::vector& spans); } // namespace mocktracer END_OPENTRACING_ABI_NAMESPACE } // namespace opentracing diff --git a/mocktracer/include/opentracing/mocktracer/json_recorder.h b/mocktracer/include/opentracing/mocktracer/json_recorder.h index cca55aa..fa5ef3c 100644 --- a/mocktracer/include/opentracing/mocktracer/json_recorder.h +++ b/mocktracer/include/opentracing/mocktracer/json_recorder.h @@ -1,8 +1,8 @@ #ifndef OPENTRACING_MOCKTRACER_JSON_RECORDER_H #define OPENTRACING_MOCKTRACER_JSON_RECORDER_H -#include #include +#include #include #include #include diff --git a/mocktracer/include/opentracing/mocktracer/tracer.h b/mocktracer/include/opentracing/mocktracer/tracer.h index 63af2cb..23a6254 100644 --- a/mocktracer/include/opentracing/mocktracer/tracer.h +++ b/mocktracer/include/opentracing/mocktracer/tracer.h @@ -1,8 +1,8 @@ #ifndef OPENTRACING_MOCKTRACER_TRACER_H #define OPENTRACING_MOCKTRACER_TRACER_H -#include #include +#include #include #include #include @@ -37,8 +37,9 @@ struct MockTracerOptions { // MockTracer provides implements the OpenTracing Tracer API. It provides // convenient access to finished spans in such a way as to support testing. -class OPENTRACING_MOCK_TRACER_API MockTracer : public Tracer, - public std::enable_shared_from_this { +class OPENTRACING_MOCK_TRACER_API MockTracer + : public Tracer, + public std::enable_shared_from_this { public: explicit MockTracer(MockTracerOptions&& options); From 56a1afd39c87d22a5134bb84c966e020d06806fc Mon Sep 17 00:00:00 2001 From: Ryan Burn Date: Tue, 19 Jun 2018 14:12:49 -0400 Subject: [PATCH 05/12] Add test for multiple definition error. --- test/BUILD | 12 ++++++++++++ test/CMakeLists.txt | 5 +++++ test/multiple_tracer_link_test.cpp | 3 +++ test/tracer_a.cpp | 10 ++++++++++ test/tracer_b.cpp | 10 ++++++++++ 5 files changed, 40 insertions(+) create mode 100644 test/multiple_tracer_link_test.cpp create mode 100644 test/tracer_a.cpp create mode 100644 test/tracer_b.cpp diff --git a/test/BUILD b/test/BUILD index c9a6a78..ce9077b 100644 --- a/test/BUILD +++ b/test/BUILD @@ -13,3 +13,15 @@ TEST_NAMES = [ "//3rd_party:catch2", ], ) for test_name in TEST_NAMES] + +cc_test( + name = "mutiple_tracer_link_test", + srcs = [ + "multiple_tracer_link_test.cpp", + "tracer_a.cpp", + "tracer_b.cpp", + ], + deps = [ + "//:opentracing", + ] +) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 1610662..fa2b0ca 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -24,4 +24,9 @@ if (BUILD_SHARED_LIBS AND BUILD_MOCKTRACER AND BUILD_DYNAMIC_LOADING) add_test(NAME dynamic_load_test COMMAND dynamic_load_test --mocktracer_library $) + + add_executable(multiple_tracer_link_test multiple_tracer_link_test.cpp + tracer_a.cpp tracer_b.cpp) + target_link_libraries(multiple_tracer_link_test ${OPENTRACING_LIBRARY}) + add_test(NAME multiple_tracer_link_test COMMAND multiple_tracer_link_test) endif() diff --git a/test/multiple_tracer_link_test.cpp b/test/multiple_tracer_link_test.cpp new file mode 100644 index 0000000..7be83d6 --- /dev/null +++ b/test/multiple_tracer_link_test.cpp @@ -0,0 +1,3 @@ +// Contains nothing, but links in tracer_a.o and tracer_b.o to verify that +// there's no multiple definition error from OpenTracingMakeTracerFactory. +int main() { return 0; } diff --git a/test/tracer_a.cpp b/test/tracer_a.cpp new file mode 100644 index 0000000..457b1dd --- /dev/null +++ b/test/tracer_a.cpp @@ -0,0 +1,10 @@ +#include + +static int OpenTracingMakeTracerFactoryFct( + const char* /*opentracing_version*/, + const char* /*opentracing_abi_version*/, const void** /*error_category*/, + void* /*error_message*/, void** /*tracer_factory*/) { + return -1; +} + +OPENTRACING_DECLARE_IMPL_FACTORY(OpenTracingMakeTracerFactoryFct); diff --git a/test/tracer_b.cpp b/test/tracer_b.cpp new file mode 100644 index 0000000..457b1dd --- /dev/null +++ b/test/tracer_b.cpp @@ -0,0 +1,10 @@ +#include + +static int OpenTracingMakeTracerFactoryFct( + const char* /*opentracing_version*/, + const char* /*opentracing_abi_version*/, const void** /*error_category*/, + void* /*error_message*/, void** /*tracer_factory*/) { + return -1; +} + +OPENTRACING_DECLARE_IMPL_FACTORY(OpenTracingMakeTracerFactoryFct); From ee8ba6a7a085a1864cab9d37d3fe433da8cbcc8c Mon Sep 17 00:00:00 2001 From: Ryan Burn Date: Tue, 19 Jun 2018 16:18:05 -0400 Subject: [PATCH 06/12] Add RELEASE.md. --- RELEASE.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 RELEASE.md diff --git a/RELEASE.md b/RELEASE.md new file mode 100644 index 0000000..fc5c293 --- /dev/null +++ b/RELEASE.md @@ -0,0 +1,9 @@ +# Release Process + +1. Update CMakeLists.txt + * Set OPENTRACING_VERSION_MAJOR, OPENTRACING_VERSION_MINOR, + and OPENTRACING_VERSION_PATCH to the correct numbers. + * Remove `_unstable` from OPENTRACING_ABI_VERSION if present. +1. Create a PR "Preparing for release X.Y.Z" against master branch +2. Create a release "Release X.Y.Z" on Github + * Create Tag `vX.Y.Z` From e1cc1b66c36a91b8f57212ce7889f644264c63db Mon Sep 17 00:00:00 2001 From: Ryan Burn Date: Tue, 19 Jun 2018 16:25:33 -0400 Subject: [PATCH 07/12] Make sure OpenTracingMakeTracerFactory isn't elided in tests. --- test/multiple_tracer_link_test.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/test/multiple_tracer_link_test.cpp b/test/multiple_tracer_link_test.cpp index 7be83d6..fd62eb5 100644 --- a/test/multiple_tracer_link_test.cpp +++ b/test/multiple_tracer_link_test.cpp @@ -1,3 +1,14 @@ -// Contains nothing, but links in tracer_a.o and tracer_b.o to verify that -// there's no multiple definition error from OpenTracingMakeTracerFactory. -int main() { return 0; } +// Links in tracer_a.o and tracer_b.o to verify that there's no multiple +// definition error from OpenTracingMakeTracerFactory. +#include + +extern OpenTracingMakeTracerFactoryType* const OpenTracingMakeTracerFactory; + +int main() { + // Call OpenTracingMakeTracerFactory to make sure it's not elided. + if ((*OpenTracingMakeTracerFactory)(nullptr, nullptr, nullptr, nullptr, + nullptr) != -1) { + return -1; + } + return 0; +} From 8caf2db4f4cc3a4eb9b4bbc9c7f2f81d09405195 Mon Sep 17 00:00:00 2001 From: Ryan Burn Date: Tue, 19 Jun 2018 16:32:27 -0400 Subject: [PATCH 08/12] Fix formatting. --- RELEASE.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index fc5c293..8111b8a 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,8 +1,7 @@ # Release Process 1. Update CMakeLists.txt - * Set OPENTRACING_VERSION_MAJOR, OPENTRACING_VERSION_MINOR, - and OPENTRACING_VERSION_PATCH to the correct numbers. + * Set OPENTRACING_VERSION_MAJOR, OPENTRACING_VERSION_MINOR, and OPENTRACING_VERSION_PATCH to the correct numbers. * Remove `_unstable` from OPENTRACING_ABI_VERSION if present. 1. Create a PR "Preparing for release X.Y.Z" against master branch 2. Create a release "Release X.Y.Z" on Github From f4137b4ce7187f3624140b7f176f484f6528822f Mon Sep 17 00:00:00 2001 From: Ryan Burn Date: Tue, 19 Jun 2018 16:33:20 -0400 Subject: [PATCH 09/12] Fix numbering. --- RELEASE.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index 8111b8a..1a6656e 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -3,6 +3,6 @@ 1. Update CMakeLists.txt * Set OPENTRACING_VERSION_MAJOR, OPENTRACING_VERSION_MINOR, and OPENTRACING_VERSION_PATCH to the correct numbers. * Remove `_unstable` from OPENTRACING_ABI_VERSION if present. -1. Create a PR "Preparing for release X.Y.Z" against master branch -2. Create a release "Release X.Y.Z" on Github +2. Create a PR "Preparing for release X.Y.Z" against master branch +3. Create a release "Release X.Y.Z" on Github * Create Tag `vX.Y.Z` From 75bcac6c2e7e70f93079fe8d86c82941b197d17a Mon Sep 17 00:00:00 2001 From: Ryan Burn Date: Tue, 19 Jun 2018 16:34:38 -0400 Subject: [PATCH 10/12] Fix formatting. --- RELEASE.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index 1a6656e..d3a98b7 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,8 +1,8 @@ # Release Process 1. Update CMakeLists.txt - * Set OPENTRACING_VERSION_MAJOR, OPENTRACING_VERSION_MINOR, and OPENTRACING_VERSION_PATCH to the correct numbers. - * Remove `_unstable` from OPENTRACING_ABI_VERSION if present. + * Set OPENTRACING_VERSION_MAJOR, OPENTRACING_VERSION_MINOR, and OPENTRACING_VERSION_PATCH to the correct numbers. + * Remove `_unstable` from OPENTRACING_ABI_VERSION if present. 2. Create a PR "Preparing for release X.Y.Z" against master branch 3. Create a release "Release X.Y.Z" on Github - * Create Tag `vX.Y.Z` + * Create Tag `vX.Y.Z`. From 3b706b92221a2e2ec39cf635628bb6a4e0b64719 Mon Sep 17 00:00:00 2001 From: Ryan Burn Date: Tue, 19 Jun 2018 16:40:14 -0400 Subject: [PATCH 11/12] Add missing extern "C" --- test/multiple_tracer_link_test.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/multiple_tracer_link_test.cpp b/test/multiple_tracer_link_test.cpp index fd62eb5..cc3867e 100644 --- a/test/multiple_tracer_link_test.cpp +++ b/test/multiple_tracer_link_test.cpp @@ -2,7 +2,9 @@ // definition error from OpenTracingMakeTracerFactory. #include +extern "C" { extern OpenTracingMakeTracerFactoryType* const OpenTracingMakeTracerFactory; +} // extern "C" int main() { // Call OpenTracingMakeTracerFactory to make sure it's not elided. From 74ade7eab51c64099d6820f0b157f41478a94b0c Mon Sep 17 00:00:00 2001 From: Ryan Burn Date: Tue, 19 Jun 2018 17:18:24 -0400 Subject: [PATCH 12/12] Add missing nullptr check. --- mocktracer/src/dynamic_load.cpp | 8 +++++--- test/multiple_tracer_link_test.cpp | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/mocktracer/src/dynamic_load.cpp b/mocktracer/src/dynamic_load.cpp index 2affbac..0fc7371 100644 --- a/mocktracer/src/dynamic_load.cpp +++ b/mocktracer/src/dynamic_load.cpp @@ -4,14 +4,16 @@ #include #include -static int OpenTracingMakeTracerFactoryFct(const char* /*opentracing_version*/, +static int OpenTracingMakeTracerFactoryFct(const char* opentracing_version, const char* opentracing_abi_version, const void** error_category, void* error_message, void** tracer_factory) try { - if (error_category == nullptr || tracer_factory == nullptr) { + if (opentracing_version == nullptr || opentracing_abi_version == nullptr || + error_category == nullptr || tracer_factory == nullptr) { fprintf(stderr, - "`error_category` and `tracer_factory` must be non-null.\n"); + "`opentracing_version`, `opentracing_abi_version`, " + "`error_category`, and `tracer_factory` must be non-null.\n"); std::terminate(); } diff --git a/test/multiple_tracer_link_test.cpp b/test/multiple_tracer_link_test.cpp index cc3867e..60a9425 100644 --- a/test/multiple_tracer_link_test.cpp +++ b/test/multiple_tracer_link_test.cpp @@ -4,7 +4,7 @@ extern "C" { extern OpenTracingMakeTracerFactoryType* const OpenTracingMakeTracerFactory; -} // extern "C" +} // extern "C" int main() { // Call OpenTracingMakeTracerFactory to make sure it's not elided.