sofa-framework / sofa

Real-time multi-physics simulation with an emphasis on medical simulation.
https://www.sofa-framework.org
GNU Lesser General Public License v2.1
934 stars 312 forks source link

[Plugins] Sofa Fetch plugin create .gitignore file ignoring all new files #4409

Open epernod opened 11 months ago

epernod commented 11 months ago

When fetching plugins such as SofaPython3 or BeamAdapter directly at CMake configure time, the plugin is well added in the list of applications/plugins/ but it create also add a .gitignore file (which is not in the plugin repository). This .gitignore file has in it:

*

thus all new file created in the plugin are ignored.

Is it a wanted behavior?

damienmarchal commented 11 months ago

I consider the fetch mechanism within the Sofa subdirectories as a flawned design that is causing more troubles than it solved. And it is the n°1 cause of "Can you help me, I updated SOFA from master it does not compile anymore " at DEFROST (eg: https://github.com/sofa-framework/sofa/issues/4343).

This fetch mechanism is simplifing the initial "fetch" of the plugins but it complexify a lot every subsequent updates for each of them.

So to me, the fetches should be done outside the sofa directory structures (or not be used at all).

fredroy commented 10 months ago

To answer directly the question of @epernod , yes 🫠

I think it was designed to mimic https://cmake.org/cmake/help/latest/module/FetchContent.html (kind of), at a time where it did not exist in CMake yet ; as ExternalProject_Add https://cmake.org/cmake/help/latest/module/ExternalProject.html have existed since much longer time ago (CMake 3.0 ?)

Now that it is been introduced few years from now (2018 I think), I think the ExternalProject_Add mechanism should be phased out and replaced by the FetchContent one. It would save the problem of getting the source being pulled into the source dir of SOFA (hence the .gitignore file) AND also the problem of plugins' updates, as (normally) the cmake configure step updates the source (except if FETCHCONTENT_UPDATES_DISCONNECTED is set)