Skip to content

Restore GCC 10 and manylinux2014 compatibility - #15

Merged
han-xudong merged 7 commits into
mainfrom
fix/manylinux2014-float-parser
Jul 24, 2026
Merged

Restore GCC 10 and manylinux2014 compatibility#15
han-xudong merged 7 commits into
mainfrom
fix/manylinux2014-float-parser

Conversation

@han-xudong

@han-xudong han-xudong commented Jul 24, 2026

Copy link
Copy Markdown
Member

Summary

Fix the source build failure encountered by the downstream pyNetFT manylinux2014 wheel job with GCC 10.4. The older libstdc++ provides integer but not floating-point std::from_chars, so the calibration-count parser could not compile even though the project targets C++17.

Replace that private parser with a locale-independent C++17 stream implementation while preserving the existing validation contract: complete input consumption, finite positive values, range rejection, and rejection of a leading plus sign. Parsing is isolated from the caller's floating-point environment by temporarily holding exceptions and selecting round-to-nearest, then restoring the complete environment on every success and error path.

Add a pinned GCC 10 compatibility job and regression coverage for decimals, scientific notation, locale changes, rounding modes, exception flags, and enabled glibc floating-point traps. The intentional ATI HTTP-only configuration endpoint now uses a documented source-level CodeQL suppression at the shared scheme constant; SECURITY.md continues to define the required trusted network boundary.

Prepare patch release 0.2.1. Public headers and SOVERSION remain unchanged.

Testing

  • pixi run gcc-10-test — clean GCC 10.4 Release/shared build; 13/13 CTest targets passed
  • pixi run test — clean default build; 13/13 CTest targets passed
  • pixi run format-check
  • pixi run tidy
  • bash test/release_publish_test.sh
  • release metadata alignment, unchanged public-header snapshot/SOVERSION, git diff --check, and clean worktree verified

Earlier task verification also covered GCC and Clang Debug/Release shared/static matrices, CMake 3.16 installed consumers, ASan/UBSan, and coverage generation.

Hardware

No physical sensor was contacted. The change is isolated to deterministic calibration parsing and uses the fake HTTP sensor tests.

Backports

No automatic ros-netft backport is included. If the ROS package needs this GCC 10 compatibility fix, it will receive a separate manual snapshot update referencing the final merged commit.

Checklist

  • Tests were added or updated for behavior changes.
  • pixi run format-check, pixi run tidy, and pixi run test pass.
  • Public behavior and the 0.2.1 fix are documented.
  • Hardware testing was not required.
  • Any future ros-netft use will follow the documented manual backport process.

Summary by CodeRabbit

  • New Features

    • Released version 0.2.1.
  • Bug Fixes

    • Restored GCC 10 / manylinux2014 source compatibility.
    • Improved sensor calibration count parsing (supports decimal and scientific notation).
    • Parsing is now consistent across locale and floating-point rounding/exception settings, and rejects malformed, overflowing, or non-finite values.
    • Firmware discovery configuration consistently uses the supported HTTP protocol boundary.
  • Tests

    • Added automated GCC 10 compatibility build/test.
    • Expanded XML numeric parsing and floating-point/locale behavior test coverage.

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@han-xudong, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 11 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 1583070f-c42a-4ef5-af4c-b853ad7839c2

📥 Commits

Reviewing files that changed from the base of the PR and between 87cd4c6 and 1491034.

⛔ Files ignored due to path filters (1)
  • pixi.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • .github/workflows/ci.yml
  • .github/workflows/codeql.yml
  • pixi.toml
  • test/codeql_workflow_test.sh
📝 Walkthrough

Walkthrough

The change replaces calibration-count parsing with locale-independent C++17 stream parsing, preserves floating-point state, adds coverage for numeric edge cases, introduces GCC 10 compatibility validation, updates the project to version 0.2.1, and centralizes the ATI HTTP protocol constant.

Changes

Compatibility and release updates

Layer / File(s) Summary
Calibration count parsing and environment preservation
src/detail/xml_config.cpp, test/test_discovery.cpp
Calibration counts now use classic-locale stream extraction under an RAII floating-point environment guard, with expanded tests for locale, rounding, exceptions, overflow, and invalid forms.
GCC 10 compatibility validation
test/gcc10_compatibility_test.sh, pixi.toml, .github/workflows/ci.yml
A pinned GCC 10 build-and-test script is exposed as a Pixi task and executed by a dedicated CI job.
Version and release metadata
CMakeLists.txt, pixi.toml, CHANGELOG.md
Project and workspace versions are updated to 0.2.1, and the compatibility fix is recorded in the changelog.
ATI discovery protocol constant
src/discovery.cpp
The ATI discovery URL scheme and libcurl protocol restriction now use a shared internal HTTP constant.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

  • netft/netft-cpp#3: Updates the same Pixi GitHub Action setup version used by the new GCC 10 CI job.

Suggested labels: github_actions

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: restoring GCC 10 and manylinux2014 compatibility.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/manylinux2014-float-parser

Comment @coderabbitai help to get the list of available commands.

Comment thread src/discovery.cpp Dismissed
@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 53.84615% with 12 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/detail/xml_config.cpp 50.00% 6 Missing and 6 partials ⚠️

📢 Thoughts on this report? Let us know!

@coderabbitai coderabbitai 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.

🧹 Nitpick comments (1)
test/gcc10_compatibility_test.sh (1)

18-24: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Verify the resolved compiler is actually GCC 10.4.x before building.

The cmake-316 CI job greps the pinned CMake version to fail fast on drift; this script has no equivalent check for the pinned GCC version. If the spec ever resolves to a different compiler/version, this job would silently stop testing GCC 10 compatibility while still passing.

♻️ Proposed fix to fail fast on compiler drift
     cmake -S "${repo_root}" -B "${build_dir}" -G Ninja \
       -DCMAKE_CXX_COMPILER=x86_64-conda-linux-gnu-c++ \
       -DCMAKE_BUILD_TYPE=Release \
       -DBUILD_SHARED_LIBS=ON \
       -DBUILD_TESTING=ON
+    x86_64-conda-linux-gnu-c++ --version | grep -E "\) 10\.4\." || {
+      echo "expected GCC 10.4.x, got a different compiler version" >&2
+      exit 1
+    }
     cmake --build "${build_dir}"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/gcc10_compatibility_test.sh` around lines 18 - 24, Update the GCC
compatibility setup before the CMake configure/build steps to resolve the
selected x86_64-conda-linux-gnu-c++ compiler version and fail immediately unless
it is GCC 10.4.x. Keep the existing CMake, build, and ctest flow unchanged after
this validation.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@test/gcc10_compatibility_test.sh`:
- Around line 18-24: Update the GCC compatibility setup before the CMake
configure/build steps to resolve the selected x86_64-conda-linux-gnu-c++
compiler version and fail immediately unless it is GCC 10.4.x. Keep the existing
CMake, build, and ctest flow unchanged after this validation.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 8c01936c-1bd6-448b-8cc3-6ed26e13b764

📥 Commits

Reviewing files that changed from the base of the PR and between 40a53bd and 71eaf48.

📒 Files selected for processing (8)
  • .github/workflows/ci.yml
  • CHANGELOG.md
  • CMakeLists.txt
  • pixi.toml
  • src/detail/xml_config.cpp
  • src/discovery.cpp
  • test/gcc10_compatibility_test.sh
  • test/test_discovery.cpp

@han-xudong
han-xudong merged commit 7654ef7 into main Jul 24, 2026
18 checks passed
@han-xudong
han-xudong deleted the fix/manylinux2014-float-parser branch July 24, 2026 17:15
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.

2 participants