FreeCAD icon indicating copy to clipboard operation
FreeCAD copied to clipboard

update libkdtree

Open mosfet80 opened this issue 1 year ago • 9 comments

update libkdtree to last version

mosfet80 avatar Nov 22 '24 15:11 mosfet80

How about using a submodule for this instead? That way:

  • we can more easily update it in the future
  • more secure updates, this update is so big that it is difficult to review that no malicious code has been added

hyarion avatar Nov 23 '24 00:11 hyarion

@wwmayer what do you think about migrating to a submodule, as @hyarion suggests?

chennes avatar Nov 26 '24 16:11 chennes

we can more easily update it in the future

Sure.

more secure updates, this update is so big that it is difficult to review that no malicious code has been added

It's not really big. Most of the PR is about to put the automake stuff back that we will never use. The only change actually is to re-enable the copy constructor of the iterator class.

The copy constructor once has been disabled with 3883ef3a30bb5e because it caused some compiler warnings in the mesh module. So, when we make this a sub-module is there a way to apply a patch to disable the copy constructor again?

wwmayer avatar Nov 27 '24 10:11 wwmayer

So, when we make this a sub-module is there a way to apply a patch to disable the copy constructor again?

As far as I know, you can't apply local patches directly to submodules. Instead, the process would look like this:

  • Fork the libkdtree repository to create a FreeCAD/libkdtree repository.
  • Apply your local patch(es) in the FreeCAD/libkdtree fork.
  • Use the FreeCAD/libkdtree fork as the submodule in your FreeCAD repository.

When you want to pull in changes from the original libkdtree repository, the process is as follows:

  • In the FreeCAD/libkdtree fork, pull changes from the upstream repository and either merge them into or rebase your local patches onto the updated code.
  • Push the updated fork, including your patches, to the FreeCAD/libkdtree repository.
  • In the FreeCAD repository, update the submodule to point to the latest commit in your FreeCAD/libkdtree fork.

hyarion avatar Nov 27 '24 13:11 hyarion

@mosfet80 ping for feedback

maxwxyz avatar Dec 02 '24 06:12 maxwxyz

btw, git-subtree is an alternative to submodules that might also work in this case

hyarion avatar Dec 02 '24 09:12 hyarion

@mosfet80 ping

maxwxyz avatar Dec 06 '24 06:12 maxwxyz

bump

maxwxyz avatar Dec 08 '24 19:12 maxwxyz

I agree with @hyarion that using git subtree is probably a better approach here (and likely elsewhere, but that is a discussion for another day). Then we can just make a commit on top of the subtree that disables the problematic copy constructor.

chennes avatar Dec 08 '24 20:12 chennes

Any feedback here @mosfet80 ?

PaddleStroke avatar Dec 13 '24 12:12 PaddleStroke

@mosfet80 FYI

maxwxyz avatar Jan 08 '25 07:01 maxwxyz

@mosfet80 FYI

    This week i switch libkdtree to a freecad submodule

mosfet80 avatar Jan 09 '25 15:01 mosfet80

@mosfet80 sorry for asking, but what was the reason to close this PR?

hyarion avatar Jan 14 '25 10:01 hyarion

We decided on subtree, rather than submodule, didn't we?

chennes avatar Jan 14 '25 14:01 chennes