PengZheng commented on code in PR #640:
URL: https://github.com/apache/celix/pull/640#discussion_r1320928356


##########
documents/building/README.md:
##########
@@ -40,16 +40,62 @@ git clone --single-branch --branch master 
https://github.com/apache/celix.git
 ```
 
 ## Building and installing
-Apache Celix uses [CMake](https://cmake.org) as build system. CMake can 
generate (among others) makefiles.
+Apache Celix can be build using [Conan](https://conan.io) as package 
manager/build system or by directly using
+[CMake](https://cmake.org).
 
-### Building and installing with preinstalled libraries
+### Building Apache Celix using Conan
 The following packages (libraries + headers) should be installed on your 
system:
 
 * Development Environment
     * build-essentials (gcc/g++ or clang/clang++) 
     * java or zip (for packaging bundles)
     * make (3.14 or higher)
     * git
+    * cmake (3.18 or higher)
+    * Conan (2 or higher)
+
+For Ubuntu 20.04, use the following commands:
+```bash
+sudo apt-get install -yq --no-install-recommends \
+    build-essential \
+    git \
+    default-jdk \
+    python3 \
+    python3-pip \
+    ninja-build
+        
+#The cmake version for Ubuntu 20 is older than 3.14,
+#use snap to install the latest cmake version
+snap install cmake
+
+#Install conan
+pip3 install -U conan   
+```
+
+Configure conan default profile using automatic detection of the system
+```bash
+conan profile detect
+```
+
+Create Apache Celix package - and build the dependencies - in the Conan cache:
+```bash
+cd <celix_source_dir>
+conan create . --build missing -o build_all=True   
+#Optionally build with CMake->Ninja, instead of CMake->Make. Note this 
includes building dependencies with Ninja. 
+conan create . --build missing -o build_all=True  -c 
tools.cmake.cmaketoolchain:generator=Ninja 
+```

Review Comment:
   One user requires a minimal build consists of `framework` and `utils`, see 
https://github.com/apache/celix/issues/635
   
   Conan allows users to specify only what they need, and guarantees to provide 
a minimal build satisfying the requirements. It will be beneficial to mention 
this. 



##########
documents/building/README.md:
##########
@@ -40,16 +40,62 @@ git clone --single-branch --branch master 
https://github.com/apache/celix.git
 ```
 
 ## Building and installing
-Apache Celix uses [CMake](https://cmake.org) as build system. CMake can 
generate (among others) makefiles.
+Apache Celix can be build using [Conan](https://conan.io) as package 
manager/build system or by directly using
+[CMake](https://cmake.org).
 
-### Building and installing with preinstalled libraries
+### Building Apache Celix using Conan
 The following packages (libraries + headers) should be installed on your 
system:
 
 * Development Environment
     * build-essentials (gcc/g++ or clang/clang++) 
     * java or zip (for packaging bundles)
     * make (3.14 or higher)
     * git
+    * cmake (3.18 or higher)
+    * Conan (2 or higher)
+
+For Ubuntu 20.04, use the following commands:
+```bash
+sudo apt-get install -yq --no-install-recommends \
+    build-essential \
+    git \
+    default-jdk \
+    python3 \
+    python3-pip \
+    ninja-build
+        
+#The cmake version for Ubuntu 20 is older than 3.14,
+#use snap to install the latest cmake version
+snap install cmake
+
+#Install conan
+pip3 install -U conan   
+```
+
+Configure conan default profile using automatic detection of the system
+```bash
+conan profile detect
+```
+
+Create Apache Celix package - and build the dependencies - in the Conan cache:
+```bash
+cd <celix_source_dir>
+conan create . --build missing -o build_all=True   

Review Comment:
   When trying this on a brand-new machine, I encountered the following error:
   
   ```
   -- Installing: 
/home/peng/.conan2/p/b/celixb9d5adbea8041/b/celix/gen/bundles/http_admin/content_install/libhttp_admin.so.0
   
   zip error: Nothing to do! (try: zip -rq 
/home/peng/.conan2/p/b/celixb9d5adbea8041/b/bundles/http_admin/http_admin/celix_http_admin.zip.install
 . -i *)
   CMake Error at bundles/http_admin/http_admin/cmake_install.cmake:111 (file):
     file INSTALL cannot find
     
"/home/peng/.conan2/p/b/celixb9d5adbea8041/b/bundles/http_admin/http_admin/celix_http_admin.zip.install":
   ```
   
   It turns out that bundle packaging using zip (instead of jar) does not work.
   We need to address this before 2.4.0 release.



##########
documents/subprojects.md:
##########
@@ -19,24 +19,39 @@ See the License for the specific language governing 
permissions and
 limitations under the License.
 -->
 
-# Apache Celix - Subprojects
+# Apache Celix - Libraries and Bundles
 
-Apache Celix is organized into several subprojects. The following subproject 
are available:
+The Apache Celix project is organized into several libraries, bundles, group 
of bundles and examples.
+
+## Core Libraries
+The core of Apache Celix is realized in the following libraries:
 
 * [Framework](../libs/framework) - The Apache Celix framework, an 
implementation of OSGi adapted to C and C++11.
-* [Utils](../libs/utils/README.md) - The Celix utils library, containing a 
wide range of utils functions (string, file, C hashmap, C arraylist, etc)
-* [Examples](../examples) - A Selection of examples showing how the framework 
can be used.
-* [Log Service](../bundles/logging/README.md) - A Log Service logging 
abstraction for Apache Celix.
-  * [Syslog Writer](../bundles/logging/log_writers/syslog_writer) - A syslog 
writer for use in combination with the Log Service.
-* [Shell](../bundles/shell/README.md) - A OSGi C and C++11 shell 
implementation.
-* [Pubsub](../bundles/pubsub/README.md) - An implementation for a 
publish-subscribe remote message communication system. 
-* [HTTP Admin](../bundles/http_admin/README.md) - An implementation for the 
OSGi HTTP whiteboard adapted to C and based on civetweb.
-* [Remote Services](../bundles/cxx_remote_services) - A C++17 adaption and 
implementation of the OSGi Remote Service Admin specification.
-* [Components Ready Check](../bundles/components_ready_check/README.md) - A 
bundle which checks if all components are ready.
+* [Utils](../libs/utils/README.md) - The Celix utils library, containing a 
wide range of general utils and 
+                                     OSGi supporting types (properties, 
version, filter, string utils, file utils, etc).
 
-Standalone libraries:
+## Standalone Libraries
+Apache Celix also provides several standalone libraries which can be used 
without the framework:
 
-* [Etcd library](../libs/etcdlib/README.md) - A C library that interfaces with 
ETCD.
+* [ETCD library](../libs/etcdlib/README.md) - A C library that interfaces with 
ETCD.
 * [Promises library](../libs/promises/README.md) - A C++17 header only 
adaption and implementation of the OSGi Promise specification.
-* [Push Streams Library](../libs/pushstreams/README.md) - A C++17 header 
adaption and only implementation of the OSGi Push Stream specification. 
+* [Push Streams Library](../libs/pushstreams/README.md) - A C++17 header 
adaption and only implementation of the OSGi Push Stream specification.
+* [Error Injector Library](../libs/error_injector/README.md) - A C library 
which can be used to inject errors in a running process, for testing purposes.

Review Comment:
   We have not made it installable yet.



##########
documents/subprojects.md:
##########
@@ -19,24 +19,39 @@ See the License for the specific language governing 
permissions and
 limitations under the License.
 -->
 
-# Apache Celix - Subprojects
+# Apache Celix - Libraries and Bundles
 
-Apache Celix is organized into several subprojects. The following subproject 
are available:
+The Apache Celix project is organized into several libraries, bundles, group 
of bundles and examples.
+
+## Core Libraries
+The core of Apache Celix is realized in the following libraries:
 
 * [Framework](../libs/framework) - The Apache Celix framework, an 
implementation of OSGi adapted to C and C++11.
-* [Utils](../libs/utils/README.md) - The Celix utils library, containing a 
wide range of utils functions (string, file, C hashmap, C arraylist, etc)
-* [Examples](../examples) - A Selection of examples showing how the framework 
can be used.
-* [Log Service](../bundles/logging/README.md) - A Log Service logging 
abstraction for Apache Celix.
-  * [Syslog Writer](../bundles/logging/log_writers/syslog_writer) - A syslog 
writer for use in combination with the Log Service.
-* [Shell](../bundles/shell/README.md) - A OSGi C and C++11 shell 
implementation.
-* [Pubsub](../bundles/pubsub/README.md) - An implementation for a 
publish-subscribe remote message communication system. 
-* [HTTP Admin](../bundles/http_admin/README.md) - An implementation for the 
OSGi HTTP whiteboard adapted to C and based on civetweb.
-* [Remote Services](../bundles/cxx_remote_services) - A C++17 adaption and 
implementation of the OSGi Remote Service Admin specification.
-* [Components Ready Check](../bundles/components_ready_check/README.md) - A 
bundle which checks if all components are ready.
+* [Utils](../libs/utils/README.md) - The Celix utils library, containing a 
wide range of general utils and 
+                                     OSGi supporting types (properties, 
version, filter, string utils, file utils, etc).
 
-Standalone libraries:
+## Standalone Libraries
+Apache Celix also provides several standalone libraries which can be used 
without the framework:

Review Comment:
   It will be helpful to mention that building them with Conan involves only 
turning on one option.



##########
documents/building/README.md:
##########
@@ -40,16 +40,62 @@ git clone --single-branch --branch master 
https://github.com/apache/celix.git
 ```
 
 ## Building and installing
-Apache Celix uses [CMake](https://cmake.org) as build system. CMake can 
generate (among others) makefiles.
+Apache Celix can be build using [Conan](https://conan.io) as package 
manager/build system or by directly using
+[CMake](https://cmake.org).
 
-### Building and installing with preinstalled libraries
+### Building Apache Celix using Conan
 The following packages (libraries + headers) should be installed on your 
system:
 
 * Development Environment
     * build-essentials (gcc/g++ or clang/clang++) 
     * java or zip (for packaging bundles)
     * make (3.14 or higher)
     * git
+    * cmake (3.18 or higher)

Review Comment:
   no less than 3.19 for Rust support ;p



##########
bundles/pubsub/pubsub_admin_tcp/src/pubsub_tcp_handler.c:
##########
@@ -1299,7 +1299,6 @@ int pubsub_tcpHandler_acceptHandler(pubsub_tcpHandler_t 
*handle, psa_tcp_connect
 #endif
         if (rc < 0) {
             pubsub_tcpHandler_freeEntry(entry);
-            free(entry);

Review Comment:
   Nice catch.



##########
documents/building/README.md:
##########
@@ -40,16 +40,62 @@ git clone --single-branch --branch master 
https://github.com/apache/celix.git
 ```
 
 ## Building and installing
-Apache Celix uses [CMake](https://cmake.org) as build system. CMake can 
generate (among others) makefiles.
+Apache Celix can be build using [Conan](https://conan.io) as package 
manager/build system or by directly using
+[CMake](https://cmake.org).
 
-### Building and installing with preinstalled libraries
+### Building Apache Celix using Conan
 The following packages (libraries + headers) should be installed on your 
system:
 
 * Development Environment
     * build-essentials (gcc/g++ or clang/clang++) 
     * java or zip (for packaging bundles)
     * make (3.14 or higher)
     * git
+    * cmake (3.18 or higher)
+    * Conan (2 or higher)
+
+For Ubuntu 20.04, use the following commands:

Review Comment:
   I just checked `linux-build-apt` CI build, which uses Ubuntu 22.04.



##########
documents/building/README.md:
##########
@@ -40,16 +40,62 @@ git clone --single-branch --branch master 
https://github.com/apache/celix.git
 ```
 
 ## Building and installing
-Apache Celix uses [CMake](https://cmake.org) as build system. CMake can 
generate (among others) makefiles.
+Apache Celix can be build using [Conan](https://conan.io) as package 
manager/build system or by directly using
+[CMake](https://cmake.org).
 
-### Building and installing with preinstalled libraries
+### Building Apache Celix using Conan
 The following packages (libraries + headers) should be installed on your 
system:
 
 * Development Environment
     * build-essentials (gcc/g++ or clang/clang++) 
     * java or zip (for packaging bundles)
     * make (3.14 or higher)
     * git
+    * cmake (3.18 or higher)
+    * Conan (2 or higher)

Review Comment:
   We still support Conan 1 in our CI. 
   Indeed Conan 2 should be recommended to our users for way better IDE 
integration.



-- 
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

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

Reply via email to