Skip to content

Update build setup for Ubuntu 26.04 - #848

Open
pnoltes wants to merge 6 commits into
masterfrom
feature/update-gh-workflow-ubuntu
Open

pnoltes wants to merge 6 commits into
masterfrom
feature/update-gh-workflow-ubuntu

Conversation

@pnoltes

@pnoltes pnoltes commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

This PR updates the CI/build configuration to use Ubuntu 26.04.

Changes:

  • Switches CI workflows from ubuntu-22.04 to ubuntu-26.04
  • DevContainer: Base image Ubuntu 24.04 → 26.04
  • Conan profiles: Update CMake from 3.26.4 → 4.4.3
  • Documentation: Note about jansson/2.14 and CMAKE_POLICY_VERSION_MINIMUM=3.5 for CMake 4

Code fixes, due to updated toolchains:

  • NULL checks for vfprintf format strings (log utils, test suites) (new warning from updated compilers)
  • const char* fixes for strrchr/strchr/strstr return types (new warning from updated compilers)
  • Remove unnecessary floor() + double conversion in hash map resize (new warning from update compilers)
  • CivetWeb: disable -Werror for third-party code (newer compilers)
  • lcov: add --ignore-errors inconsistent,mismatch,empty (not happy about this, but for now fixes lcov with a newer gcc)
  • Position-independent code for rsa_discovery_common (changed default behavior)

Rationale: My development environment (and likely others) already uses CMake 4 and newer compilers, so maybe it time to also update the codebase for this.
Note Ubuntu 26.04 on GitHub Actions is still in preview, we could also make this PR a draft and wait till Ubuntu 26.04 is fully supported.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.61%. Comparing base (270c784) to head (105dbfc).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #848      +/-   ##
==========================================
+ Coverage   91.54%   91.61%   +0.06%     
==========================================
  Files         235      235              
  Lines       28787    28788       +1     
==========================================
+ Hits        26353    26373      +20     
+ Misses       2434     2415      -19     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@PengZheng PengZheng left a comment

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.

LGTM. I only left some minor remarks. The nonnull annotation is worth noting, since I believe it provides a cleaner fix for the compiler warning.

Unfortunately, I am stuck with Ubuntu 24.04 currently, though Ubuntu 26.04.1 has already been released on Aug 28:

Users of Ubuntu 24.04 LTS will be offered an automatic upgrade to 26.04.1 LTS
via Update Manager a couple of weeks following this release after some planned
backports to address regressions in a recent version of rust-coreutils.

```

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.

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.

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

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants