From 3a9bcd7cfb0f4dce7381f84a4e81f500505bf109 Mon Sep 17 00:00:00 2001 From: David Robson Date: Mon, 14 Aug 2017 13:39:23 -0700 Subject: [PATCH 1/5] Update to C SDK release 2017-08-11. Update tests with new STRING_replace. Set "etw_log" to OFF. --- CMakeLists.txt | 5 +++++ bindings/java/tests/real_string.c | 2 ++ core/tests/dotnet_core_loader_ut/real_strings.h | 2 ++ core/tests/dotnet_loader_ut/real_strings.h | 2 ++ core/tests/dynamic_loader_ut/real_strings.h | 2 ++ core/tests/java_loader_ut/real_strings.h | 2 ++ core/tests/module_loader_ut/real_strings.c | 1 + core/tests/node_loader_ut/real_strings.h | 2 ++ core/tests/outprocess_loader_ut/real_strings.h | 2 ++ core/tests/outprocess_module_ut/real_strings.h | 2 ++ deps/c-utility | 2 +- deps/ctest | 2 +- deps/iot-sdk-c | 2 +- deps/testrunner | 2 +- deps/uamqp | 2 +- deps/umock-c | 2 +- deps/umqtt | 2 +- 17 files changed, 29 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4bf2c139..446acccd 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -84,6 +84,11 @@ option(use_http "set use_http to ON if http is to be used, set to OFF to not use option(use_mqtt "set use_mqtt to ON if mqtt is to be used, set to OFF to not use mqtt" ON) option(use_xplat_uuid "use the SDK's platform-independent UUID implementation (default is OFF)" OFF) +if(WIN32) + # C-SDK requires this to be set for some functions we use. + set(use_etw OFF) +endif() + option(enable_event_system "Build event system (default is ON)" ON) set_property(GLOBAL PROPERTY USE_FOLDERS ON) diff --git a/bindings/java/tests/real_string.c b/bindings/java/tests/real_string.c index dcefc2b0..3aff6659 100644 --- a/bindings/java/tests/real_string.c +++ b/bindings/java/tests/real_string.c @@ -19,6 +19,8 @@ #define STRING_empty real_STRING_empty #define STRING_length real_STRING_length #define STRING_compare real_STRING_compare +#define STRING_replace real_STRING_replace + #define GBALLOC_H diff --git a/core/tests/dotnet_core_loader_ut/real_strings.h b/core/tests/dotnet_core_loader_ut/real_strings.h index f92270a6..68c72f39 100644 --- a/core/tests/dotnet_core_loader_ut/real_strings.h +++ b/core/tests/dotnet_core_loader_ut/real_strings.h @@ -22,6 +22,7 @@ #define STRING_empty real_STRING_empty #define STRING_length real_STRING_length #define STRING_compare real_STRING_compare +#define STRING_replace real_STRING_replace #undef STRINGS_H @@ -47,6 +48,7 @@ #undef STRING_empty #undef STRING_length #undef STRING_compare +#undef STRING_replace #endif diff --git a/core/tests/dotnet_loader_ut/real_strings.h b/core/tests/dotnet_loader_ut/real_strings.h index f92270a6..68c72f39 100644 --- a/core/tests/dotnet_loader_ut/real_strings.h +++ b/core/tests/dotnet_loader_ut/real_strings.h @@ -22,6 +22,7 @@ #define STRING_empty real_STRING_empty #define STRING_length real_STRING_length #define STRING_compare real_STRING_compare +#define STRING_replace real_STRING_replace #undef STRINGS_H @@ -47,6 +48,7 @@ #undef STRING_empty #undef STRING_length #undef STRING_compare +#undef STRING_replace #endif diff --git a/core/tests/dynamic_loader_ut/real_strings.h b/core/tests/dynamic_loader_ut/real_strings.h index f92270a6..68c72f39 100644 --- a/core/tests/dynamic_loader_ut/real_strings.h +++ b/core/tests/dynamic_loader_ut/real_strings.h @@ -22,6 +22,7 @@ #define STRING_empty real_STRING_empty #define STRING_length real_STRING_length #define STRING_compare real_STRING_compare +#define STRING_replace real_STRING_replace #undef STRINGS_H @@ -47,6 +48,7 @@ #undef STRING_empty #undef STRING_length #undef STRING_compare +#undef STRING_replace #endif diff --git a/core/tests/java_loader_ut/real_strings.h b/core/tests/java_loader_ut/real_strings.h index f92270a6..68c72f39 100644 --- a/core/tests/java_loader_ut/real_strings.h +++ b/core/tests/java_loader_ut/real_strings.h @@ -22,6 +22,7 @@ #define STRING_empty real_STRING_empty #define STRING_length real_STRING_length #define STRING_compare real_STRING_compare +#define STRING_replace real_STRING_replace #undef STRINGS_H @@ -47,6 +48,7 @@ #undef STRING_empty #undef STRING_length #undef STRING_compare +#undef STRING_replace #endif diff --git a/core/tests/module_loader_ut/real_strings.c b/core/tests/module_loader_ut/real_strings.c index a3b0ed3b..118dc4a5 100644 --- a/core/tests/module_loader_ut/real_strings.c +++ b/core/tests/module_loader_ut/real_strings.c @@ -19,6 +19,7 @@ #define STRING_empty real_STRING_empty #define STRING_length real_STRING_length #define STRING_compare real_STRING_compare +#define STRING_replace real_STRING_replace #define GBALLOC_H diff --git a/core/tests/node_loader_ut/real_strings.h b/core/tests/node_loader_ut/real_strings.h index f92270a6..68c72f39 100644 --- a/core/tests/node_loader_ut/real_strings.h +++ b/core/tests/node_loader_ut/real_strings.h @@ -22,6 +22,7 @@ #define STRING_empty real_STRING_empty #define STRING_length real_STRING_length #define STRING_compare real_STRING_compare +#define STRING_replace real_STRING_replace #undef STRINGS_H @@ -47,6 +48,7 @@ #undef STRING_empty #undef STRING_length #undef STRING_compare +#undef STRING_replace #endif diff --git a/core/tests/outprocess_loader_ut/real_strings.h b/core/tests/outprocess_loader_ut/real_strings.h index f92270a6..68c72f39 100644 --- a/core/tests/outprocess_loader_ut/real_strings.h +++ b/core/tests/outprocess_loader_ut/real_strings.h @@ -22,6 +22,7 @@ #define STRING_empty real_STRING_empty #define STRING_length real_STRING_length #define STRING_compare real_STRING_compare +#define STRING_replace real_STRING_replace #undef STRINGS_H @@ -47,6 +48,7 @@ #undef STRING_empty #undef STRING_length #undef STRING_compare +#undef STRING_replace #endif diff --git a/core/tests/outprocess_module_ut/real_strings.h b/core/tests/outprocess_module_ut/real_strings.h index f92270a6..68c72f39 100644 --- a/core/tests/outprocess_module_ut/real_strings.h +++ b/core/tests/outprocess_module_ut/real_strings.h @@ -22,6 +22,7 @@ #define STRING_empty real_STRING_empty #define STRING_length real_STRING_length #define STRING_compare real_STRING_compare +#define STRING_replace real_STRING_replace #undef STRINGS_H @@ -47,6 +48,7 @@ #undef STRING_empty #undef STRING_length #undef STRING_compare +#undef STRING_replace #endif diff --git a/deps/c-utility b/deps/c-utility index a9b9adf4..883b6182 160000 --- a/deps/c-utility +++ b/deps/c-utility @@ -1 +1 @@ -Subproject commit a9b9adf488f012e1bd86ee746db00b91cb5a3c43 +Subproject commit 883b618258097a51bfd226386ca4f04751d11847 diff --git a/deps/ctest b/deps/ctest index a9ed5ae7..f75c4356 160000 --- a/deps/ctest +++ b/deps/ctest @@ -1 +1 @@ -Subproject commit a9ed5ae7d3a2c7d16c8712c0c1483d84f0c12289 +Subproject commit f75c43565720ccf0d44771ba58bb57e9e64ef38c diff --git a/deps/iot-sdk-c b/deps/iot-sdk-c index 7bda8ba6..35c2e35d 160000 --- a/deps/iot-sdk-c +++ b/deps/iot-sdk-c @@ -1 +1 @@ -Subproject commit 7bda8ba6bb6dacdf6510641bc0627dea84c41171 +Subproject commit 35c2e35d4df546b9b4c11991a4bb579dae146fc8 diff --git a/deps/testrunner b/deps/testrunner index f624bdbc..c654e728 160000 --- a/deps/testrunner +++ b/deps/testrunner @@ -1 +1 @@ -Subproject commit f624bdbc0758b9a4c0ad14ca5d0149dfe95186ae +Subproject commit c654e728a0abf00aa72bac8e1d4392246454e94f diff --git a/deps/uamqp b/deps/uamqp index f0d6df04..ce53717e 160000 --- a/deps/uamqp +++ b/deps/uamqp @@ -1 +1 @@ -Subproject commit f0d6df04ce246a6deea19bc5cbbac99686027245 +Subproject commit ce53717e3e5ecd2a7c673ed2d317fb4040a85e81 diff --git a/deps/umock-c b/deps/umock-c index c7641dd7..c563c7e6 160000 --- a/deps/umock-c +++ b/deps/umock-c @@ -1 +1 @@ -Subproject commit c7641dd7c52199e498cfb4a209bfcb49a1f79455 +Subproject commit c563c7e6606ebf2a89c1381b7b45fabe6898e100 diff --git a/deps/umqtt b/deps/umqtt index 22ff7b4a..8758a2dd 160000 --- a/deps/umqtt +++ b/deps/umqtt @@ -1 +1 @@ -Subproject commit 22ff7b4ad0552f3d2eea3143f37d90dabdd7146e +Subproject commit 8758a2ddd36dabd6bca206993a2150202a818bf1 From cb7561a2685bca451d413402843ee653415d85a3 Mon Sep 17 00:00:00 2001 From: Krishnakumar R <29471693+kkmsft@users.noreply.github.com> Date: Thu, 17 Aug 2017 19:19:43 +0000 Subject: [PATCH 2/5] Log info about the exiting out of process module. Fix for item 2 in #339 --- proxy/outprocess/src/module_loaders/outprocess_loader.c | 9 +++++++-- samples/proxy_sample/src/main.c | 9 ++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/proxy/outprocess/src/module_loaders/outprocess_loader.c b/proxy/outprocess/src/module_loaders/outprocess_loader.c index 5f689156..b7e6c69e 100644 --- a/proxy/outprocess/src/module_loaders/outprocess_loader.c +++ b/proxy/outprocess/src/module_loaders/outprocess_loader.c @@ -41,13 +41,18 @@ static VECTOR_HANDLE uv_processes = NULL; static THREAD_HANDLE uv_thread = NULL; static tickcounter_ms_t uv_process_grace_period_ms = 0; +void exit_cb(uv_process_t* p, int64_t exit_status, int term_signal) +{ + LogInfo("Out process: %d, exited with status: %" PRId64 ", signal: %d !!\n", p->pid, exit_status, term_signal); + uv_close((uv_handle_t *) p, NULL); +} + int launch_child_process_from_entrypoint (OUTPROCESS_LOADER_ENTRYPOINT * outprocess_entry) { int result; - uv_process_t * child = NULL; const uv_process_options_t options = { - .exit_cb = NULL, + .exit_cb = exit_cb, .file = outprocess_entry->process_argv[0], .args = outprocess_entry->process_argv, .flags = UV_PROCESS_WINDOWS_VERBATIM_ARGUMENTS diff --git a/samples/proxy_sample/src/main.c b/samples/proxy_sample/src/main.c index bea4e278..2c18313b 100644 --- a/samples/proxy_sample/src/main.c +++ b/samples/proxy_sample/src/main.c @@ -23,7 +23,14 @@ int main(int argc, char** argv) { printf("gateway successfully created from JSON\n"); printf("gateway shall run until ENTER is pressed\n"); - (void)getchar(); + // Since the std descriptors are shared between the out processes in launch case + // EOF is generated when the child process dies. Make sure the getchar + // can survive this. + int c; + while((c = getchar()) == EOF) + { + printf("\nGot %d from getchar. Continuing to wait for ENTER\n", c); + } Gateway_Destroy(gateway); } } From 3621b6c47eb3d3178070e3f0d4c7c188a995774b Mon Sep 17 00:00:00 2001 From: darobs Date: Mon, 21 Aug 2017 16:29:40 -0700 Subject: [PATCH 3/5] Bum versions for release --- CMakeLists.txt | 2 +- proxy/gateway/nodejs/package.json | 2 +- tools/docs/c/Doxyfile | 2 +- tools/release/bump_version/inputs.js | 10 ++++++++++ tools/release/bump_version/versions.json | 5 +++-- 5 files changed, 16 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 446acccd..54294881 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 2.8.12) project(azure_iot_gateway_sdk) -set(GATEWAY_VERSION 1.0.5 CACHE INTERNAL "") +set(GATEWAY_VERSION 1.0.6 CACHE INTERNAL "") set(COMPANY_NAME "Microsoft") SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) diff --git a/proxy/gateway/nodejs/package.json b/proxy/gateway/nodejs/package.json index 07bd433e..a044d3a4 100644 --- a/proxy/gateway/nodejs/package.json +++ b/proxy/gateway/nodejs/package.json @@ -24,4 +24,4 @@ }, "author": "Microsoft", "license": "MIT" -} +} \ No newline at end of file diff --git a/tools/docs/c/Doxyfile b/tools/docs/c/Doxyfile index 9b3dceb2..30276dfe 100644 --- a/tools/docs/c/Doxyfile +++ b/tools/docs/c/Doxyfile @@ -38,7 +38,7 @@ PROJECT_NAME = "Microsoft Azure IoT Gateway SDK" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.0.5 +PROJECT_NUMBER = 1.0.6 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/tools/release/bump_version/inputs.js b/tools/release/bump_version/inputs.js index 7e046459..78ee4ad5 100644 --- a/tools/release/bump_version/inputs.js +++ b/tools/release/bump_version/inputs.js @@ -189,4 +189,14 @@ module.exports = [ "nsmap": {"mavenns": "http://maven.apache.org/POM/4.0.0"}, "replaceString": "bindings.java", }, + + /////////////////////////////////////////////////// + // Node.js remote module + /////////////////////////////////////////////////// + { + "taskType": "jsonReplaceTask", + "filePath": "proxy/gateway/nodejs/package.json", + "search": "version", + "replaceString": "proxygateway.nodejs", + } ]; diff --git a/tools/release/bump_version/versions.json b/tools/release/bump_version/versions.json index aff25056..3ca86161 100644 --- a/tools/release/bump_version/versions.json +++ b/tools/release/bump_version/versions.json @@ -1,7 +1,7 @@ { "gateway": { - "core" : "1.0.5" + "core" : "1.0.6" }, "bindings" : { @@ -11,6 +11,7 @@ }, "proxygateway" : { - "java" : "1.0.1" + "java" : "1.0.1", + "nodejs" : "0.0.1" } } From fb1c5022ee8cdee65910dc45fd3ffcdf94d7bd8c Mon Sep 17 00:00:00 2001 From: David Robson Date: Wed, 23 Aug 2017 14:47:10 -0700 Subject: [PATCH 4/5] Unit test need a uv_close mock to compile. --- core/tests/outprocess_loader_ut/outprocess_loader_ut.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/tests/outprocess_loader_ut/outprocess_loader_ut.c b/core/tests/outprocess_loader_ut/outprocess_loader_ut.c index fcc6cb6d..b8e846e9 100644 --- a/core/tests/outprocess_loader_ut/outprocess_loader_ut.c +++ b/core/tests/outprocess_loader_ut/outprocess_loader_ut.c @@ -135,6 +135,8 @@ MOCK_FUNCTION_WITH_CODE(, int, uv_process_kill, uv_process_t *, handle, int, sig MOCK_FUNCTION_END(0); MOCK_FUNCTION_WITH_CODE(, int, uv_spawn, uv_loop_t *, loop, uv_process_t *, handle, const uv_process_options_t *, options) MOCK_FUNCTION_END(0); +MOCK_FUNCTION_WITH_CODE(, void, uv_close, uv_handle_t *, handle, uv_close_cb, close_cb); +MOCK_FUNCTION_END(); // ** Mocking uv.h (Event loop) MOCK_FUNCTION_WITH_CODE(, uv_loop_t *, uv_default_loop); From c797dc7537ed329b4c0ca6b8fed9ebdb06e655c7 Mon Sep 17 00:00:00 2001 From: Krishnakumar R <29471693+kkmsft@users.noreply.github.com> Date: Thu, 24 Aug 2017 02:43:47 +0000 Subject: [PATCH 5/5] Fix the %PRId64 win32 compile issue by using INT64_PRINTF --- proxy/outprocess/src/module_loaders/outprocess_loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy/outprocess/src/module_loaders/outprocess_loader.c b/proxy/outprocess/src/module_loaders/outprocess_loader.c index b7e6c69e..caa57e85 100644 --- a/proxy/outprocess/src/module_loaders/outprocess_loader.c +++ b/proxy/outprocess/src/module_loaders/outprocess_loader.c @@ -43,7 +43,7 @@ static tickcounter_ms_t uv_process_grace_period_ms = 0; void exit_cb(uv_process_t* p, int64_t exit_status, int term_signal) { - LogInfo("Out process: %d, exited with status: %" PRId64 ", signal: %d !!\n", p->pid, exit_status, term_signal); + LogInfo("Out process: %d, exited with status: "INT64_PRINTF", signal: %d !!\n", p->pid, exit_status, term_signal); uv_close((uv_handle_t *) p, NULL); }