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

osgi: convert all modules into bundles, ensure no package split #870

Closed
carrot-garden opened this issue Dec 29, 2012 · 40 comments
Closed

osgi: convert all modules into bundles, ensure no package split #870

carrot-garden opened this issue Dec 29, 2012 · 40 comments
Assignees
Milestone

Comments

@carrot-garden
Copy link

see
#867 (comment)

@carrot-garden
Copy link
Author

also note that current dependencies are wrong in
https://github.com/netty/netty/blob/master/all/pom.xml

  1. there is no reason to carry "example" module in osgi bundle
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>netty-example</artifactId>
      <version>${project.version}</version>
      <scope>compile</scope>
      <optional>true</optional>
    </dependency>
  1. should not depend on org.osgi or change scope to provided
    <dependency>
      <groupId>org.osgi</groupId>
      <artifactId>org.osgi.core</artifactId>
      <scope>compile</scope>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>org.osgi</groupId>
      <artifactId>org.osgi.compendium</artifactId>
      <scope>compile</scope>
      <optional>true</optional>
    </dependency>

@carrot-garden
Copy link
Author

part of suggested osgi review #876

@carrot-garden
Copy link
Author

instructions how to use bnd
http://www.aqute.biz/Bnd/Bnd

how to detect/report package split

If you put all bundles on the classpath and then do Private-Package: * it should report any split packages to you:


    findsplit.bnd:
    -classpath: ${lsa;jar/*}
    Private-Package: *

    $ bnd findsplit.bnd

You probably have to parse the output since the error is, as I recall, repeated rather loudly ...

Kind regards,

    Peter Kriens

@ghost ghost assigned normanmaurer Jan 9, 2013
@normanmaurer
Copy link
Member

@trustin @carrot-garden that is something we really need to do before beta1 as we may need to juggle a few classes / packages

@carrot-garden
Copy link
Author

I can convert all modules into bundles now. should I?

@trustin
Copy link
Member

trustin commented Feb 1, 2013

Is there a way to test this reliably as a part of the build?

@trustin
Copy link
Member

trustin commented Feb 1, 2013

If so, let's do that. Otherwise, isn't it OK to make only the all-in-one JAR an OSGi bundle?

@carrot-garden
Copy link
Author

  1. "way to test this reliably" - yes
  2. "make only the all-in-one" - this would force extra dependencies and extra footprint

@trustin
Copy link
Member

trustin commented Feb 1, 2013

If yes, let's make all artifacts OSGI bundles (except for the all-in-one jar) with proper testing built into the build. Will you take on it, @carrot-garden ?

@trustin
Copy link
Member

trustin commented Feb 1, 2013

If you are busy, only testing part should be fine. I can handle from there.

@carrot-garden
Copy link
Author

re "will you take on it" - ok.

@trustin
Copy link
Member

trustin commented Feb 1, 2013

Awesome. Thanks @carrot-garden!

@carrot-garden
Copy link
Author

2 show stoppers so far:

  1. transport-rxtx
    FIXME find/make osgi bundle for org.rxtx:rxtx

  2. netty-common
    io.netty.util.internal is "internal" but used directly by bunch of other modules.
    options:
    a) make not "internal"
    b) keep "internal", but expose features via public factories, etc.

@normanmaurer
Copy link
Member

I think keep them in internal is ok.. maybe we should have a package-list.info which tells that this package has stuff for "core" internal usage..

Am 01.02.2013 um 12:59 schrieb Andrei Pozolotin notifications@github.com:

2 show stoppers so far:

  1. transport-rxtx
    FIXME find/make osgi bundle for org.rxtx:rxtx

  2. netty-common
    io.netty.util.internal is "internal" but used directly by bunch of other modules.
    options:
    a) make not "internal"
    b) keep "internal", but expose features via public factories, etc.


Reply to this email directly or view it on GitHub.

@normanmaurer
Copy link
Member

And I think for 1) it is not "our" problem. If someone wants to use it in osgi he needs to find the bundle or make it.

@carrot-garden
Copy link
Author

rxtx: filed couple issues
http://code.google.com/p/create-lab-commons/issues/list

@carrot-garden
Copy link
Author

rxtx: removed from osgi framework test
64f3455

@normanmaurer
Copy link
Member

What about split packages, are we ok here?

Sent from my iPhone. Excuse any typos....

Am 01.02.2013 um 19:19 schrieb Andrei Pozolotin notifications@github.com:

rxtx: removed from osgi framework test
64f3455


Reply to this email directly or view it on GitHub.

@carrot-garden
Copy link
Author

re: "split packages" - currently there are no split packages.
this is enforced by new module
https://github.com/netty/netty/pull/1010/files#diff-28

@carrot-garden
Copy link
Author

@carrot-garden
Copy link
Author

re: "keep them in internal is ok"
in osgi, packages like ".internal." and ".impl." by convention are made private (not exported via manifest)
options:
a) rename "internal" to something else
b) override convention, include "internal" in manifest export

@carrot-garden
Copy link
Author

re: "internal" - I would rather have them public.
currently I must have duplicate dependency since I need JZlib,
and io.netty.util.internal.jzlib supposed to be "the correct one".

@carrot-garden
Copy link
Author

re: "jzlib" - how about making jzlib into a separate module: netty-jzlib
and work with jcraft to fix what we want them to fix?
then not much left of "internal".

@normanmaurer
Copy link
Member

Well we could also move it to the codec

Sent from my iPhone. Excuse any typos....

Am 01.02.2013 um 19:57 schrieb Andrei Pozolotin notifications@github.com:

re: "jzlib" - how about making jzlib into a separate module: netty-jzlib
and work with jcraft to fix what we want them to fix?
then not much left of "internal".


Reply to this email directly or view it on GitHub.

@carrot-garden
Copy link
Author

re: "jzlib" - filed issue ymnk/jzlib#8

@carrot-garden
Copy link
Author

re: "netty-jzlib" - this module should use standard jcraft package name space
so when ymnk/jzlib#8 resolved it is a drop in replacement

@dantran
Copy link
Contributor

dantran commented Feb 1, 2013

btw, it is best to use karaf 2.3.1-SNAPSHOT for osgi validation:

  1. It is in release path in the next week or 2.
  2. karaf-3.0 release may take much longer

@carrot-garden
Copy link
Author

re: "karaf version"
JB promised "something like one week" for v 3.0.0.RC1
http://mail-archives.apache.org/mod_mbox/karaf-user/201301.mbox/%3C50F88A8F.8030606@nanthrax.net%3E

@normanmaurer
Copy link
Member

I think there is no need for an extra module... @trustin why you forked it ?

Sent from my iPhone. Excuse any typos....

Am 01.02.2013 um 20:07 schrieb Andrei Pozolotin notifications@github.com:

re: "netty-jzlib" - this module should use standard jcraft package name space
so when ymnk/jzlib#8 resolved it is a drop in replacement


Reply to this email directly or view it on GitHub.

@trustin
Copy link
Member

trustin commented Feb 2, 2013

There was no gzip support when I use jzlib.

@trustin
Copy link
Member

trustin commented Feb 2, 2013

It's pretty small and mature, so I'm not sure it is worth unforking.

@normanmaurer
Copy link
Member

So let us just keep them as they are..

Sent from my iPhone. Excuse any typos....

Am 02.02.2013 um 11:24 schrieb Trustin Lee notifications@github.com:

It's pretty small and mature, so I'm not sure it is worth unforking.


Reply to this email directly or view it on GitHub.

@carrot-garden
Copy link
Author

re "let us just keep them as they are" - you mean export "internal" as public package?

@normanmaurer
Copy link
Member

Yes

Sent from my iPhone. Excuse any typos....

Am 02.02.2013 um 17:37 schrieb Andrei Pozolotin notifications@github.com:

re "let us just keep them as they are" - you mean export "internal" as public package?


Reply to this email directly or view it on GitHub.

@carrot-garden
Copy link
Author

re: "internal" - made into public package 124044e

@carrot-garden
Copy link
Author

@normanmaurer time to invite David Bosschaert #876.
one way to review would be:

cd /tmp
git clone git@github.com:netty/netty.git
cd netty
git checkout osgi-bundles
mvn clean install

then use bnd command line
to verify all jars for osgi compliance in */target of these projects:

netty-buffer
netty-codec
netty-codec-http
netty-codec-socks
netty-common
netty-handler
netty-transport
netty-transport-rxtx
netty-transport-sctp
netty-transport-udt

finally take a look on all "verify" projects

netty-verify

@normanmaurer
Copy link
Member

complete

@carrot-garden
Copy link
Author

@lw346

Luke:

since you seems be interested in rxtx, do you think you could move these forward:
(see above)
http://bugzilla.qbang.org/show_bug.cgi?id=201
http://bugzilla.qbang.org/show_bug.cgi?id=202

thanks
Andrei.

@lw346
Copy link
Member

lw346 commented Feb 13, 2013

This would involve changing the build process of RXTX to something not-insane, and I think extends beyond my ken.

@carrot-garden
Copy link
Author

:-)

do you know who could take on this?

here is example how I build udt
https://github.com/barchart/barchart-udt/tree/master/barchart-udt-core

I could provide basic project setup for rxtx similar to udt, but someone needs to finish

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

No branches or pull requests

4 participants