Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: SOVERSION check in package_contents #1217

Open
minrk opened this issue Nov 26, 2024 · 0 comments
Open

feature request: SOVERSION check in package_contents #1217

minrk opened this issue Nov 26, 2024 · 0 comments

Comments

@minrk
Copy link
Contributor

minrk commented Nov 26, 2024

I have a reason in a recipe to make sure the versioned library files are present as expected. (i.e. libfoo.dylib, libfoo.1.dylib, libfoo.1.2.3.dylib)

This can be done in a script, which isn't too bad, but it's a little tedious because the ordering of SHLIB_EXT and SOVERSION are different on linux/mac:

tests:
  - script:
      - if: osx
        - test -f $PREFIX/lib/libfoo.$(echo ${PKG_VERSION} | cut -d. -f1 )${SHLIB_EXT}
        - test -f $PREFIX/lib/libfoo.${PKG_VERSION}${SHLIB_EXT}
      - if: linux
        - test -f $PREFIX/lib/libfoo${SHLIB_EXT}.$(echo ${PKG_VERSION} | cut -d. -f1 )
        - test -f $PREFIX/lib/libfoo${SHLIB_EXT}.${PKG_VERSION}

but it would be awesome if package_contents.lib understood this, so I could have something like:

ouputs:
  - package:
      name: libsomething
      version: 1.2.3 # different from recipe version
    tests:
      - package_contents:
          lib:
          - name: foo
            so_version:
              # I don't actually know what variable is available for the output version; can outputs have their own `context`?
              - ${{ output_version }} # libfoo.1.2.3.dylib
              - ${{ output_version | major_version }} # libfoo.1.dylib

that does the right thing (including ignoring the version on Windows, I think). Double bonus points if I could also assert that install_name / soname points to a specific version (libfoo.X.dylib / libfoo.so.X) because it is a common mistake in libraries to do this wrong, and relevant to the validation of pinning in run_exports (e.g. if install_name is libfoo.1.2.3.dylib, run_exports pinning must set max_pin=x.x.x as max_pin='x' will result in broken packages with 'library not found' when 1.2.4 is released).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant