Comments (9)
Hey,
JDime uses JNativeMerge under the hood to implement linebased merging via the libgit2 native library. This library ('libgit2.dylib' on MacOS) needs to be provided to the JVM. JNativeMerge includes the native library for Windows and Unix but we don't have any MacOS devices and therefore it doesn't for MacOS.
You need to compile or download libgit2 for MacOS and make it available to JNA (which is used by JNativeMerge for native library access). Read this tutorial (below the first code block) for how to do that.
Make sure that you use version 0.28.XX of libgit2, that's the only one we test with.
Best,
Georg
from jdime.
Hi Georg, and thanks a lot for your fast response.
I got it to work thank to your tutorial. I don't know why but I had no success with jna.library.path
or with DYLD_LIBRARY_PATH
, but I had more luck by:
- Modifying the path in
build/install/JDime/bin/JDime
shell script to include$APP_HOME/lib
- Add a link to libgit2.dylib in
build/install/JDime/lib/darwin
from jdime.
That's good to hear. I had a look at the JNativeMerge source code and it seems that I enforced loading the library from the classpath (instead of other locations that one might specify via the properties you mentioned). I think that is because this way it's a lot harder to use an invalid version of the library.
Your modifications will only survive until the next time you rebuild JDime. Here is how to include an arbitrary library in the .jar file generated for JNativeMerge (and thereby the classpath).
- Clone JNativeMerge (under exactly this name) as a sibling directory of the JDime directory
- Set
JNM_MAVEN=false
inJDime/gradle.properties
- Set
jnativemerge.libgit2.path=<Absolute Path to Library>
inJNativeMerge/gradle.properties
- Run
./gradlew test
in the JNativeMerge directory to test whether the library was correctly included - Run
./gradlew installDist
in the JDime directory to build JDime
This should work with the develop branch of JDime.
from jdime.
Hi Georg and thanks for the tip!
Quick question, wouldn't it be possible for JNativeMerge to try to load first the library from the resource classpath and only if it does not found it, try loading it from the system path (that implies removing the System.setProperty("jna.nosys", "true");
)? This way it would be the best of both worlds. I have tried to look for examples, I am not sure it can be done though.
from jdime.
Hey,
please apply the following patch to your build.gradle
:
diff --git a/build.gradle b/build.gradle
index da729b05..a0165214 100644
--- a/build.gradle
+++ b/build.gradle
@@ -87,7 +87,7 @@ dependencies {
implementation 'de.uni-passau.fim.seibt:kvconfig:1.0'
if (project.ext.JNM_MAVEN.toBoolean()) {
- implementation 'de.uni_passau.fim.seibt:jnativemerge:0.28.1_3'
+ implementation 'de.uni_passau.fim.seibt:jnativemerge-snapshot:95708997'
} else {
implementation project(':JNativeMerge')
}
Also set JNM_MAVEN=false
and rebuild JDime. You should be able to use the JVM property jnativemerge.syslib_fallback=true
to have JNativeMerge check the other JNA locations as a fallback. You can pass JVM Options through the JDime start script (that is generated by Gradle) using the environment variable JAVA_OPTS
.
Best,
Georg
from jdime.
Hi!
Thanks a lot, it's awesome!
Unfortunately, but I do not get it to work. When you mean rebuilt you mean gradle build followed by gradle installDist on the develop branch right? Maybe I should not set JNM_MAVEN to false, since I need to download the dependency from maven according to your patch?
from jdime.
(for info, I set JAVA_OPTS this way : set JAVA_OPTS "-Djnativemerge.syslib_fallback=true -Djna.library.path=/usr/local/lib"
)
from jdime.
Oh sorry, I meant JNM_MAVEN=true
. That will cause the buildscript to download JNativeMerge as a Maven package instead of including the Gradle build directly. The snapshot version of JNativeMerge that I published should have the functionality you suggested.
Rebuilding would be ./gradlew clean installDist
. The clean
task should not be required even...
from jdime.
OK still no luck with JNM_MAVEN=true
. I have looked in the build/install/JDime/lib
folder and I have the correct library jnativemerge-snapshot-95708997.jar
. Maybe there is a typo on the name of the property?
from jdime.
Related Issues (17)
- Travis file contains non-whitelist packages. HOT 1
- Superfluous blank line after methods in semistructured mode
- Combined strategy reports whitespace conflict
- [develop] Dependency to libgit2 is needed HOT 1
- Incorrect Handling of Insertion / Deletion Conflicts between Files HOT 15
- Cleanup Logging to Provide Helpful Output on Level <= FINE
- Update README & documentation
- output option HOT 3
- Infinite loop at Unordered Merge HOT 2
- Error on running Auto tuning HOT 2
- Nway throws a null pointer exception every time
- Linebased conflicts are ignored on some systems (related to libgit2 version) HOT 1
- JDime does not build under Java 8 or Java 11 HOT 4
- JDime script does not work HOT 2
- License HOT 2
- JDime crashes without output HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jdime.