Closed kwin closed 1 year ago
@mcculls I would go ahead and merge next week if you don’t have any concerns.
Strange thing noticed with this build:
When you build all (the "evil" mvn clean install
), then you end up with WARNING in build:
[INFO] --- jacoco:0.8.8:report-aggregate (jacoco-report) @ org.eclipse.sisu.inject.tests ---
[INFO] Loading execution data file /home/cstamas/Worx/eclipse/sisu.inject/org.eclipse.sisu.inject.tests/target/jacoco.exec
[INFO] Analyzed bundle 'org.eclipse.sisu.inject' with 207 classes
[WARNING] Classes in bundle 'org.eclipse.sisu.inject' do not match with execution data. For report generation the same class files must be used as at runtime.
[WARNING] Execution data for class org/eclipse/sisu/space/SpaceScanner does not match.
[WARNING] Execution data for class org/eclipse/sisu/wire/DynamicGlue does not match.
[WARNING] Execution data for class org/eclipse/sisu/space/SpaceScanner$1 does not match.
But, when you do this: mvn clean install -rf :org.eclipse.sisu.inject.tests
then no warnings. Seems it has to do with shading that happens in same reactor?
Reported Jacoco issue here https://github.com/jacoco/jacoco/issues/1394
In short: this is jacoco bug, they (wrongly) source reactor project by going directly for target/classes
instead to get main artifact (that is packaged, and may be post-processed, like in out case, relocations), hence the non-matching execution data: tests were executed with JAR that was including relocated ASM, while report will find non-relocated stuff.
Hi @kwin - ideally I would prefer to keep the local copy of ASM code. There's a script which makes it really easy to update from the upstream project, and it also means we could pull in changes which haven't yet been released to central.
But if I don't get round to finishing my review this weekend then we can move to commit-then-review (CTR)
Update: I've merged most of the commits from this PR that remove the tycho packaging and have also moved the tests under org.eclipse.sisu.inject
- tomorrow (Monday) I'm going to merge in the bnd-maven-plugin changes and do some additional cleanup. I'll then repeat this process for sisu.plexus
.
Hi @mcculls, thanks for merging in the first pieces. Regarding
ideally I would prefer to keep the local copy of ASM code
I disagree here. That code is not written by us and the origins should be more visible. Also this shouldn't be taken into consideration by any code coverage calculation. Having an explicit dependency in the pom.xml and letting Maven embed it allows to
Regarding the jacoco issue, we should just ignore that whole package as that should not be considered for coverage calculation. It is a third party library we just use. IMHO that should be possible to ignore with just https://www.eclemma.org/jacoco/trunk/doc/prepare-agent-mojo.html#excludes.
Can we go forward with the next steps?
I'll be cleaning up and merging in the manifest generation this weekend - regarding ASM, we really need to repackage ASM either way to avoid packaging conflicts, so the question is whether to do this once per upgrade or on every single build.
Given builds happen much more than upgrades IMHO it makes more sense to do the repackaging only once rather than on every build. Especially since ASM is such a small dependency of only a few classes. It also helps with debugging issues that touch ASM because the source is there and matches the binaries.
Note we use ASM as an implementation detail, but we avoid exposing it via the API - we still record the attribution in the project source and the final binary. And as mentioned earlier, we now have a script that lets you update ASM to a given tag with a single command.
Everything relevant has been cherry-picked to master meanwhile.
The MANIFEST.MF is now generated automatically. It looks like this:
compare to the manual one
The important changes are:
SisuExtender
is a BundleActivator in the bundleorg.eclipse.sisu.inject
but only active in case the framework/system propertysisu.extender.enabled
is set totrue
(this makes the previous extender bundle completely obsolete)