Skip to content

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

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

[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>
@myungjoo

myungjoo commented Sep 7, 2026

Copy link
Copy Markdown
Member Author

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

Re-reviewed after the force-push that rewords commit 792c886's message (7ffa297 unchanged). Verified directly against origin/fix/ubuntu-26.04-gcc rebased on upstream/main, not just the GitHub diff view.

Verdict: approve. The prior minor finding is fixed, and no new issues were found on independent re-verification.

Prior finding re-checked

  • Finding 1 (commit message accuracy) — confirmed fixed. Commit 792c886 now reads "Every compiler a current series can resolve from the packaging, gcc-9 and later, supports it," replacing the earlier "gcc 7 and later" claim. This is accurate: apt resolves gcc-9 first on 22.04/24.04, and falls through to the newly-added unversioned gcc (→ gcc-13/14/15) only on 24.10+/26.04 — every path lands on gcc-9 or newer. The stale gcc-6 | gcc-5 (>=5.4) alternatives are left untouched, as the author noted, since no currently supported series resolves them; this doesn't affect the truth of the reworded sentence. Message-only change, oid list confirms no content diff: debian/control/meson.build are byte-identical to the first review.
  • Finding 2 (26.04 not covered by in-repo CI) — unchanged, non-blocking, acknowledged. Still true; out of scope per the author's plan to add Resolute to the Launchpad recipe after merge.

Independent verification performed this pass

  • Diff is exactly the same 2-line change as before: debian/control build-dep alternative, meson.build cpp_std=c++14c++17. Nothing else touched — proportionate to the stated goal.
  • Grepped all 9 tests/capi/*.cc files (the only C++ sources in the repo besides the Android JNI glue) for constructs removed/restricted in C++17 (auto_ptr, random_shuffle, unary_function/binary_function, bind1st/bind2nd/ptr_fun, dynamic exception specs, register as a storage-class keyword). No real hits — only benign uses of the English word "register" in comments.
  • Repo-wide grep for cpp_std, c++14, c++11, gnu++ found only the two expected sites: meson.build (now c++17) and packaging/machine-learning-api.spec (strips -std=gnu++11 from CXXFLAGS so meson's cpp_std wins on Tizen GBS too). No other subproject or build file pins a conflicting standard.
  • java/android/nnstreamer/src/main/jni/Application.mk already hardcodes APP_CPPFLAGS := -std=c++17, so the NDK build is unaffected and was already ahead of this change.
  • meson_version: '>=0.50.0' in meson.build is compatible with cpp_std=c++17.
  • .github/workflows/pdebuild.yml only builds ubuntu-22.04 (jammy) with gcc-9-resolvable toolchain; it runs on every PR and will build the 9 gtest binaries under the new cpp_std=c++17, so any real C++17 incompatibility introduced in this or a future PR would fail that CI job before merge. There is no 24.04 or 26.04 job in-repo (matches the PR's own statement and its follow-up plan), so 26.04 verification stays manual until the Launchpad recipe change lands.
  • No architecture or public API change; no documentation update needed.
  • Build-script-only change with no functional/behavioral change to installed libraries — the PR body's stated rationale for adding no new test case holds up under inspection (existing gtest suite is what re-validates the C++17 bump; the fallback compiler line has no test surface of its own beyond "the package still builds").

Note

The PR is still marked DRAFT with a DO NOT MERGE label — presumably intentional pending the Launchpad recipe follow-up mentioned in the PR body, not a code issue.

Nothing else to add; this remains the minimal change needed and continues to mirror the fallback pattern already merged in nnstreamer and nnstreamer-edge.

@myungjoo
myungjoo marked this pull request as ready for review September 7, 2026 01:50

@myungjoo-bot myungjoo-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Automated review (transcribed from an AI review agent's report; please verify before acting).

Summary: The PR appends the unversioned gcc as the last Build-Depends alternative in debian/control and raises meson's cpp_std from c++14 to c++17 so the gtest binaries compile against GoogleTest 1.17 on Ubuntu 26.04. Verified: Debian alternative syntax and archive facts via the Launchpad API (jammy/noble still publish gcc-9 in universe; oracular, plucky, questing and resolute do not; resolute's default gcc is 4:15.2.0 and libgtest-dev is 1.17.0); no other file pins a C++ standard (Android Application.mk already uses -std=c++17, the Tizen spec strips -std=gnu++11 so meson's value wins, no cpp_args / override_options elsewhere); the only C++ sources are the nine tests/capi/*.cc files and none use C++17-removed constructs; the Tizen GBS x86_64 lane with unit_test 1 built the PR head 792c886 with GCC 14.2.0, compiled all C++ objects, linked all nine gtest binaries and ran them; merge-tree against main is clean; both commits carry Signed-off-by with accurate messages. The sibling changes nnstreamer/nnstreamer#4895 and nnstreamer/nnstreamer-edge#256 apply the byte-identical | gcc suffix, and nnstreamer's meson.build is already at cpp_std=c++17. Approving; the items below are non-blocking.

  1. [Low] The Ubuntu pdebuild path is not CI-verified for this PR because the workflow is disabled.github/workflows/pdebuild.yml:3-5 declares pull_request: branches: [main], but the Actions API reports the workflow as disabled_inactivity (last run: scheduled, 2026-08-09 on e7fedae), and no pdebuild run exists for 792c886. The earlier automated comments on this PR saying "this PR's jammy pdebuild job will confirm it" are therefore not accurate. For a 2-line change this is acceptable given the GBS lane compiled every gtest binary under cpp_std=c++17 and the author reports a full dpkg-buildpackage in an ubuntu:26.04 container, but please re-enable the workflow (gh workflow enable pdebuild.yml --repo nnstreamer/api) and ideally re-trigger it on this PR so the jammy path (gcc-11 + gtest 1.11 + -Werror) is covered too. daily-build-gbs.yml and nns_api_testhub.yml are also disabled_inactivity.
  2. [Low] The compiler alternative list is vestigial; no inconsistency, but the commit text slightly overstates its effectdebian/rules never sets CC / CXX and there is no g++ alternative, so meson picks cc / c++ from build-essential. On jammy/noble apt installs gcc-9 first as the commit says, but the actual compiler is gcc-11 / gcc-13, and gcc-15 on resolute. The fallback is safe and mirrors nnstreamer / nnstreamer-edge exactly, so no change requested. Optional follow-up across all three repos: replace the gcc-9 | ... | gcc-5 (>= 5.4) | gcc group with plain gcc, g++ (or rely on build-essential).
  3. [Low] Docs / changelog: nothing to update. No README or Documentation file mentions the C++ standard or compiler version, and debian/changelog is bumped only at release commits.

No back-door or suspicious behavior found: the diff is exactly two lines in two build files, with no scripts, URLs, dependencies, or workflow changes.

@myungjoo

myungjoo commented Sep 7, 2026

Copy link
Copy Markdown
Member Author

Libraries we use are requiring C++17 these days :(

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.

2 participants