Skip to content

[Core] Rename BaseObject to BaseComponent#5934

Open
alxbilger wants to merge 10 commits intosofa-framework:masterfrom
alxbilger:basecomponent2
Open

[Core] Rename BaseObject to BaseComponent#5934
alxbilger wants to merge 10 commits intosofa-framework:masterfrom
alxbilger:basecomponent2

Conversation

@alxbilger
Copy link
Contributor

@alxbilger alxbilger commented Feb 4, 2026

This PR implements a backward-compatible transition of the core object base type from BaseObject to BaseComponent while ensuring existing code continues to compile during migration:

  • Renamed core types: All forward declarations, casts, and visitor APIs operating on objects now use BaseComponent (the new type).
  • Backward compatibility layer:
    • BaseObject is a deprecated alias for BaseComponent (ensures existing code compiles without changes).
    • #include <BaseObject.h> is a deprecated alias for #include <BaseComponent.h> (via header shim).
    • toBaseObject() is a deprecated alias for toBaseComponent() (forwarded internally to avoid breaking core builds).
  • Build configuration: Compatibility headers are exposed to downstream consumers via include directories.
  • ⚠️ Critical migration note:

This deprecation layer does not work for code using its own forward-declared BaseObject. Such code will fail with a redefinition error (e.g., BaseObject already defined). Instead of the forward declaration of BaseObject, we recommand to include <sofa/core/fwd.h>. Then, you can rename BaseObject with BaseComponent, although the deprecation layer should work.

[ci-depends-on https://github.com/sofa-framework/SofaPython3/pull/575]
[ci-depends-on https://github.com/sofa-framework/Sofa.Qt/pull/30]

[ci-build][with-all-tests]


By submitting this pull request, I acknowledge that
I have read, understand, and agree SOFA Developer Certificate of Origin (DCO).


Reviewers will merge this pull-request only if

  • it builds with SUCCESS for all platforms on the CI.
  • it does not generate new warnings.
  • it does not generate new unit test failures.
  • it does not generate new scene test failures.
  • it does not break API compatibility.
  • it is more than 1 week old (or has fast-merge label).

@alxbilger alxbilger added pr: breaking Change possibly inducing a compilation error pr: status to review To notify reviewers to review this pull-request pr: clean Cleaning the code labels Feb 4, 2026
@fredroy
Copy link
Contributor

fredroy commented Feb 5, 2026

[ci-build][with-all-tests]

@sofabot
Copy link
Collaborator

sofabot commented Feb 5, 2026

[ci-depends-on] detected during build #5.

All dependencies are merged/closed. Congrats! 👍

@sofabot
Copy link
Collaborator

sofabot commented Feb 5, 2026

[ci-depends-on] detected during build #6.

To unlock the merge button, you must

@sofabot
Copy link
Collaborator

sofabot commented Feb 5, 2026

[ci-depends-on] detected during build #7.

To unlock the merge button, you must

@sofabot
Copy link
Collaborator

sofabot commented Feb 6, 2026

[ci-depends-on] detected during build #8.

To unlock the merge button, you must

@sofabot
Copy link
Collaborator

sofabot commented Feb 8, 2026

[ci-depends-on] detected during build #9.

To unlock the merge button, you must

@bakpaul bakpaul added pr: status ready Approved a pull-request, ready to be squashed and removed pr: status to review To notify reviewers to review this pull-request labels Feb 19, 2026
@sofabot
Copy link
Collaborator

sofabot commented Feb 20, 2026

[ci-depends-on] detected during build #10.

All dependencies are merged/closed. Congrats! 👍

@bakpaul
Copy link
Contributor

bakpaul commented Feb 20, 2026

[ci-build]

@sofabot
Copy link
Collaborator

sofabot commented Feb 20, 2026

[ci-depends-on] detected during build #11.

All dependencies are merged/closed. Congrats! 👍

@bakpaul bakpaul added pr: status to review To notify reviewers to review this pull-request and removed pr: status ready Approved a pull-request, ready to be squashed labels Feb 20, 2026
@bakpaul
Copy link
Contributor

bakpaul commented Feb 20, 2026

BAck to review because scene tests have strange error not seen elsewhere.

@bakpaul bakpaul self-requested a review February 20, 2026 16:34
@alxbilger
Copy link
Contributor Author

I think the error you mention is

[ERROR]   [SofaPython3::SceneLoader] Unable to completely load the scene from file '/workspace/build/external_directories/fetched/SofaPython3/examples/access_mass_matrix.py'.  
Python exception:   
  TypeError: Unknown Attribute(s):   
  - Unable to set attribute 'ordering' with value: Natural. Possible misspelling of attribute 'orderingMethod' ?  


At:
  /workspace/build/external_directories/fetched/SofaPython3/examples/access_mass_matrix.py(61): createScene

which is fixed in sofa-framework/SofaPython3#577. Let's re-run the jobs and see...

@hugtalbot
Copy link
Contributor

This PR deserves the attention of all @sofa-framework/reviewers

@sofabot
Copy link
Collaborator

sofabot commented Feb 24, 2026

[ci-depends-on] detected during build #12.

All dependencies are merged/closed. Congrats! 👍

@sofabot
Copy link
Collaborator

sofabot commented Feb 25, 2026

[ci-depends-on] detected during build #13.

All dependencies are merged/closed. Congrats! 👍

@bakpaul
Copy link
Contributor

bakpaul commented Feb 25, 2026

[ci-build][force-full-build]

@sofabot
Copy link
Collaborator

sofabot commented Feb 25, 2026

[ci-depends-on] detected during build #14.

All dependencies are merged/closed. Congrats! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr: breaking Change possibly inducing a compilation error pr: clean Cleaning the code pr: status to review To notify reviewers to review this pull-request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants