osgi / bugzilla-archive

Archive of OSGi Alliance Specification Bugzilla bugs. The Specification Bugzilla system was decommissioned with the move to GitHub. The issues in this repository are imported from the Specification Bugzilla system for archival purposes.
0 stars 1 forks source link

Problems running OSGi TCK for R5 and R6 #2904

Closed bjhargrave closed 6 years ago

bjhargrave commented 6 years ago

Original bug ID: BZ#3036 From: Jochen Hiller <j.hiller@telekom.de> Reported version: R5

bjhargrave commented 6 years ago

Comment author: Jochen Hiller <j.hiller@telekom.de>

I am a committer on the Eclipse Concierge project, my company (Deutsche Telekom AG) is an OSGi alliance member.

I am trying to run the OSGi TCK, both for OSGi R5 and R6 for upcoming updates of Concierge. When doing that, I struggled with some issues, which I would like to report here.

  1. Documentation

I searched for any documentation how to run the TCK in OSGi member area. I found more or less NO documentation. If there is something mentioned, I found some dead links, e.g.

  1. Run OSGi TCK for R5

I ran into these issues:

$ mkdir ~/osgi-r5
$ cd ~/osgi-r5
$ git clone -b r5-core-ri-ct-final https://osgi.org/git/build.git
$ cd build
$ java -version
java version "1.8.0_144"
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)
$ ant clean
$ ant build

# could not compile
    [javac] /Users/jhiller/osgi-r5/build/org.osgi.service.cm/src/org/osgi/service/cm/ConfigurationEvent.java:108: error: type ServiceReference does not take parameters
    [javac]     private final ServiceReference<ConfigurationAdmin>  reference;
    [javac]                                   ^
...

# fix is: replace osgi.core-4.3.0 by osgi.core-4.3.1
$ wget -O osgi.core-4.3.1.jar https://search.maven.org/remotecontent?filepath=org/osgi/osgi.core/4.3.1/osgi.core-4.3.1.jar
$ mv osgi.core-4.3.1.jar ./cnf/repo/osgi.core/osgi.core-4.3.1.jar
$ rm ./cnf/repo/osgi.core/osgi.core-4.3.0.jar
$ ant clean
$ ant build

# org.osgi.service.event is missing in buildpath of org.osgi.test.cases.blueprint.java5/bnd.bnd
    [javac] /Users/jhiller/osgi-r5/build/org.osgi.test.cases.blueprint.java5/src/org/osgi/test/cases/blueprint/java5/tests/TestGenericCollectionInjection.java
    [javac] warning: [options] source value 1.5 is obsolete and will be removed in a future release
    [javac] warning: [options] target value 1.5 is obsolete and will be removed in a future release
    [javac] warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
    [javac] /Users/jhiller/osgi-r5/build/org.osgi.test.cases.blueprint.java5/src/org/osgi/test/cases/blueprint/java5/tests/TestGenericCollectionInjection.java:67: error: cannot access EventHandler
    [javac]         MetadataEventSet startEvents = controller.getStartEvents();

$ vi org.osgi.test.cases.blueprint.java5/bnd.bnd
$ ant build

# add zu buildpath
-buildpath                                                      = ee.j2se; version=1.5, \
    org.osgi.test.support;                  version=project , \
    org.osgi.service.blueprint;             version=project , \
    org.osgi.test.cases.blueprint;          version=project , \
    osgi.core;                              version=4.1 , \
    org.osgi.service.event; version=latest, \
    ${junit}

same for org.osgi.test.cases.blueprint.secure/bnd.bnd

$ vi org.osgi.test.cases.blueprint.secure/bnd.bnd $ ant build

unpack osgi.ct.core.jar and osgi.ri.core.jar

$ mkdir run $ cp ../osgi.ct/generated/osgi.ct.core.jar . $ cp ../osgi.ri/generated/osgi.ri.core.jar . $ jar xvf osgi.ct.core.jar $ jar xvf osgi.ri.core.jar $ chmod u+x runtests $ ./runtests ... Errors 000: Option title, t, with argument not last in avvreviation , 001: Unrecognized option i, 002: Unrecognized option l, 003: Unrecognized option e,

fix -title to --title

$ ./runtests $

no problems, all tests successful

  1. Run OSGi TCO for R6

I ran into these issues:


$ mkdir ~/osgi-r6
$ cd ~/osgi-r6
$ git clone -b r6-core-ri-ct-final https://osgi.org/git/build.git
$ java -version
java version "1.8.0_144"
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)
$ ant clean
$ ant build

# same problem for org.osgi.service.event is missing in buildpath of org.osgi.test.cases.blueprint.java5/bnd.bnd
# same problem for org.osgi.service.event is missing in buildpath of org.osgi.test.cases.blueprint.secure/bnd.bnd

# javadoc does not compile
  [javadoc] Constructing Javadoc information...
  [javadoc] Creating destination directory: "/Users/jhiller/osgi-r6/build/osgi.build/generated/javadoc/core/"
  [javadoc] javadoc: warning - Error reading file: /Users/jhiller/osgi-r6/build/osgi.build/generated/javadoc/core/../core/package-list
  [javadoc] Standard Doclet version 1.8.0_144
  [javadoc] Building tree for all the packages and classes...
  [javadoc] /Users/jhiller/osgi-r6/build/org.osgi.annotation.versioning/src/org/osgi/annotation/versioning/Version.java:46: warning: no @ return
  [javadoc]     String value();
  [javadoc]            ^

# take out javadocs from build, related to use Java8 compiler and javadoc tool I assume
$ vi osgi.build/build.xml
        <target name="deploy" depends="master.deploy,japitools,japicompat"> 

$ ant build
# run tests as above will result in all errors in org.osgi.test.cases.framework.secure.junit.hooks.weaving.WeavingHookTests

I do not expect to get the "old" TCKs fixed. But some documentation would indeed be very helpful.
bjhargrave commented 6 years ago

Comment author: @bjhargrave

Hi, you do not build the CTs for R5 and R6. They are already built.

See https://osgi.org/members/Release5/HomePage for links to the R5 builds and https://osgi.org/members/Release5/HomePage for links to the R6 builds.

When you download the CT builds, you get a jar you unzip. In there is a script but you will need to edit the script and/or bnd files to use your implementations rather than the RI for the specification(s) you want to CT.

If you also download the corresponding RI builds, you can unzip them into the same folder as the CT to test run the CT before you replace the RI with your implementation(s).

bjhargrave commented 6 years ago

Comment author: @pkriens

I was involved in getting this to work. Although there are binaries for the official run, sometimes you need sources. I think this exercise showed that we have a long term build stability problem due to a tool chain that significantly changes over time.

Maybe a suggestion is to create a docker image with the toolchain for each release? This same image could be used to build the code.

I think it is quite important to at least update the information on https://osgi.org/members/Documents/TCK to reflect what BJ answers in this mail.

It was not a pretty sight going through the website trying to figure out how to do this ...

bjhargrave commented 6 years ago

Comment author: Jochen Hiller <j.hiller@telekom.de>

Thanks BJ for fast feedback.

Good to know that the prebuilt TCK can be used.

I talked with the Jan/Tim which did run the TCK tests in past. It seems that every developer uses its own path to run the TCK tests. So a short overview would have been helpful. Will you/someone do that? Shall I open another bug for that?

I will follow your advice and will use Concierge specific bnd files to run the TCK on top of Concierge.

bjhargrave commented 6 years ago

Comment author: @bjhargrave

(In reply to Peter Kriens from comment BZ#2)

I think this exercise showed that we have a long term build stability problem due to a tool chain that significantly changes over time.

I don't think this "exercise" showed that at all.

Jochen used JDK 8 to attempt to build R5 and R6. JDK 8 was never used or tested to build R5 or R6. At the very least, you need to use the tools that the build originally used.

Jochen also used the wrong tags. He used the core tags which may not have had functioning RIs and CTs when tagged for Core Final.

Furthermore, I was able to successfully build both Cmpn R5 and Cmpn R6 on my system using JDK 7 and the appropriate build command (which is shown in the build's log):

R5:

$ git checkout -B r5-test-build r5-cmpn-ri-ct-final --force $ git clean -dfx $ ant -Djsr14=no

R6:

$ git checkout -B r6-test-build r6-cmpn-ri-ct-final --force $ git clean -dfx $ ./gradlew

Maybe a suggestion is to create a docker image with the toolchain for each release? This same image could be used to build the code.

As for docker images, one day you wont be able to run some old docker image without some old version of docker or linux. You just trade one form of bitrot for another :-)

I think it is quite important to at least update the information on https://osgi.org/members/Documents/TCK to reflect what BJ answers in this mail.

It was not a pretty sight going through the website trying to figure out how to do this ...

This would be great if someone has the time to do this.