#1296 introduced "fat-jars": jars with embedded native dependencies.
In order for them to work, a OptionalNativeDependencyLoader, which extracts the dependencies to a tmp folder and loads them in reverse order, is introduced.
OptionalNativeDependencyLoader is invoked inside JDKProvider, before any native cuvs functions is invoked from Java, to preemptively load the native libraries from the desired binaries.
In parallel, in #1316 we are trying to do something similar/related: we try to load in the "regular" way libcuvs, to see if the load fails; if it does, we switch to the UnsupportedProvider to give users a meaningful and precise error message. Very similarly, this is done inside JDKProvider, before any native cuvs functions is invoked in Java.
We should come up with a unified mechanism, where OptionalNativeDependencyLoader tries to load the native library (libraries) in different ways based on whether we are in a fat-jar or slim-jar, to give users precise error messages for the 2 different cases.
#1296 introduced "fat-jars": jars with embedded native dependencies.
In order for them to work, a
OptionalNativeDependencyLoader, which extracts the dependencies to a tmp folder and loads them in reverse order, is introduced.OptionalNativeDependencyLoaderis invoked insideJDKProvider, before any native cuvs functions is invoked from Java, to preemptively load the native libraries from the desired binaries.In parallel, in #1316 we are trying to do something similar/related: we try to load in the "regular" way
libcuvs, to see if the load fails; if it does, we switch to theUnsupportedProviderto give users a meaningful and precise error message. Very similarly, this is done insideJDKProvider, before any native cuvs functions is invoked in Java.We should come up with a unified mechanism, where
OptionalNativeDependencyLoadertries to load the native library (libraries) in different ways based on whether we are in a fat-jar or slim-jar, to give users precise error messages for the 2 different cases.