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

Extended search #35

Closed
wants to merge 2 commits into from
Closed

Extended search #35

wants to merge 2 commits into from

Conversation

hboutemy
Copy link
Collaborator

Extended search in library.$name.path to do the same as in META-INF/native:
this will enable scenario where a distribution extracts native libraries to avoid temp file creation if the lib auto-extracts on each run
see https://issues.apache.org/jira/browse/MNG-6186 for a use case in Maven

* <ol>
* <li> as "<code>${name}-${version}</code>" library name if the version can be determined.
* <li> as "<code>${name}</code>" library name
* </ol>
* <li> system library path: This is where the JVM looks for JNI libraries by default.
* <ol>
* <li> as "<code>${name}${bit-model}-${version}</code>" library name if the version can be determined.
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did you add that? System library path (LD_LIBRARY_PATH, rpath) will unlikely contain the bit model. It looks unnecessary to me.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

why did I add to documentation what was done in code?

Copy link
Contributor

Choose a reason for hiding this comment

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

Then this is OK, assumed you have changed the code too. It's an unrelated change though.

* <li> as "<code>${name}-${version}</code>" library name if the version can be determined.
* <li> as "<code>${name}</code>" library name
* </ol>
* <li> classpath path: If the JNI library can be found on the classpath, it will get extracted
* and then loaded. This way you can embed your JNI libraries into your packaged JAR files.
* They are looked up as resources in this order:
* <ol>
* <li> "<code>META-INF/native/${platform}/${arch}/${library}</code>": Store your library here if you want to embed
* <li> "<code>META-INF/native/${platform}/${arch}/${library[-version]}</code>": Store your library here if you want to embed
Copy link
Contributor

Choose a reason for hiding this comment

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

How is this version necessary for our usecase? Especially because only one version of the native library should exist once in the classpath OR the JAR from central contains its version anyway.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

once again, I'm not judging anything: I'm just keeping existing features, even if I never used it myself

Copy link
Contributor

Choose a reason for hiding this comment

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

Same here.

@michael-o
Copy link
Contributor

Looks good to me after review.

@gnodet
Copy link
Member

gnodet commented Apr 26, 2017

Could you rebase your PR please ?


if( customPath!=null ) {
// Try to extract it to the custom path...
File target = extract(errors, resource, prefix, suffix, file(customPath));
File target = extracttoTmpFile(errors, resource, tmpFilePrefix, tmpFileSuffix, file(customPath));
Copy link
Contributor

Choose a reason for hiding this comment

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

extractToTmpFile?

@@ -240,7 +284,7 @@ private boolean extractAndLoad(ArrayList<String> errors, String version, String

// Fall back to extracting to the tmp dir
customPath = System.getProperty("java.io.tmpdir");
File target = extract(errors, resource, prefix, suffix, file(customPath));
File target = extracttoTmpFile(errors, resource, tmpFilePrefix, tmpFileSuffix, file(customPath));
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here.

* <ol>
* <li> as "<code>${name}-${version}</code>" library name if the version can be determined.
* <li> as "<code>${name}</code>" library name
* </ol>
* <li> system library path: This is where the JVM looks for JNI libraries by default.
* <ol>
* <li> as "<code>${name}${bit-model}-${version}</code>" library name if the version can be determined.
Copy link
Contributor

Choose a reason for hiding this comment

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

Then this is OK, assumed you have changed the code too. It's an unrelated change though.

* <li> as "<code>${name}-${version}</code>" library name if the version can be determined.
* <li> as "<code>${name}</code>" library name
* </ol>
* <li> classpath path: If the JNI library can be found on the classpath, it will get extracted
* and then loaded. This way you can embed your JNI libraries into your packaged JAR files.
* They are looked up as resources in this order:
* <ol>
* <li> "<code>META-INF/native/${platform}/${arch}/${library}</code>": Store your library here if you want to embed
* <li> "<code>META-INF/native/${platform}/${arch}/${library[-version]}</code>": Store your library here if you want to embed
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here.

@gnodet
Copy link
Member

gnodet commented Apr 27, 2017

Manually merged.

@gnodet gnodet closed this Apr 27, 2017
@hboutemy hboutemy deleted the extended-search branch April 27, 2017 23:59
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.

3 participants