Backport non-breaking changes from main for Humble and Jazzy to branch v0.9 - #72
Open
nbbrooks wants to merge 11 commits into
Open
Backport non-breaking changes from main for Humble and Jazzy to branch v0.9#72nbbrooks wants to merge 11 commits into
v0.9#72nbbrooks wants to merge 11 commits into
Conversation
Backport of the functional part of upstream dd73810. Writing through reinterpret_cast<T*> to the byte buffer is UB (type-punning / possible misalignment); use std::memcpy instead. Only the memcpy hunk is taken. The rest of dd73810 is clang-format churn against the post-1.0.0 has_TypeDefinition SFINAE overloads, which do not exist on this branch. (cherry picked from commit dd73810f1e42a4b60d2c62a4e56ffbaa8e7b1e10, partial)
Co-authored-by: jlack <jlack@nauticusrobotics.com> (cherry picked from commit 561dcf4)
(cherry picked from commit 3bb5e80) (cherry picked from commit ca2724e06d2d07abd8dbc0b517d9b7ea930ba3d7)
The 0.9.x branch applies -Werror globally via add_compile_options, so the unused variable carried over from upstream 3bb5e80 fails the test build. On main the flags are scoped to the data_tamer target only, which is why this never tripped there. (cherry picked from commit cadbc8f391c91ea9dc9e65159a95baeb9e832f0a)
(cherry picked from commit c010851)
(cherry picked from commit 14474eb)
…Channel (cherry picked from commit de6319f)
(cherry picked from commit a355a4d)
(cherry picked from commit 8254589)
LockedRef& operator=(LockedRef&&) declares a reference return type but falls off the end of the function. Any consumer that move-assigns a LockedRef gets 'error: no return statement in function returning non-void [-Werror=return-type]', or UB if the result is used without -Werror. This is the 0.9.x counterpart of upstream #23 (7365642), which cannot be cherry-picked: it patches LockedPtr::operator=, a class that only exists after the LockedRef -> LockedPtr rewrite in #27. The upstream bug (a stray '&' on mutex_) was introduced by that rewrite; the bug on this branch is different and more severe.
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
Humble and Jazzy have been stranded on
0.9.3/0.9.4since early 2024 while Kilted, Lyrical and Rolling moved to1.0.3. See #69.mainitself builds and tests clean on both. However,1.0.0removed public API (TypeDefinition<T>,getLockedReference()/LockedRef,details/mutex.hpp) and changed ABI. Shipping it to a released distro would break violate semantic versioning contracts. Users can source buildmainto opt-in to breaking changes.The
v0.9branch takes only the additive and bug-fix subset of the 75 commits since0.9.4, to be released as0.9.5— a legitimate patch bump on both distros.Included
dd73810SerializeIntoBuffer— write throughreinterpret_cast<T*>into the byte bufferstd::memcpyhunk. The rest is clang-format churn against post-1.0.0has_TypeDefinitionSFINAE overloads that don't exist here.561dcf4inlineonTypeField::operator==— fixes multiple-definition link failure3bb5e80MCAPSink::finishQueueAndStop()+ 3 protectedDataSinkBasequeue hooksdt_tests.cpphunk dragged in an unrelatedLockedPtrtest using1.0.x-only API — dropped, kept onlyFinishQueue. See therestartRecordingnote below.c01085114474ebde6319f0acbf45a355a4d8254589LogChannel::removeDataSink(),getNumberOfSinks(),sinks_mutexlocking,logging_startedrace fix, newadd_remove_sink_tests.cppif (vsif(). Took upstream semantics, kept this branch's spacing. All six needed —8254589fixes a racec010851introduces.eb17feeCMAKE_WINDOWS_EXPORT_ALL_SYMBOLSmain.Plus two commits authored for this branch, not cherry-picks — please don't try to match them against
main:tests: drop unused id_value in FinishQueue test— this branch applies-Werrorglobally viaadd_compile_options, so it covers tests.mainscoped it totarget_compile_options(data_tamer PRIVATE ...), which is why the unused variable in3bb5e80never tripped upstream.fix: missing return in LockedRef move-assignment—LockedRef& operator=(LockedRef&&)declares a reference return type and falls off the end. Any consumer that move-assigns one gets-Werror=return-type, or UB without-Werror. Latent in-tree only because nothing instantiates it. This is the counterpart of Fix compile error #23 (see below).Excluded
13e10a9"Merge branch 'new_custom'" (no PR)TypeDefinition<T>struct API andgetLockedReference()/LockedRef. This is the change that stranded these distros.details/mutex.hpp, redefinesMutexasstd::shared_mutex.BasicType : uint8_t). Also flipsBuilSchemaFromTexttocheck_hash = false, silently weakening validation this branch currently enforces.49b4c6c,f2dcee6are built on the post-1.0.0has_TypeDefinitionSFINAE. Only the UB hunk extracts.TypeDefinitionAPI — actively wrong on0.9.x.LockedPtr::operator=, a class that only exists after theLockedRef→LockedPtrrewrite in #27 — the same rewrite that introduced #23's bug. Equivalent fix authored directly instead (above).restartRecordingnote below.1.0.xline — irrelevant to this branch, which needs its own Humble+Jazzy workflow.One resolution worth a careful look
3bb5e80adds astartAcceptingSnapshots()call torestartRecordingImpl(), which doesn't exist at0.9.4— it arrived with #37. Git auto-resolved this into the tail ofrestartRecording(), which is the semantically right place, but it was fuzzy auto-resolution rather than an authored decision.If #37 is ever backported, this must be revisited or the call lands in the wrong function.
Verification
Built and tested in
osrf/ros:humble-desktopandosrf/ros:jazzy-desktop:DataTamerBasic.FinishQueueand theadd_remove_sink_tests.cppsuiteLockedReffails to compile before the fix and compiles after, on both distrosNet diff vs
0.9.4: +219 / −12 across 14 files. No public API removed.