Re: How to replace eclipse compiler in libsis-jhdf5-java

2018-09-20 Thread Andreas Tille
Hi again,

On Wed, Sep 19, 2018 at 11:29:20PM +0200, Emmanuel Bourg wrote:
> Le 19/09/2018 à 22:17, Andreas Tille a écrit :
> 
> > isn't doing the job.  How to use jaxb properly?
> 
> Did you also change the import statement in HDFHelper.java? The package
> is slightly different. com.sun.xml.internal.bind.v2.runtime becomes
> com.sun.xml.bind.v2.runtime.

After this patch

   
https://salsa.debian.org/med-team/libsis-jhdf5-java/commit/db984822e24beaa5ac4318c40630644ef5800a04

I get

...
All input files are considered out-of-date for incremental task ':compileJava'.
Compiling with Java command line compiler 'java'.
Starting process 'command 'java''. Working directory: 
/build/libsis-jhdf5-java-18.09.0-pre1+dfsg Command: java -cp 
/usr/share/java/ecj.jar org.eclipse.jdt.internal.compiler.batch.Main -nowarn 
@/build/libsis-jhd
Successfully started process 'command 'java''
--
1. ERROR in 
/build/libsis-jhdf5-java-18.09.0-pre1+dfsg/source/java/ch/systemsx/cisd/hdf5/hdf5lib/HDFHelper.java
 (at line 35)
import com.sun.xml.bind.v2.runtime.Name;
   
The import com.sun.xml.bind cannot be resolved
--
1 problem (1 error)
:compileJava FAILED
:compileJava (Thread[Task worker for ':',5,main]) completed. Took 5.328 secs.

 

Seems I did not fully implemented your suggestion.

Thanks a lot for your help and patience

   Andreas.

-- 
http://fam-tille.de



Re: How to replace eclipse compiler in libsis-jhdf5-java

2018-09-20 Thread Emmanuel Bourg
Le 20/09/2018 à 08:48, Andreas Tille a écrit :

> I get
> 
> ...
> All input files are considered out-of-date for incremental task 
> ':compileJava'.
> Compiling with Java command line compiler 'java'.
> Starting process 'command 'java''. Working directory: 
> /build/libsis-jhdf5-java-18.09.0-pre1+dfsg Command: java -cp 
> /usr/share/java/ecj.jar org.eclipse.jdt.internal.compiler.batch.Main -nowarn 
> @/build/libsis-jhd
> Successfully started process 'command 'java''
> --
> 1. ERROR in 
> /build/libsis-jhdf5-java-18.09.0-pre1+dfsg/source/java/ch/systemsx/cisd/hdf5/hdf5lib/HDFHelper.java
>  (at line 35)
>   import com.sun.xml.bind.v2.runtime.Name;
>  
> The import com.sun.xml.bind cannot be resolved

Somehow jaxb is not on the compilation classpath. I'm not familiar
enough with the jhdf5 build to spot the error. Maybe you have to add the
jar in libs/prod or libs/build? (the jar files in these directories
should be removed btw).

Emmanuel Bourg



Re: How to replace eclipse compiler in libsis-jhdf5-java

2018-09-20 Thread Andreas Tille
Hi Emmanuel,

On Thu, Sep 20, 2018 at 12:46:18PM +0200, Emmanuel Bourg wrote:
> Le 20/09/2018 à 08:48, Andreas Tille a écrit :
> > The import com.sun.xml.bind cannot be resolved
> 
> Somehow jaxb is not on the compilation classpath. I'm not familiar
> enough with the jhdf5 build to spot the error. Maybe you have to add the
> jar in libs/prod or libs/build? (the jar files in these directories
> should be removed btw).

For sure the jar files should be deleted.  Just an oversight which is fixed
now.  Thanks for spotting.

I tried to follow your hint via

 $ git diff
diff --git a/debian/patches/use_debian_packaged_libs.patch 
b/debian/patches/use_debian_packaged_libs.patch
index 4621e64..2cab95f 100644
--- a/debian/patches/use_debian_packaged_libs.patch
+++ b/debian/patches/use_debian_packaged_libs.patch
@@ -42,3 +42,16 @@
  }
  
  compileJava {
+--- a/build.gradle
 b/build.gradle
+@@ -3,8 +3,8 @@ apply from: 'javaproject.gradle'
+ group='sis'
+ 
+ dependencies {
+-compile fileTree(dir: 'libs/prod', include: '*.jar')
+-testCompile fileTree(dir: 'libs/test', include: '*.jar')
++compile fileTree(dir: '/usr/share/java', include: '*.jar')
++testCompile fileTree(dir: '/usr/share/java', include: '*.jar')
+ }
+ 
+ tasks.withType(Test) {


(see commit[1]) which seems to be successful for the above problem which
vanished.  The next issue looks challenging for me since args4j classes
are in ch.systemsx.cisd name space and thus seem to be rely on the
classes in libs/prod/cisd-args4j-9.11.2-sources.jar instead of
/usr/share/java/args4j.jar which I replaced in my patch[2]:


...
Compiling with Java command line compiler 'java'.
Starting process 'command 'java''. Working directory: 
/build/libsis-jhdf5-java-18.09.0-pre1+dfsg Command: java -cp 
/usr/share/java/ecj.jar org.eclipse.jdt.internal.compiler.batch.Main -nowarn 
@/build/libsis-jhd
Successfully started process 'command 'java''
invalid Class-Path header in manifest of jar file: 
/usr/share/maven-repo/org/debian/maven/maven-repo-helper/debian/maven-repo-helper-debian.jar
--
1. ERROR in 
/build/libsis-jhdf5-java-18.09.0-pre1+dfsg/source/java/ch/systemsx/cisd/hdf5/h5ar/HDF5ArchiverMain.java
 (at line 31)
import ch.systemsx.cisd.args4j.Argument;
   ^^^
The import ch.systemsx.cisd.args4j cannot be resolved
--
2. ERROR in 
/build/libsis-jhdf5-java-18.09.0-pre1+dfsg/source/java/ch/systemsx/cisd/hdf5/h5ar/HDF5ArchiverMain.java
 (at line 32)
import ch.systemsx.cisd.args4j.CmdLineException;
   ^^^
The import ch.systemsx.cisd.args4j cannot be resolved
--
3. ERROR in 
/build/libsis-jhdf5-java-18.09.0-pre1+dfsg/source/java/ch/systemsx/cisd/hdf5/h5ar/HDF5ArchiverMain.java
 (at line 33)
import ch.systemsx.cisd.args4j.CmdLineParser;
   ^^^
...


Do you think I should exchange all

$ grep -R ch.systemsx.cisd.args4j
source/java/ch/systemsx/cisd/hdf5/h5ar/HDF5ArchiverMain.java:import 
ch.systemsx.cisd.args4j.Argument;
source/java/ch/systemsx/cisd/hdf5/h5ar/HDF5ArchiverMain.java:import 
ch.systemsx.cisd.args4j.CmdLineException;
source/java/ch/systemsx/cisd/hdf5/h5ar/HDF5ArchiverMain.java:import 
ch.systemsx.cisd.args4j.CmdLineParser;
source/java/ch/systemsx/cisd/hdf5/h5ar/HDF5ArchiverMain.java:import 
ch.systemsx.cisd.args4j.ExampleMode;
source/java/ch/systemsx/cisd/hdf5/h5ar/HDF5ArchiverMain.java:import 
ch.systemsx.cisd.args4j.Option;

by

  s/ch\.systemsx\.cisd/orgi.kohsuke.args4j/

?  Can I assume that this is safe or is there any trouble to be
expected?

Kind regards

  Andreas.


[1] 
https://salsa.debian.org/med-team/libsis-jhdf5-java/commit/027e5860855312df1c7bfca17c02c3a143b30980
 
[2] 
https://salsa.debian.org/med-team/libsis-jhdf5-java/blob/use_gradle/debian/patches/use_debian_packaged_libs.patch

-- 
http://fam-tille.de



Re: How to replace eclipse compiler in libsis-jhdf5-java

2018-09-20 Thread Emmanuel Bourg
Le 20/09/2018 à 14:02, Andreas Tille a écrit :

> +--- a/build.gradle
>  b/build.gradle
> +@@ -3,8 +3,8 @@ apply from: 'javaproject.gradle'
> + group='sis'
> + 
> + dependencies {
> +-compile fileTree(dir: 'libs/prod', include: '*.jar')
> +-testCompile fileTree(dir: 'libs/test', include: '*.jar')
> ++compile fileTree(dir: '/usr/share/java', include: '*.jar')
> ++testCompile fileTree(dir: '/usr/share/java', include: '*.jar')
> + }
> + 
> + tasks.withType(Test) {

Including all jars in /usr/share/java isn't a good idea. I've seen
packages failing to build due to this. It's preferable to list the exact
jars used.


> Can I assume that this is safe or is there any trouble to be expected?

I don't know but it's worth trying.

Emmanuel Bourg



Fork of args4j (Was: Usage of private interface H5private.h in libsis-jhdf5-java 18.09.0-pre1)

2018-09-20 Thread Andreas Tille
Hi again,

for the moment I ignored the issue of using the private interface I
wrote yesterday and tried to build the Java code.  Unfortunately there
is another issue which is hopefully not as hard to solve.  In your
download tarball you are shipping

libs/prod/cisd-args4j-9.11.2*.jar

(fortunately for my purpose also an archive including the sources
which I might be able to use for the packaging.  For the Debian
packaging we can not rely on binary JARs and thus I need to remove
these and need to rebuild from source.  However, I was instead
considering to use the Debian packaged args4j 2.33[1] which failed
due to the undefined attribute longName.

Before I now start to include the cisd-args4j fork of args4j:  Do
you see any chance to merge your changes into official args4j and
use the official project?

Kind regards and thanks for your patience to help me with the
Debian packaging

Andreas.

[1] 
https://salsa.debian.org/med-team/libsis-jhdf5-java/blob/use_gradle/debian/patches/use_debian_packaged_args4j.patch


On Wed, Sep 19, 2018 at 01:00:16PM +0200, Andreas Tille wrote:
> Hi Bernd,
> 
> On Wed, Sep 19, 2018 at 09:29:42AM +0200, Bernd Rinn wrote:
> > 
> > - This fix is in commit 331b8cc (August 21st).
> 
> This really helped me to upload libsis-base now.  Thanks a lot.
> 
> Now I tried to build jhdf5 and was running into:
> 
> ...
> In file included from h5VLStrHelperImp.c:19:
> jni/h5jni.h:23:10: fatal error: H5private.h: No such file or directory
>  #include "H5private.h"
>   ^
> compilation terminated.
> In file included from h5fHelperImp.c:20:
> jni/h5jni.h:23:10: fatal error: H5private.h: No such file or directory
>  #include "H5private.h"
>   ^
> compilation terminated.
> In file included from h5lHelperImp.c:19:
> jni/h5jni.h:23:10: fatal error: H5private.h: No such file or directory
>  #include "H5private.h"
>   ^
> compilation terminated.
> ...
> 
> H5private.h is as the name said private to the hdf5 library and its
> definitions should not be used in stable interfaces.  Did you discussed
> with the hdf5 developers to move the definitions you need to a public
> interface?
> 
> Kind regards
> 
>   Andreas.

-- 
http://fam-tille.de