On Sat, Jan 19, 2013 at 5:48 PM, Phil Harvey <[email protected]>wrote:

> I worked with Keith on this proposal so I should state up front that I'm
> not coming to this debate from a neutral standpoint.
>
> Hopefully we can find a solution that is acceptable to everyone.  To this
> end, we listed our understanding of the requirements on
> https://issues.apache.org/jira/browse/PROTON-194.  I'm hoping that this
> discussion will allow us to clarify our requirements, such that the best
> technical solution naturally follows.
>
> I've added some comments in-line below...
>
> On 18 January 2013 19:29, Rafael Schloming <[email protected]> wrote:
>
> > On Fri, Jan 18, 2013 at 11:17 AM, Keith W <[email protected]> wrote:
> >
> > > We are currently in the process of implementing the proton-jni binding
> > > for the proton-c library that implements the Java Proton-API, allow
> > > Java users to choose the C based proton stack if they wish. This work
> > > is being performed on the jni-branch under PROTON-192 (for the JNI
> > > work) and PROTON-194 (for the build system changes).
> > >
> > > Currently, Proton has two independent build systems: one for the
> > > proton-c and its ruby/perl/python/php bindings (based on Cmake/Make),
> > > and second a separate build system for proton-j (based on Maven).  As
> > > proton-jni will cut across both technology areas, non trivial changes
> > > are required to both build systems.
> > >
> > > The nub of the problem is the sharing of the Java Proton-API between
> > > both proton-c and proton-j trees. Solutions based on svn-external and
> > > a simple tree copy have been considered and discussed at length on
> > > conference calls.  We have identified drawbacks in both solutions.
> > >
> >
> > To be honest I don't think we've sufficiently explored the "copy" option.
> > While its true there were a lot of hypothetical issues thrown around on
> the
> > calls, many of them have quite reasonable solutions that may well be less
> > work than the alternatives.
> >
> > In my experience, maintaining two copies of any code is usually a bad
> thing.  However, I try to be open minded so I agree that it's worth
> exploring this option.  I'd be interested to hear your opinion on (a) the
> scenarios when it would be acceptable for these two copies to diverge and
> (b) the mechanism you're envisaging for achieving convergence.  I imagine
> there are both technical and "process" dimensions to making this work.
>
>
This is a good question, sorry I missed it with the flurry of other posts.
To answer (a), I think on trunk these two things should probably never (or
very rarely at least) diverge. On very specific feature development
branches I think we've seen it can be convenient to let them diverge a
little, but as the whole point of a feature branch is to be able to break
things I think that's neither here nor there, either way I would consider
non matching APIs to be a broken state of things.

The mechanism I'd propose would be to add a check to the C build system
that would cause a build failure if the API as viewed from the JNI binding
was any different from the API as it exists in the Java source tree. I
believe for most developer scenarios this would achieve *almost* the same
thing that svn externals does without the inherent drawbacks. I'll detail
the scenarios I've thought of below:

1. Changing the Java API from the Java tree
  If the Java developer changes the API, the C build will break due to
check failure.
  If the Java developer changes both to avoid the check, the C build will
break to do compile failure.

2. Changing the Java API from the C tree
  If the C developer forgets to change the Java API, then the C build will
break due to check failure.
  If the C developer changes both to avoid the check, the Java build will
break due to compile failure.

I believe the above scenarios enforce pretty much the same thing svn
externals does. The only added step is the need to copy changes to both
places when you are being a good citizen and bringing forward both at the
same time. I would hope that this would become less and less of an issue as
the API should really stabilize and not change, however if that is an issue
for the near term I would propose adding a sync script on the C side to
pull the changes over to a local checkout. This would result in the
following process for someone changing both simultaneously:

  - Make you changes and test on the Java build. When this works,
transition over to the C build and see what the impact of the changes has
been. The first breakage will be the check failure and running the sync
script will fix this. You can then proceed to see what other build failures
there are and how to fix them.

I would hope overall this would minimize the impact of the syncing as I
would expect API changes to be primarily driven from the Java side. Either
way, I think the only development process difference between this setup and
the svn externals one is that for the C build you fix the check breakage by
running the sync script before proceeding to fix remaining build failures.

--Rafael

Reply via email to