-
Notifications
You must be signed in to change notification settings - Fork 49
Rename folder with native binaries from 'lib' to 'lib-native' #290
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
Conversation
|
I will check the library loading in besu with these changes. TBH we have not seen any gradle packaging problems across modules, so this is news to me. I hadn't seen #274 until this morning. |
|
There is another issue when loading on the module path. This code leads to the attempt to find a resource that is in another Module:
The loading is later attempted via I am not sure if the code is correct in general. Is it correct that the
|
0ef1b17 to
12492c9
Compare
12492c9 to
c6f6b3a
Compare
|
Hello besu-native team! |
|
@lu-pinto @macfarla @garyschulte Is there anyway we can bump this PR, and give it priority? |
A folder with a '-' is not considered a package by Java and is then allowed to exist in multiple Jars without causing a split-package issue. Signed-off-by: Jendrik Johannes <jendrik@onepiece.software>
When running on the --module-path, the native lib resource is only accessible from within the module if it is not located a folder that represents an explicitly exported java package. Signed-off-by: Jendrik Johannes <jendrik@onepiece.software>
dfb79f9 to
ceb4d8a
Compare
| try { | ||
| final Optional<Path> libPath = extract(jnaClass, libraryName); | ||
| String moduleContextClassName = Thread.currentThread().getStackTrace()[2].getClassName(); | ||
| Class<?> moduleContextClass = Class.forName(moduleContextClassName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This requires the method registerJNA to be called directly from a Class inside the Module that contains the native lib file to be loaded. This is currently the case for all besu native modules.
A more explicit solution would be to add another Class argument to the method. More details:
#290 (comment)
This requires additional patching of the besu-native Jars, to integrate the fixes in hyperledger/besu-native#290 until they are released upstream. Signed-off-by: Jendrik Johannes <jendrik@onepiece.software>
This requires additional patching of the besu-native Jars, to integrate the fixes in hyperledger/besu-native#290 until they are released upstream. Signed-off-by: Jendrik Johannes <jendrik@onepiece.software>
This requires additional patching of the besu-native Jars, to integrate the fixes in hyperledger/besu-native#290 until they are released upstream. Signed-off-by: Jendrik Johannes <jendrik@onepiece.software>
garyschulte
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It wasn't obvious to me why this was needed, because besu is using classpath instead of module path. In the context of module-path deps, this change makes sense, and the '-' fix is a nice workaround.
I built locally and confirmed it works without any changes required in besu main, LGTM.
This requires additional patching of the besu-native Jars, to integrate the fixes in hyperledger/besu-native#290 until they are released upstream. Signed-off-by: Jendrik Johannes <jendrik@onepiece.software>
A folder with a
-in its name is not considered a package by Java and is then allowed to exist in multiple Jars without causing a split-package issue. See description of #274 for a detailed explanation.Fixes #274