Skip to content

[Debian/Build] Build ml-api on Ubuntu 26.04 (gcc fallback, C++17) - #692

Draft
myungjoo wants to merge 2 commits into
nnstreamer:mainfrom
myungjoo:fix/ubuntu-26.04-gcc
Draft

[Debian/Build] Build ml-api on Ubuntu 26.04 (gcc fallback, C++17)#692
myungjoo wants to merge 2 commits into
nnstreamer:mainfrom
myungjoo:fix/ubuntu-26.04-gcc

Conversation

@myungjoo

@myungjoo myungjoo commented Sep 5, 2026

Copy link
Copy Markdown
Member

Why

ppa:nnstreamer/ppa now publishes nnstreamer, nnstreamer-edge, ssat, tensorflow2-lite and edgetpu for Ubuntu 26.04 (resolute), but ml-api cannot follow: the Launchpad recipe nnstreamer-ml-api-daily stops at the build-dependency stage on 24.10 and later because every compiler alternative in debian/control (gcc-9 | gcc-8 | ... | gcc-5) has been dropped from the archive. Once past that, all four gtest binaries fail to compile on 26.04 because GoogleTest 1.17 refuses anything older than C++17.

What

  • debian/control: append the unversioned gcc as the last compiler alternative, the same fallback nnstreamer (#4895) and nnstreamer-edge ([Build] Compile and package on Ubuntu 26.04 (gcc 15) nnstreamer-edge#256) already carry. 22.04 and 24.04 still resolve gcc-9 first, so nothing changes there.
  • meson.build: cpp_std=c++14 -> c++17. The Android build already passes -std=c++17 and nnstreamer has been on C++17 for years.

How it was verified

Full packaging build in an ubuntu:26.04 container with ppa:nnstreamer/ppa enabled, mk-build-deps from the modified control, then dpkg-buildpackage -us -uc -b (gcc 15.2.0, meson 1.10, openjdk 11 from the archive). Without the second commit the build stops with

/usr/include/gtest/internal/gtest-port.h:273:2: error: #error C++ versions less than C++17 are not supported.

in unittest_capi_inference, unittest_capi_inference_single, unittest_capi_inference_latency and unittest_capi_datatype_consistency. With both commits the build completes, override_dh_auto_test (packaging/run_unittests.sh) runs, and all eight .debs are produced.

No functional change, so no new test case; the existing unit tests are what the C++17 change makes buildable again on 26.04.

Part of the 26.04 PPA work tracked in nnstreamer/nnstreamer#4902. After this merges, the Launchpad recipe needs Resolute added and a build requested (I can do that).

🤖 Generated with Claude Code

The compiler alternatives stop at gcc-9, which no longer exists on Ubuntu
24.10 and later; Ubuntu 26.04 (resolute) ships gcc-13/14/15 only. Every
Launchpad recipe build of ml-api for those series therefore stops at the
build-dependency stage. Append the unversioned "gcc" as the last
alternative so apt falls back to the archive default, exactly as
nnstreamer and nnstreamer-edge already do. The older alternatives stay
first, so 22.04 and 24.04 resolve exactly as before.

The nnstreamer PPA now publishes nnstreamer, nnstreamer-edge, ssat,
tensorflow2-lite and edgetpu for 26.04, so this is the only change ml-api
needs to build there. No functional change; the packaging build was
verified in an ubuntu:26.04 container against ppa:nnstreamer/ppa.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@myungjoo

myungjoo commented Sep 5, 2026

Copy link
Copy Markdown
Member Author

[Automated review by a separate Claude agent, relayed to this PR by the author's account]

Reviewed both commits (7ffa297, 492e55e) against a fresh checkout of the branch.

Verdict: approve. No blocking findings; one minor commit-message nit.

What was checked

  • C++ surface affected by the standard bump. The only C++ sources in the repo are the nine gtest binaries under tests/capi/*.cc; every shipped library (c/src, java/android/.../jni) is C. So cpp_std=c++17 changes nothing about installed artifacts or ABI. A grep for constructs removed in C++17 (std::auto_ptr, random_shuffle, dynamic exception specifications, register, unary_function/bind1st/ptr_fun) finds nothing in the test sources.
  • Other build files do not disagree. java/android/nnstreamer/src/main/jni/Application.mk already sets APP_CPPFLAGS := -std=c++17; there is no CMake, and no cpp_args/override_options anywhere in the meson tree that would pin a different standard.
  • Tizen GBS. packaging/machine-learning-api.spec strips -std=gnu++11 from CXXFLAGS explicitly so that meson decides the standard, so the bump does propagate to Tizen builds. That is the same toolchain nnstreamer has been building with cpp_std=c++17 for years, so no new risk there.
  • 22.04 / 24.04. Both series still carry gcc-9 in universe, and the new | gcc is appended last, so apt resolution on jammy/noble is unchanged. gcc-9 with -std=c++17 -Werror is exercised today by nnstreamer's own jammy pdebuild, and this PR's jammy pdebuild job will confirm it for these test files.
  • meson floor. meson_version: '>=0.50.0' accepts c++17 as a cpp_std value, and meson has had the c++17 -> c++1z fallback for older compilers since before 0.50.
  • Bisectability. Commit 1 alone only lets 26.04 get further (to the gtest error); it cannot regress any series that built before. Commit 2 alone is harmless on every series. Either order is safe.
  • Test policy. Build-script-only change; the PR body states why no new test case is added, as CLAUDE.md requires.
  • Commit hygiene. Subjects follow [Component] Summary ([Debian], [Build]); each commit has exactly one Signed-off-by for the author plus a Co-Authored-By trailer; no duplicate sign-off.

Findings (ranked)

  1. Minor / commit message accuracy (492e55e). The body says "gcc 7 and later, the oldest compiler the packaging accepts, support it", but debian/control still lists gcc-6 | gcc-5 (>=5.4) as alternatives. On those compilers meson would fall back to -std=c++1z, which gcc 5/6 only partially implement. In practice this is moot (no supported series ships gcc-5/6, and the gtest that needs C++17 is not on any series that has them), but the sentence is wrong as written. Suggest rewording to something like "every compiler a current series can resolve (gcc-9 and later) supports it", or, separately, pruning the gcc-5/6 alternatives if you want the claim to hold literally. Not worth blocking on.

  2. Informational, not a defect. No CI job builds on 24.10+/26.04, so the 26.04 verification is manual-only and will stay that way until the Launchpad recipe gets Resolute added (which the PR body already plans). If you want it covered in-repo later, the pdebuild matrix in .github/workflows/pdebuild.yml would need a second distroname entry; out of scope for this PR.

Nothing else. The change is the minimum needed and mirrors what nnstreamer (#4895) and nnstreamer-edge (#256) already merged.

GoogleTest 1.17, which Ubuntu 26.04 ships, refuses anything older than
C++17 with "#error C++ versions less than C++17 are not supported", so
every gtest binary of ml-api fails to compile there while the libraries
themselves build fine. Raise the meson default from c++14 to c++17. The
Android build already uses -std=c++17 and nnstreamer itself has been on
c++17 for a long time, so this only aligns the Ubuntu build with them.
Every compiler a current series can resolve from the packaging, gcc-9
and later, supports it.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@myungjoo
myungjoo force-pushed the fix/ubuntu-26.04-gcc branch from 492e55e to 792c886 Compare September 5, 2026 01:18
@myungjoo

myungjoo commented Sep 5, 2026

Copy link
Copy Markdown
Member Author

[Relayed on behalf of the author by a Claude agent]

Thanks. Finding 1 is fixed: the second commit's message now says "every compiler a current series can resolve from the packaging, gcc-9 and later, supports it" instead of the wrong gcc-7 claim (commit message only, no content change; force-pushed to the same branch). The gcc-5/6 alternatives are left as they are in this PR since no series that still has them is affected.

Finding 2 is understood: 26.04 coverage comes from the Launchpad recipe once Resolute is added there, which is the next step after this merges.

myungjoo added a commit to myungjoo/nntrainer that referenced this pull request Sep 5, 2026
The compiler alternatives stop at gcc-13, which Ubuntu 26.04 (resolute)
no longer ships, so the Launchpad recipe build of nntrainer for that
series stops at the build-dependency stage. Append the unversioned
"gcc" as the last alternative so apt falls back to the archive default,
as nnstreamer and nnstreamer-edge already do (ml-api gets the same in
nnstreamer/api#692). The versioned alternatives stay first, so 22.04
and 24.04 resolve exactly as before.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant