prefix-dev / rattler-build

rattler-build is a universal package builder for Windows, macOS and Linux
https://prefix-dev.github.io/rattler-build
BSD 3-Clause "New" or "Revised" License
224 stars 50 forks source link

Content test: windows dll / lib with ABI version #1116

Open wolfv opened 1 month ago

wolfv commented 1 month ago

The openjph package installs dll / lib files with a ABI version like foo.0.17.dll and foo.0.17.lib.

 │ │   - Library\bin\openjph.0.17.dll
...
 │ │   - Library\lib\openjph.0.17.lib

Should we support that?

wolfv commented 1 month ago

https://github.com/conda-forge/staged-recipes/pull/25772#issuecomment-2409033956

wolfv commented 1 month ago

Isuru pointed out on Element:

A common pattern is foo.lib and foo.0.17.dll which are equivalent to libfoo.so and libfoo.so.0.17 in linux

Another common pattern from GMP:

https://github.com/conda-forge/gmp-feedstock/blob/6f7078d255019fadadb8081a8c51bd5829231f8b/recipe/meta.yaml#L45-L54

    - test ! -f ${PREFIX}/lib/libgmp.a      # [unix]
    - test -f ${PREFIX}/lib/libgmp.dylib    # [osx]
    - test -f ${PREFIX}/lib/libgmp.so       # [linux]
    - test ! -f ${PREFIX}/lib/libgmpxx.a    # [unix]
    - test -f ${PREFIX}/lib/libgmpxx.dylib  # [osx]
    - test -f ${PREFIX}/lib/libgmpxx.so     # [linux]
    - if not exist %LIBRARY_BIN%\libgmp-10.dll exit 1  # [win]
    - if not exist %LIBRARY_LIB%\libgmp.dll.a exit 1   # [win]
    - if not exist %LIBRARY_LIB%\gmp.lib exit 1        # [win]
hmaarrfk commented 1 month ago

but is it common to have the lib file with these .0.0.17? i don't think so right?

JeanChristopheMorinPerso commented 1 month ago

I'd say that most of the time there is no version in the .lib filename. When there is a version, it's usually in the form mylib-2.lib.

hmaarrfk commented 1 month ago

FWI, i patched out the "lib" in the offending project and requested input from upstream https://github.com/aous72/OpenJPH/issues/155

wolfv commented 1 month ago

@jaimergp can we use your tool to run a query for the names of all *.dll and *.lib files in the conda-forge universe?

I am not sure if enforcing a naming rule makes a lot of sense. I imagine that, if the CMake find_package works correctly, things will be found no-matter-what their name ends up.

So we could also change the regex to something like foo*.dll and foo*.lib ...

jaimergp commented 1 month ago

can we use your tool to run a query for the names of all .dll and .lib files in the conda-forge universe?

The sqlite dumps are downloadable for this kind of large query that wouldn't be efficient in a public server. Some links: