Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devcontainer/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# specific language governing permissions and limitations
# under the License.

FROM docker.io/library/ubuntu:24.04@sha256:2e863c44b718727c860746568e1d54afd13b2fa71b160f5cd9058fc436217b30 as base
FROM docker.io/library/ubuntu:26.04@sha256:513c074113a871b51a8d16ab445c88779d6452d937a164fb5cc479f32668a41d as base

# Install dependencies
RUN DEBIAN_FRONTEND="noninteractive" apt-get update && \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/celix_etcdlib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
build:
runs-on: ubuntu-22.04
runs-on: ubuntu-26.04
timeout-minutes: 15
steps:
- name: Checkout source code
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/celix_promise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
build:
runs-on: ubuntu-22.04
runs-on: ubuntu-26.04
timeout-minutes: 15
steps:
- name: Checkout source code
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/conan_create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ env:
jobs:

ubuntu-build:
runs-on: ubuntu-22.04
runs-on: ubuntu-26.04
strategy:
fail-fast: false
matrix:
Expand All @@ -40,7 +40,7 @@ jobs:
conan profile detect -f
sed -i 's/compiler.cppstd=gnu14/compiler.cppstd=gnu17/g' `conan profile path default`
echo "[tool_requires]" >> `conan profile path default`
echo "cmake/3.26.4" >> `conan profile path default`
echo "cmake/4.4.3" >> `conan profile path default`
- name: Conan Cache
id: cache-conan
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf #v4.2.2
Expand Down Expand Up @@ -93,7 +93,7 @@ jobs:
run: |
conan profile detect -f
echo "[tool_requires]" >> `conan profile path default`
echo "cmake/3.26.4" >> `conan profile path default`
echo "cmake/4.4.3" >> `conan profile path default`
- name: Conan Cache
id: cache-conan
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf #v4.2.2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
container-conan-build-ubuntu:
runs-on: ubuntu-22.04
runs-on: ubuntu-26.04
timeout-minutes: 120
steps:
- name: Checkout source code
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:
"cd /home/celixdev/workspace && \
ctest --preset conan-debug --output-on-failure -j1"
build-dev-container-images:
runs-on: ubuntu-22.04
runs-on: ubuntu-26.04
timeout-minutes: 120
steps:
- name: Checkout source code
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ env:

jobs:
coverage:
runs-on: ubuntu-22.04
runs-on: ubuntu-26.04
timeout-minutes: 120
steps:
- name: Checkout source code
Expand All @@ -26,14 +26,14 @@ jobs:
conan profile detect -f --name release
sed -i 's/compiler.cppstd=gnu14/compiler.cppstd=gnu17/g' `conan profile path release`
echo "[tool_requires]" >> `conan profile path release`
echo "cmake/3.26.4" >> `conan profile path release`
echo "cmake/4.4.3" >> `conan profile path release`

# host profile
conan profile detect -f
sed -i 's/build_type=Release/build_type=Debug/g' `conan profile path default`
sed -i 's/compiler.cppstd=gnu14/compiler.cppstd=gnu17/g' `conan profile path default`
echo "[tool_requires]" >> `conan profile path default`
echo "cmake/3.26.4" >> `conan profile path default`
echo "cmake/4.4.3" >> `conan profile path default`
- name: Conan Cache
id: cache-conan
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf #v4.2.2
Expand Down Expand Up @@ -72,7 +72,7 @@ jobs:
source generators/conanrun.sh
make coverage
source generators/deactivate_conanrun.sh
lcx="lcov --output-file=coverage.info " && for i in `find . -name "*.info.cleaned"`; do lcx+=" --add-tracefile=$i"; done && $lcx
lcx="lcov --output-file=coverage.info --ignore-errors inconsistent,mismatch" && for i in `find . -name "*.info.cleaned"`; do lcx+=" --add-tracefile=$i"; done && $lcx

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'd better fix it in cmake/celix_project/CodeCoverage.cmake as in #842

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI tolds me that

    # lcov 2.x errors on gcov end-line inconsistencies for functions sharing a
    # start line (e.g. gtest TEST_F bodies and their synthesized ctor/dtors) and
    # on unused exclude patterns; 1.x neither has these checks nor accepts the
    # corresponding --ignore-errors categories (unknown categories are fatal in
    # all versions), so the flags are version-gated.

I have not verified the 1.x behavior, which needed to be done to decide how to fix it.

- name: Codecov
uses: codecov/codecov-action@125fc84a9a348dbcf27191600683ec096ec9021c #v4.4.1
if: github.repository_owner == 'apache'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/coverity-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
latest:
runs-on: ubuntu-22.04
runs-on: ubuntu-26.04
steps:
- name: Checkout source code
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c #v3.3.0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/fuzzing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
fuzz-utils:
runs-on: ubuntu-22.04
runs-on: ubuntu-26.04
timeout-minutes: 30
steps:
- name: Checkout source code
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
run: |
conan profile detect -f
echo "[tool_requires]" >> `conan profile path default`
echo "cmake/3.26.4" >> `conan profile path default`
echo "cmake/4.4.3" >> `conan profile path default`
- name: Conan Cache
id: cache-conan
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf #v4.2.2
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ env:
jobs:

linux-build-conan:
runs-on: ubuntu-22.04
runs-on: ubuntu-26.04
strategy:
fail-fast: false
matrix:
Expand All @@ -39,14 +39,14 @@ jobs:
conan profile detect -f --name release
sed -i 's/compiler.cppstd=gnu14/compiler.cppstd=gnu17/g' `conan profile path release`
echo "[tool_requires]" >> `conan profile path release`
echo "cmake/3.26.4" >> `conan profile path release`
echo "cmake/4.4.3" >> `conan profile path release`

# host profile
conan profile detect -f
sed -i 's/build_type=Release/build_type=${{ matrix.type }}/g' `conan profile path default`
sed -i 's/compiler.cppstd=gnu14/compiler.cppstd=gnu17/g' `conan profile path default`
echo "[tool_requires]" >> `conan profile path default`
echo "cmake/3.26.4" >> `conan profile path default`
echo "cmake/4.4.3" >> `conan profile path default`
- name: Conan Cache
id: cache-conan
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf #v4.2.2
Expand Down Expand Up @@ -92,7 +92,7 @@ jobs:


linux-build-apt:
runs-on: ubuntu-22.04
runs-on: ubuntu-26.04
strategy:
fail-fast: false
matrix:
Expand Down
7 changes: 4 additions & 3 deletions bundles/logging/log_admin/gtest/src/LogAdminTestSuite.cc
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,10 @@ static void logSinkFunction(void *handle, celix_log_level_e level, long logServi
EXPECT_STREQ("test::Log1", logServiceName);
}

vfprintf(stdout, format, formatArgs);

fprintf(stdout, "\n");
if (format) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about using attribute((nonnull)), which is supported by both gcc and clang, to give the compiler a clue of the nullability of the parameters? In theory, it should eliminate the if(format) check. Moreover, it also enable clang static analyzer(CSA)'s nullability checker to work. I happened to work on CSA recently.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also reminds me that we should annotate logSink.sinkLog with __attribute__((format)).

vfprintf(stdout, format, formatArgs);
fprintf(stdout, "\n");
}
}

TEST_F(LogBundleTestSuite, LogServiceAndSink) {
Expand Down
6 changes: 4 additions & 2 deletions bundles/logging/log_helper/gtest/src/LogHelperTestSuite.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,10 @@ TEST_F(LogHelperTestSuite, LogToLogSvc) {
logSvc.vlogDetails= [](void *handle, celix_log_level_e, const char*, const char*, int, const char *format, va_list formatArgs) {
auto* c = static_cast<std::atomic<size_t>*>(handle);
c->fetch_add(1);
vfprintf(stderr, format, formatArgs);
fprintf(stderr, "\n");
if (format) {
vfprintf(stderr, format, formatArgs);
fprintf(stderr, "\n");
}
};

auto* props = celix_properties_create();
Expand Down
1 change: 1 addition & 0 deletions bundles/remote_services/discovery_common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ if (RSA_DISCOVERY_COMMON)
src/endpoint_discovery_poller.c
src/endpoint_discovery_server.c
)
set_target_properties(rsa_discovery_common PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_include_directories(rsa_discovery_common PUBLIC include
PRIVATE src ${LIBXML2_INCLUDE_DIR})
celix_target_hide_symbols(rsa_discovery_common)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ static void discoveryZeroconfWatcher_refreshWatchedServices(discovery_zeroconf_w
celix_steal_ptr(svcEntry);
continue;
}
char *instanceNameEnd = strrchr(key, '/');
const char *instanceNameEnd = strrchr(key, '/');
if (instanceNameEnd == NULL || instanceNameEnd-key >= DZC_MAX_SERVICE_INSTANCE_NAME_LEN) {
celix_logHelper_error(watcher->logHelper, "Watcher: Invalid service instance key, %s.", key);
continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ static int remoteServiceAdmin_callback(struct mg_connection *conn) {
// rest = myservice/call

const char *rest = uri+9;
char *interfaceStart = strchr(rest, '/');
const char *interfaceStart = strchr(rest, '/');
int pos = interfaceStart - rest;
char service[pos+1];
strncpy(service, rest, pos);
Expand Down
17 changes: 16 additions & 1 deletion cmake/Findcivetweb.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,26 @@ if (NOT civetweb_FOUND)

set(CIVETWEB_ENABLE_WEBSOCKETS TRUE CACHE BOOL "" FORCE)
set(CIVETWEB_BUILD_TESTING FALSE CACHE BOOL "" FORCE)
set(CIVETWEB_ENABLE_ASAN FALSE CACHE BOOL "" FORCE)
set(BUILD_SHARED_LIBS TRUE CACHE BOOL "" FORCE)
set(CMAKE_C_FLAGS "-Wno-error")

FetchContent_MakeAvailable(civetweb)
if (NOT TARGET civetweb::civetweb)
add_library(civetweb::civetweb ALIAS civetweb-c-library)
endif ()
#CivetWeb inherits the top-level -Werror/-Wall flags via CMAKE_C_FLAGS,
#which newer compilers (GCC 15+/Clang 20+) turn into hard errors.
#CivetWeb is a third-party dependency: build it without -Werror.
foreach(_civetweb_tgt civetweb-c-library civetweb-c-executable civetweb-cpp-library)
if (TARGET ${_civetweb_tgt})
get_target_property(_civetweb_cflags ${_civetweb_tgt} COMPILE_OPTIONS)
if (_civetweb_cflags)
list(REMOVE_ITEM _civetweb_cflags "-Werror" "-Wfatal-errors")
set_target_properties(${_civetweb_tgt} PROPERTIES COMPILE_OPTIONS "${_civetweb_cflags}")
endif ()
target_compile_options(${_civetweb_tgt} PRIVATE -Wno-error)
endif ()
endforeach()
unset(_civetweb_tgt)
unset(_civetweb_cflags)
endif()
4 changes: 2 additions & 2 deletions cmake/celix_project/CodeCoverage.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ function (setup_target_for_coverage)

# Capturing lcov counters and generating report
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/coverage
COMMAND ${LCOV_PATH} --directory ${COVERAGE_SCAN_DIR} --capture --output-file ${OUTPUT_FILE}
COMMAND ${LCOV_PATH} --remove ${OUTPUT_FILE} '**/error_injector/*' '**/mock/*' '**/.conan/*' '**/test/*' '**/gtest/*' '**/tst/*' '**/celix/gen/*' '**/googletest_project/*' '**/glog/*' '/usr/*' --output-file ${OUTPUT_FILE}.cleaned
COMMAND ${LCOV_PATH} --directory ${COVERAGE_SCAN_DIR} --capture --output-file ${OUTPUT_FILE} --ignore-errors inconsistent,mismatch,empty
COMMAND ${LCOV_PATH} --remove ${OUTPUT_FILE} '**/error_injector/*' '**/mock/*' '**/.conan/*' '**/test/*' '**/gtest/*' '**/tst/*' '**/celix/gen/*' '**/googletest_project/*' '**/glog/*' '/usr/*' --output-file ${OUTPUT_FILE}.cleaned --ignore-errors unused,empty,inconsistent

#test dependencies, so that test is runned
DEPENDENCIES ${TEST_TARGET_NAME}
Expand Down
4 changes: 2 additions & 2 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def build_requirements(self):
if self.options.enable_testing:
self.test_requires("gtest/1.17.0")
if self.options.enable_ccache:
self.build_requires("ccache/4.7.4")
self.build_requires("ccache/[>=4.8 <=4.10.2]")
if self.options.enable_benchmarking:
self.test_requires("benchmark/[>=1.6.2]")

Expand Down Expand Up @@ -382,7 +382,7 @@ def requirements(self):
or (self.options.build_rsa_remote_service_admin_dfi and self.options.enable_testing)):
self.requires("libxml2/[>=2.9.9 <3.0.0]")
if self.options.build_cxx_remote_service_admin:
self.requires("rapidjson/[>=1.1.0 <2.0.0]")
self.requires("rapidjson/[>1.1.0 <2.0.0 || >=cci.20200410]")
if self.options.build_http_admin or self.options.build_rsa_discovery_common \
or self.options.build_rsa_remote_service_admin_dfi:
self.requires("civetweb/1.16")
Expand Down
19 changes: 16 additions & 3 deletions documents/building/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Apache Celix aims to be support a broad range of UNIX platforms.

Currently, the [continuous integration build server] builds and tests Apache Celix for:

* Ubuntu Jammy Jellyfish (22.04)
* Ubuntu Resolute Raccoon (26.04)
* GCC
* CLang
* OSX
Expand Down Expand Up @@ -54,7 +54,7 @@ The following packages (libraries + headers) should be installed on your system:
* cmake (3.19 or higher)
* Conan (2 or higher)

For Ubuntu 22.04, use the following commands:
For Ubuntu 26.04, use the following commands:
```bash
sudo apt-get install -yq --no-install-recommends \
build-essential \
Expand Down Expand Up @@ -123,6 +123,19 @@ To see a complete overview of the available build options in the recipe you can
conan inspect . | grep build_
```

#### CMake 4 and Jansson

When building on a system with CMake 4 or higher, the following entry is needed in your Conan host
profile (for example, `debug`):

```ini
[buildenv]
jansson/2.14:CMAKE_POLICY_VERSION_MINIMUM=3.5
```

This is needed because Jansson 2.14 is based on an older version of CMake, and this entry sets the
minimum CMake policy version only in Jansson's build environment.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be and has already been fixed by jansson's reciple: https://github.com/conan-io/conan-center-index/blob/7fc80e7d9beb8570ef7d3b247a26d2f5905648b0/recipes/jansson/all/conanfile.py#L60-L61

Thus, it is not needed any more.


#### CMake Private Linking Workaround (Conan)

When using Celix via Conan, you may encounter an [issue](https://github.com/apache/celix/issues/642) where `libzip.so` is not found by the linker. This is due to a [bug in Conan](https://github.com/conan-io/conan/issues/7192).
Expand Down Expand Up @@ -164,7 +177,7 @@ The following packages (libraries + headers) should be installed on your system:
* libcurl (used in framwork for setup and (among others) in remote services


For Ubuntu 22.04, use the following commands:
For Ubuntu 26.04, use the following commands:

```bash
sudo apt-get update
Expand Down
2 changes: 1 addition & 1 deletion libs/etcdlib/src/etcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ etcd_get_recursive_values(json_t *js_root, etcdlib_key_value_callback callback,

static long long etcd_get_current_index(const char *headerData) {
long long index = -1;
char *indexStr = strstr(headerData, ETCD_HEADER_INDEX);
const char *indexStr = strstr(headerData, ETCD_HEADER_INDEX);
indexStr += strlen(ETCD_HEADER_INDEX);

if (sscanf(indexStr, "%lld\n", &index) == 1) {
Expand Down
6 changes: 4 additions & 2 deletions libs/framework/gtest/src/ScheduledEventTestSuite.cc
Original file line number Diff line number Diff line change
Expand Up @@ -720,8 +720,10 @@ TEST_F(ScheduledEventTestSuite, ScheduledEventTimeoutLogTest) {
output = stderr;
}
fprintf(output, "%s: ", celix_logLevel_toString(level));
vfprintf(output, format, args);
fprintf(output, "\n");
if (format) {
vfprintf(output, format, args);
fprintf(output, "\n");
}
};
celix_framework_setLogCallback(fw->getCFramework(), &logCount, logCallback);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know whether gcc attribute annotation will work in this case, but guess it will.


Expand Down
2 changes: 1 addition & 1 deletion libs/utils/src/celix_hash_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ celix_status_t celix_hashMap_resize(celix_hash_map_t *map) {
return CELIX_SUCCESS;
}

size_t newCapacity = (size_t)floor((double)map->bucketsSize * CELIX_HASHMAP_CAPACITY_INCREASE_FACTOR);
size_t newCapacity = map->bucketsSize * CELIX_HASHMAP_CAPACITY_INCREASE_FACTOR;
if (map->bucketsSize > CELIX_HASHMAP_MAXIMUM_INCREASE_VALUE) {
//after a certain point, only increase with CELIX_HASHMAP_MAXIMUM_INCREASE_VALUE instead of a factor
newCapacity = map->bucketsSize + CELIX_HASHMAP_MAXIMUM_INCREASE_VALUE;
Expand Down
2 changes: 1 addition & 1 deletion libs/utils/src/celix_log_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ void celix_logUtils_vLogToStdout(const char *logName, celix_log_level_e level, c
static pthread_mutex_t globalMutex = PTHREAD_MUTEX_INITIALIZER;

void celix_logUtils_vLogToStdoutDetails(const char *logName, celix_log_level_e level, const char* file, const char* function, int line, const char *format, va_list formatArgs) {
if (level == CELIX_LOG_LEVEL_DISABLED) {
if (format == NULL || level == CELIX_LOG_LEVEL_DISABLED) {
//silently ignore
return;
}
Expand Down
Loading