Repository navigation
Support OCCT 8.x #237
Description
Summary
OCCT 8.x released in May-July 2026 and is available on conda-forge for linux-64, linux-aarch64, linux-ppc64le, osx-64, osx-arm64 and win-64.
Current blockers:
crates/opencascade-sys/build.rspinsconst OCCT_VERSION: (u8, u8) = (7, 8);and panics unlessversion_major == 7 && version_minor >= 8.- Types removed from OCCT 8.0:
Handle_Geom_Surface,Handle_Poly_Triangulation, …
What changed in OCCT 8.0 (provisional list)
- Handles. In 7.8.1 every class header ends with
DEFINE_STANDARD_HANDLE(Geom_Surface, Geom_Geometry), which on MSVC definesHandle_Geom_Surfaceas a derived class (the C++/CLI export hack) and as a typedef elsewhere. InV8_0_1, OCCT's own API spells handlesocc::handle<T>, andStandard_Handle.hxxdefinesnamespace occ { using handle = opencascade::handle<T>; }. The macro is marked deprecated. - Constants.
Standard_Boolean,Standard_True,Standard_Falseare deprecated but still defined. - Language level. C++17 is the minimum (
CMakeLists.txt), with 20/23/26 selectable.
Why this also matters for the MSVC bug (#234)
#234 fixes 7.8 by constructing the owned type (new Handle_X(…)) and wrapping the cxx pointer bindings. That is correct for 7.8, but needs gating for 8.0, where Handle_X does not exist.
The durable spelling for the bridge is opencascade::handle<T> (equivalently Handle(T), still defined in 8.0 as #define Handle(Class) opencascade::handle<Class>):
- it is the same type on GCC/Clang as
Handle_Xin 7.8, so nothing changes there; - on MSVC it is not the derived class, so the
unique_ptrownership and the cxx member-pointer shims both type-check (which is the whole of Fix Windows/MSVC build: Handle_X is a distinct class under MSVC #234's classes A and B); - in 8.0 it is exactly what OCCT's headers use (
occ::handleis an alias of it).
So one migration (bridge type declarations and wrapper signatures from Handle_X to opencascade::handle<T>) gives 7.8 and 8.0 support and removes the need for #234's approach for newer OCCT. OCCT's own class names are still needed as type X; declarations on the Rust side.
What's needed for 8.x support beyond the handle
- The version gate: either accept both majors with a compile-time probe of
Standard_Version.hxx(the build script already parsesVERSION_MAJOR/VERSION_MINORfrom CMake), or gate per major behind a feature. A single supporting branch looks feasible, but I need to verify what 8.0 API removes beyond the handles. occt-sys's pinned OCCT submodule for thebuiltinfeature would need an 8.x option (the 7.8 panic message already points at it).- Whatever else 8.0 needs/added/changed
Use case
FerroCAD (a FreeCAD-compatible CAD app) runs opencascade-sys against a conda OCCT prefix on ubuntu-latest and windows-latest, with --check-init boot tests and packaging, and is currently carrying a vendored copy of 0.3.0 + #234 to ship a Windows build.
If it helps, I can run an occt=8.0.1 leg (Linux and/or Windows) against a branch and report what fails, that would create a TODO list for migration.
Also needs a decision: dual-version support in one branch/crate ersion, or a dedicated/parallel 8.x-compatible release.
Activity
[-]Support OCCT 8.x: the Handle_X aliases are gone from 8.0 headers, and the version gate rejects major 8[/-][+]Support OCCT 8.x[/+]