zipper icon indicating copy to clipboard operation
zipper copied to clipboard

Migrating `libCombine` to zipper 3.x

Open LecrisUT opened this issue 7 months ago • 9 comments

In order to update zipper package in Fedora to use this version, I need to update the dependents, which afaict is only libCombine. I have got some pieces figured out, but then I was hit with

/builddir/build/BUILD/libCombine-0.2.20-build/libCombine-0.2.20/src/combine/combinearchive.cpp:301:31: error: ‘class zipper::Unzipper’ has no member named ‘extractEntryToStream’
  301 |     bool result = mpUnzipper->extractEntryToStream(filename, tempStream);

The symbol is there, but apparently it is not exported to the header file. https://github.com/Lecrapouille/zipper/blob/3938d0a5bd611997f1e9ac12fbf8ee90a6ce9499/src/Unzipper.cpp#L873-L874

Can you offer some assistance for such a transition?

LecrisUT avatar Jul 18 '25 19:07 LecrisUT

https://github.com/LecrisUT/libCombine/tree/zipper-3.0 is my WIP

LecrisUT avatar Jul 18 '25 20:07 LecrisUT

@LecrisUT Ok I'll give a look. I'm currently testing CMake I'll commit all tickets soon.

Lecrapouille avatar Jul 18 '25 20:07 Lecrapouille

@LecrisUT By the way, why not using the my makefile ? It can now create RPM

Lecrapouille avatar Jul 18 '25 20:07 Lecrapouille

@LecrisUT By the way, why not using the my makefile ? It can now create RPM

When creating the RPMs in Fedora, we have to do our own changes, and the build process is continuously being optimized for cmake, meson, etc. support, but not for Makefile because those are not standardized. If the makefile is used to compile the code instead of CMake, there are numerous other problems.

LecrisUT avatar Jul 18 '25 20:07 LecrisUT

Hum ! Ok let's talk about MyMakefile later. I just committed fixes concerning to your other issues. I'll investigate this one. My fork have API changed.

Lecrapouille avatar Jul 18 '25 20:07 Lecrapouille

@LecrisUT I've not tried yet to compile but the new new name is simply extract

Lecrapouille avatar Jul 18 '25 20:07 Lecrapouille

Ok, I think I got the interface all re-mapped and everything compiled. But the testsuite is failing, so I hope I can leave it to you

LecrisUT avatar Jul 18 '25 22:07 LecrisUT

I cannot compile libcombine

cmake .. -DLIBSBML_INCLUDE_DIR=/usr/local/include -DLIBNUML_INCLUDE_DIR=/usr/local/include
make

I have issues with linker bzfilebuf, LibXMLParser I have libxml2 already installed. I did not understand about EXTRA_LIBS=xml2;bz2;z;iconv

Lecrapouille avatar Jul 20 '25 08:07 Lecrapouille

Yes, there are a lot of weird incompatibility issues in their build-system. I will report them later. For now, you can use the following as a reproducer

FROM fedora:latest

# Basic build tools and compilers
RUN dnf install -y \
    cmake ninja-build git \
    gcc-c++

# libCombine dependencies

RUN dnf install -y \
    libsbml-devel bzip2-devel libxml2-devel

# Get the projects
RUN <<EOR
mkdir /projects
pushd /projects

# Do not recurse-submodules libCombine. They are doing some weird stuff with that
git clone \
  -b zipper-3.0 \
  https://github.com/LecrisUT/libCombine
git clone \
  -b cmake/modern --recurse-submodules \
  https://github.com/LecrisUT/zipper
EOR

WORKDIR /projects

# Handle a few quirks tha need to be resolved in libCombine upsream
RUN <<EOR
# sbml-config and libxml packages need patching
# Enable C needed by FindLIBXML.cmake
sed -i "s/LANGUAGES CXX)/LANGUAGES C CXX)/" libCombine/CMakeLists.txt

# sbml is linking to minizip also. Use the version that it was installed with
dnf install -y minizip-ng-compat-devel
EOR

# Configure and build the projects
RUN <<EOR
# Use the bundled minizip in zipper because it is otherwise incompatible
cmake -G Ninja -S zipper -B build-zipper \
  -DZIPPER_SHARED_LIB:BOOL=ON \
  -DZIPPER_BUILD_TESTS:BOOL=ON \
  -DCMAKE_DISABLE_FIND_PACKAGE_minizip:BOOL=ON

cmake -G Ninja -S libCombine -B build-libCombine \
  -DLIBSBML_SHARED:BOOL=ON \
  -DCMAKE_REQUIRE_FIND_PACKAGE_sbml:BOOL=ON \
  -Dsbml_DIR:PATH=/usr/lib64/cmake \
  -Dzipper_ROOT:PATH=$(pwd)/build-zipper

cmake --build build-zipper
cmake --build build-libCombine
EOR

If you need a primer on how to build and enter the container

$ podman build -t debug:libCombine -f Dockerfile
$ podman run -ti debug:libCombine
[root@b33379179da2 projects]# ctest --test-dir build-libCombine --output-on-failure

LecrisUT avatar Jul 20 '25 11:07 LecrisUT