Open h-vetinari opened 1 year ago
Fortunatly it seems that there is support for building the python bindings on their own, see https://github.com/opencv/opencv/blob/af03e000c7efc29544d964c4601f0269c2c8950b/modules/python/CMakeLists.txt#L38 , so hopefully this does not require a lot of changes at the CMake level.
At the time of writing the recipe, it was pretty hard with conda machinery to make the recipe reuse a certain portion of itself.
For more historical details, see the comment in the recipe.
Improvements are always welcome!
Personally, i think it might be a good way to reduce the build matrix.
I've started on a branch, but looking at the logic Silvio linked, the standalone builds really want to find a file we're not currently shipping, and building that file with the libopencv
looks like it might be persisting a bit more than I'd like, aside from the also annoying issue that then the python-less lib still needs a python to build. Haven't followed this thread to its conclusion yet.
It might be easiest to patch that file a bit so the bindings get built with python itself. That would IMO be a much saner model than (how I currently understand) standalone.cmake
, which also hasn't been touched in ~4 years.
Looking at the content of
libopencv
, it's essentially completely free of python, with the sole exception of:It should be possible to build
libopencv
once, then base the various python builds on top of that (which would then contain the stuff in$SP_DIR
like the abovecv2.<abi-tag>.so
). This would also have the benefit of dividing our build matrix by ~6, as we're now looking at 136(!!!) jobs in #363.We could also split off the binaries under some output-name. This is getting to be the "gold standard" as far as I understood the various discussions around this (can provide references if desired) and is being used in a few feedstocks (that do lib+bins[+py]) like thrift-cpp, sentencepiece, and probably a bunch more that I'm not familiar with.