Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] Buck build for JGit

On Sun, Jan 3, 2016 at 6:35 PM, Shawn Pearce <spearce@xxxxxxxxxxx> wrote:
On Sun, Jan 3, 2016 at 6:16 AM, Andrey Loskutov <loskutov@xxxxxx> wrote:
> If I build
> buck build //:jgit_bin
> the resulted binary reports:
> $buck-out/gen/jgit_bin/jgit_bin version
> jgit version 1.3
> (same also for $buck-out/gen/jgit_bin/jgit_bin --version).
>
> Same code built with
> $mvn clean install -Dmaven.test.skip=true
> produces this output:
> $org.eclipse.jgit.pgm/target/jgit version
> jgit version 4.2.0-SNAPSHOT
>
> The obvious difference is that MANIFEST.MF produced by buck seem to be a mix of manifests from all involved jars it found during the build, while MANIFEST.MF built by maven contains only expected data for pgm bundle.

Fixed by https://git.eclipse.org/r/63432.

You are right, Buck mixes the manifests together by default. Getting
it to do different is a bit of a challenge, we have to use a genrule()
to build our own manifest text and replace it after the fact.

> Beside this, the jars build by maven and buck differs also in other parts (maven packages osgi and log4j implementation classes inside). While I have no idea why do we need osgi in the jgit binary,

This happens because of the org.eclipse.jgit.archive package. The
archive JAR in the Maven build has an OSGI bundle activator class to
register the archive formats it supports when it loads inside Eclipse.
Compiling that class in Maven requires an OSGI package as a
dependency, which is then sucked into the shaded JAR. In Buck we
exclude that class from compilation so its not in the "shaded" JAR
built by Buck, as the OSGI package isn't even in the dependency tree.

> missing log4j can be problematic.

I don't know why the standalone binary uses log4j. I built it with
sl4fj-simple in Buck, which is smaller and prints messages to stderr
rather than using the far more complex log4j.

AFAIR this was done since slf4j-log4j was available in Orbit already.
If we agree to switch to slf4j-simple I can file the required CQ.

-Matthias

Back to the top