Skip to content

Commit

Permalink
[SymForce] Fix CI on new compilers
Browse files Browse the repository at this point in the history
The return in these functions is of a different type, so different
compilers do or don't elide the copy/move.  More idiomatic and efficent
thing to do here is just release anyway.

Topic: sf-fix-ci
Reviewers: brad,nathan,ryan-b
Assignees: brad
GitOrigin-RevId: 8de7ef2bde3e728163be278a261429afa239433a
  • Loading branch information
aaron-skydio committed Feb 18, 2025
1 parent 007b0b9 commit d1ced09
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
os: [ubuntu-24.04]
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
compiler:
# Default gcc on 24.04
# Newest gcc on 24.04
- C: gcc-14
CXX: g++-14
package: g++-14
Expand Down
3 changes: 1 addition & 2 deletions symforce/codegen/pybind_templates/sym_type_casters.h.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@ struct sym_type_caster {
const py::object from_storage =
py::module_::import("sym").attr(kClassName).attr("from_storage");
py::object result = from_storage(list);
result.inc_ref();
return std::move(result);
return result.release();
}
};

Expand Down
3 changes: 1 addition & 2 deletions symforce/pybind/lcm_type_casters.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ struct type_caster<
const py::object lcm_py_type =
py::module_::import(module_path.c_str()).attr(LCMType::getTypeName());
py::object result = lcm_py_type.attr("decode")(msg_bytes);
result.inc_ref();
return result;
return result.release();
}
};

Expand Down
3 changes: 1 addition & 2 deletions symforce/pybind/sym_type_casters.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,7 @@ struct sym_type_caster {
const py::object from_storage =
py::module_::import("sym").attr(kClassName).attr("from_storage");
py::object result = from_storage(list);
result.inc_ref();
return std::move(result);
return result.release();
}
};

Expand Down

0 comments on commit d1ced09

Please sign in to comment.