PengZheng opened a new issue, #482:
URL: https://github.com/apache/celix/issues/482

   `conan create` hangs when running use_framework. The program is fairly 
simple:
   
   ```C
   //examples/conan_test_package/test_framework.c
   #include <celix_api.h>
   #include <assert.h>
   #include <stddef.h>
   
   int main() {
       celix_framework_t* fw = NULL;
       celix_bundle_context_t *ctx = NULL;
       celix_properties_t *properties = NULL;
   
       properties = properties_create();
       properties_set(properties, "LOGHELPER_ENABLE_STDOUT_FALLBACK", "true");
       properties_set(properties, "org.osgi.framework.storage.clean", 
"onFirstInit");
       properties_set(properties, "org.osgi.framework.storage", 
".cacheBundleContextTestFramework");
   
       fw = celix_frameworkFactory_createFramework(properties);
       ctx = framework_getContext(fw);
       long bndId = celix_bundleContext_installBundle(ctx, 
HELLO_TEST_BUNDLE_LOCATION, true);
       assert(bndId >= 0);
       celix_frameworkFactory_destroyFramework(fw);
       return 0;
   }
   ```
   
   ```C
   //examples/conan_test_package/hello_bundle.c
   #include <celix_api.h>
   #include <celix_log_helper.h>
   #include <stdio.h>
   
   typedef struct activator_data {
       celix_log_helper_t *logger;
   } activator_data_t;
   
   
   static celix_status_t activator_start(activator_data_t *data, 
celix_bundle_context_t *ctx) {
       const char *key = NULL;
       data->logger = celix_logHelper_create(ctx, "test");
       printf("\nHello world from C bundle with id %li\n", 
celix_bundle_getId(celix_bundleContext_getBundle(ctx)));
       celix_array_list_t *bundles = 
celix_bundleContext_listInstalledBundles(ctx);
       for (int i = 0; i < celix_arrayList_size(bundles); i++) {
           long bndId = celix_arrayList_getLong(bundles, i);
           printf("Bundle %ld: %s\n", bndId, 
celix_bundleContext_getBundleSymbolicName(ctx, bndId));
       }
       celix_arrayList_destroy(bundles);
       celix_framework_stopBundleAsync(celix_bundleContext_getFramework(ctx), 
CELIX_FRAMEWORK_BUNDLE_ID); // to make container quit immediately
       return CELIX_SUCCESS;
   }
   
   static celix_status_t activator_stop(activator_data_t *data, 
celix_bundle_context_t *ctx) {
       celix_logHelper_info(data->logger, "Goodbye world from C bundle with id 
%li\n", celix_bundle_getId(celix_bundleContext_getBundle(ctx)));
       celix_logHelper_destroy(data->logger);
       return CELIX_SUCCESS;
   }
   
   CELIX_GEN_BUNDLE_ACTIVATOR(activator_data_t, activator_start, activator_stop)
   
   ```
   
   It may relate to shell test timeout.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@celix.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to