[Build] Compile and package on Ubuntu 26.04 (gcc 15) - #256
Draft
myungjoo wants to merge 3 commits into
Draft
Conversation
gcc 15 compiles C as C23 by default. There glibc's strchr() and strstr() keep the constness of their argument, so storing the result in a "char *" is -Werror=discarded-qualifiers: nnstreamer-edge-util.c:131: initialization discards 'const' qualifier nnstreamer-edge-internal.c:2038: assignment discards 'const' qualifier Both pointers are only read, so "const char *" is the correct type and builds identically on older compilers. The unit tests need C++17 on that release: googletest 1.17, which Ubuntu 26.04 ships, refuses anything older. Only the tests are C++, and nnstreamer itself is already C++17, so raise CMAKE_CXX_STANDARD. Add a workflow job that builds and runs the tests in a ubuntu:26.04 container, since the ubuntu-latest runner image catches neither of these. Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com> Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Ubuntu 25.04 and later, and every current Debian release, dropped gcc-5 through gcc-9 from their archives, so the alternative group made only of those names is unsatisfiable there and the Launchpad recipe build parks in "Dependency wait: gcc-9" (recipe build 3939544 on plucky). Append the unversioned gcc, which the distro default compiler always provides, as nnstreamer/nnstreamer#4895 did for nnstreamer. Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com> Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Member
Author
|
[Automated review by a separate Claude agent, relayed to this PR] No defects found. Findings, most important first:
What I checked:
|
debian/rules configures with -DMQTT_SUPPORT=ON, so compile the mosquitto source under gcc 15 in the 26.04 job as well, and make CMAKE_CXX_STANDARD_REQUIRED so a compiler without C++17 fails at configure time instead of silently decaying. Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com> Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Member
Author
|
[Relayed on behalf of the author by a Claude agent] Both suggestions applied in the follow-up commit: the 26.04 job now installs libmosquitto-dev and configures with -DMQTT_SUPPORT=ON, matching debian/rules, and CMakeLists.txt sets CMAKE_CXX_STANDARD_REQUIRED ON. The MQTT configuration was also built on a 26.04 container before this PR was opened. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
ppa:nnstreamerpublishes nothing for Ubuntu 26.04 (resolute), and nnstreamer-edge is the first package that has to get there:nnstreamer-coredepends on it. Two things stop the Launchpad recipe build of nnstreamer-edge on that series today.The source stage never starts.
Build-Dependsnames onlygcc-9 | gcc-8 | gcc-7 | gcc-6 | gcc-5, none of which exist in Ubuntu 25.04 or later, so the recipe build parks inDependency wait: gcc-9(that is what happened on plucky, recipe build 3939544). Same fix as [Packaging] Add an unversioned gcc fallback to Build-Depends nnstreamer#4895: append the unversionedgcc, which the default compiler always provides.gcc 15 rejects two lines under
-Werror. Ubuntu 26.04 ships gcc 15, which compiles C as C23 by default; there glibc'sstrchr()andstrstr()keep the constness of their argument, so storing the result in achar *is-Werror=discarded-qualifiers:Both pointers are only read (offset arithmetic and
strcasecmp), soconst char *is the correct type and compiles identically on every older compiler.The unit tests need one more change to build there: the archive's googletest 1.17 refuses anything below C++17. Only the tests are C++, and nnstreamer itself already builds as C++17, so
CMAKE_CXX_STANDARDgoes from 14 to 17.Regression coverage
The existing CMake workflow runs on the
ubuntu-latestimage, whose gcc does not default to C23 and whose gtest accepts C++14, so it could not catch either problem. This adds a second job in that workflow that builds and runs the tests inside aubuntu:26.04container. Without the source fixes that job fails exactly as the log above; with them it passes.Verified
On an Ubuntu 26.04 container (gcc 15.2, gtest 1.17):
cmake -DENABLE_TEST=ON+ build +ctest: 2/2 tests pass.-DMQTT_SUPPORT=ON, which is whatdebian/rulesbuilds.dpkg-buildpackage -us -uc -bwith the patcheddebian/control:nnstreamer-edge_0.2.8.0_amd64.debandnnstreamer-edge-dev_0.2.8.0_amd64.debbuild.After merging
nnstreamer-edge-daily-2on Launchpad needs Resolute added to its series and a build requested; adding a series alone does not trigger one. Part of nnstreamer/nnstreamer#4902.🤖 Generated with Claude Code