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

[vulkan-validationlayers] Fix discovery of libVkLayer_khronos_validation #19606

Conversation

samuel-emrys
Copy link
Contributor

@samuel-emrys samuel-emrys commented Sep 5, 2023

Please read #19605 for a full description of the bug this PR solves

Add libdirs to the runtime lib discovery path to enable libVlLayer_khronos_validation.{so,dll,dylib} to be discovered appropriately at runtime. This package exports both a static library and a shared library, of which, only the static library should be linked against. The shared library is loaded dynamically by vulkan-loader, and still needs to be discoverable. Because this is not a shared library, these paths are not exported automatically and therefore are required to be explicitly set.

I felt that option 1 was the most desirable solution here because:

  • It doesn't introduce the unwanted semantics that setting package_type="shared-library" would have, and potential complications when people actually want to use this only as the static library that it is. Particularly as this relates to the difference in package_id implications
  • It doesn't impose requirements on the user to depend on this library differently by manually specifying run=True in the requires() call
  • It doesn't require patching of artifacts

Additional discussion available in https://cpplang.slack.com/archives/C41CWV9HA/p1693906666122339

Closes #19605


* Add libdirs to the runtime lib discovery path to enable
  libVlLayer_khronos_validation.{so,dll,dylib} to be discovered
  appropriately at runtime. This package exports both a static library
  and a shared library, of which, only the static library should be
  linked against. The shared library is loaded dynamically by
  vulkan-loader, and still needs to be discoverable. Because this is not
  a shared library, these paths are not exported automatically and
  therefore are required to be explicitly set.

Closes conan-io#19605
@samuel-emrys
Copy link
Contributor Author

// cc @ericLemanissier @SpaceIm

@conan-center-bot

This comment has been minimized.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 5, 2023

Hooks produced the following warnings for commit 9353b84
vulkan-validationlayers/1.3.239.0@#27caa1728c64d78e642a3a14eb92453c
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libVkLayer_khronos_validation.dylib
vulkan-validationlayers/1.3.236.0@#1e3692580ab87d25eb3fb49835d65cca
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libVkLayer_khronos_validation.dylib

Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com>
@conan-center-bot

This comment has been minimized.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 8, 2023

Hooks produced the following warnings for commit 0091dbe
vulkan-validationlayers/1.3.239.0@#3262f83f79381c7f3b170f6afe604069
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libVkLayer_khronos_validation.dylib
vulkan-validationlayers/1.3.236.0@#32fc5b2d87b522dad4e5db2c250399f9
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libVkLayer_khronos_validation.dylib

@samuel-emrys
Copy link
Contributor Author

@RubenRBS how's this one going? Last update you provided you were going to check with the team that this was the best way forward

Copy link
Member

@AbrilRBS AbrilRBS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for your patience. After looking into it with the team, we've seen that while Conan lacks some built-in support for cases like these (See conan-io/conan#15216 for tracking), this PR is correct :)

@valgur
Copy link
Contributor

valgur commented Dec 5, 2023

IMO, since the vulkan-validationlayers more-or-less packages only a runtime library (i.e. a plugin), the package_type would be more accurate and useful as application. It sets the self.requires() defaults for the package more appropriately as headers=False, libs=False, run=True (https://docs.conan.io/2.0/reference/conanfile/methods/requirements.html#package-type-trait-inferring).

See also #21495. The static utility library together with its headers has been removed in the latest versions and only the runtime one remains.

@conan-center-bot

This comment has been minimized.

@samuel-emrys
Copy link
Contributor Author

IMO, since the vulkan-validationlayers more-or-less packages only a runtime library (i.e. a plugin), the package_type would be more accurate and useful as application. It sets the self.requires() defaults for the package more appropriately as headers=False, libs=False, run=True (https://docs.conan.io/2.0/reference/conanfile/methods/requirements.html#package-type-trait-inferring).\n\nSee also #21495. The static utility library together with its headers has been removed in the latest versions and only the runtime one remains.

A couple of points:

  1. I think that despite the fact that application package type may set the correct traits, it's semantically confusing - this isn't an application, so we shouldn't call it such - my preference would be to improve the model that Conan has for handling plugins rather than using application to avoid confusion. My read is that this is the goal of [question] traits propagaton for static library that has runtime loaded plugins conan#15216.
  2. Current versions of this library require static lib support. Suggest any improvements to handle newer versions are better placed in additional PRs

@conan-center-bot conan-center-bot added Failed Missing dependencies Build failed due missing dependencies in Conan Center labels Dec 5, 2023
@conan-center-bot

This comment has been minimized.

Copy link
Contributor

github-actions bot commented Dec 5, 2023

Hooks produced the following warnings for commit 836f103
vulkan-validationlayers/1.3.239.0@#badb48246ad9137d129e1ca51cd51fba
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libVkLayer_khronos_validation.dylib
vulkan-validationlayers/1.3.236.0@#57c74f0cd23ae14df0b425d1f0c2db15
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libVkLayer_khronos_validation.dylib

@conan-center-bot

This comment has been minimized.

@samuel-emrys
Copy link
Contributor Author

@RubenRBS @franramirez688 could either of you trigger a build of the necessary spirv-tools binary?

@AbrilRBS
Copy link
Member

I triggered the build this morning, it's progressing nicely now, I'll relaunch the PR once it's done, thanks a lot for your patience

@conan-center-bot conan-center-bot removed Unexpected Error Failed Missing dependencies Build failed due missing dependencies in Conan Center labels Dec 21, 2023
@conan-center-bot
Copy link
Collaborator

Conan v1 pipeline ✔️

All green in build 7 (dd1fe23b2072c4ce4ca0bbee2323a5a17ca4bce4):

  • vulkan-validationlayers/1.3.239.0:
    All packages built successfully! (All logs)

  • vulkan-validationlayers/1.3.236.0:
    All packages built successfully! (All logs)

  • vulkan-validationlayers/1.3.231.1:
    All packages built successfully! (All logs)

  • vulkan-validationlayers/1.3.211.0:
    All packages built successfully! (All logs)

  • vulkan-validationlayers/1.3.216.0:
    All packages built successfully! (All logs)

  • vulkan-validationlayers/1.3.224.1:
    All packages built successfully! (All logs)


Conan v2 pipeline ✔️

Note: Conan v2 builds are now mandatory. Please read our discussion about it.

All green in build 6 (dd1fe23b2072c4ce4ca0bbee2323a5a17ca4bce4):

  • vulkan-validationlayers/1.3.239.0:
    All packages built successfully! (All logs)

  • vulkan-validationlayers/1.3.236.0:
    All packages built successfully! (All logs)

  • vulkan-validationlayers/1.3.231.1:
    All packages built successfully! (All logs)

  • vulkan-validationlayers/1.3.216.0:
    All packages built successfully! (All logs)

  • vulkan-validationlayers/1.3.224.1:
    All packages built successfully! (All logs)

  • vulkan-validationlayers/1.3.211.0:
    All packages built successfully! (All logs)

@conan-center-bot conan-center-bot merged commit ee18955 into conan-io:master Dec 21, 2023
43 checks passed
@AbrilRBS
Copy link
Member

Sorry that it took so long to get this merged after approval, my bad on that one, thanks a lot for your patience :)

valgur pushed a commit to valgur/conan-center-index that referenced this pull request Jan 1, 2024
…r_khronos_validation

* [vulkan-validationlayers] Fix discovery of libVkLayer_khronos_validation

* Add libdirs to the runtime lib discovery path to enable
  libVlLayer_khronos_validation.{so,dll,dylib} to be discovered
  appropriately at runtime. This package exports both a static library
  and a shared library, of which, only the static library should be
  linked against. The shared library is loaded dynamically by
  vulkan-loader, and still needs to be discoverable. Because this is not
  a shared library, these paths are not exported automatically and
  therefore are required to be explicitly set.

Closes conan-io#19605

* Remove notification of runtime_lib_discovery_path update

Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com>

---------

Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com>
Co-authored-by: Rubén Rincón Blanco <rubenrb@jfrog.com>
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

Successfully merging this pull request may close these issues.

[bug] vulkan-validationlayers/1.3.239.0: Cannot load libVkLayer_khronos_validation.so at runtime
9 participants