Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] What are baseline repositories good for?

Hi Felix,

> On Feb 17, 2020, at 20:21, Felix Dorner <felix.dorner@xxxxxxxxx> wrote:

> The end result is that build output contains new versions of the artifacts that did change and baseline version of the artifacts that did not.
> 
> And "change" meaning version, id and "content". How is "content" defined here?


With JGit based version qualifiers the build still produces new class files and new jars every time. It just happens to be the case that the qualifier is not a random timestamp but the one from the last commit to the folder tree of the project. However, the production of class files and jars is not deterministic. Even though they are produced from the same inputs (java source) their output appears to be random at the byte level. While logically the content should be "the same" it's technically varying, i.e. the fingerprints/hashes will be different.

One thing to avoid for large repositories is to re-publish jars with the same version (including same qualifier) but different bytes. This leads to SHA/fingerprint mismatches at scale (clients can cache fingerprints from previous checks locally).

Thus, the baseline repository is used when publishing/mirroring artifacts to the final repo. If an artifact is present in both - the baseline and in the current reactor (as a result of a build) - a comparator must verify whether they are equal or not. For class files/jars a special comparator should be sed.
https://github.com/eclipse/tycho/blob/master/tycho-artifactcomparator/src/main/java/org/eclipse/tycho/zipcomparator/internal/ClassfileComparator.java

If the artifacts are NOT equal but have the same qualifier then the build should be failed (IMO). 

There is some good discussion with further details here:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=479875

-Gunnar

-- 
Gunnar Wagenknecht
gunnar@xxxxxxxxxxxxxxx, http://guw.io/





Back to the top