cbt icon indicating copy to clipboard operation
cbt copied to clipboard

improve source compatibility between cbt versions

Open cvogt opened this issue 9 years ago • 4 comments

currently when changing compatibility/ cbt can easily become incompatible with old versions, which means you can't build projects tied against these old versions for reproducibility anymore. We should come up with a mechanism to stay backwards-compatible. We are currently using Java-interfaces.

One idea would be using something other than Java interfaces, e.g. json or something as an intermediate format. It would however require serializing all necessary types including java.io.File and java.net.URL.

Another idea how we may get away cheaper might be versioned Java interfaces BuildInterfaceV1, BuildInterfaceV2, ... and wrappers that implement the one in terms of the other.

cvogt avatar Oct 04 '16 01:10 cvogt

For now we could consider versioning CBT versions via git tags instead, so people can use those to find compatible cbt versions

cvogt avatar Oct 04 '16 13:10 cvogt

the current implementation with the described problems is described here: https://github.com/cvogt/cbt/issues/19

cvogt avatar Oct 04 '16 22:10 cvogt

so for now a solution with using Java8, interface default methods and deprecation seems to work relatively well. This should be fine for a while. E.g. https://github.com/cvogt/cbt/blob/b8e3edf032c60e8c9ae4f28d5c3ac2e2720308cc/compatibility/Context.java

cvogt avatar Feb 14 '17 06:02 cvogt

there is a document now documenting the known sources of potential incompatibilities: https://github.com/cvogt/cbt/blob/master/doc/cbt-developer/version-compatibility.md

We could make an effort to further the improve this, e.g. by having a TrappedSystemExit exception rather than parsing exception error messages. But this requires a refactoring, because right now we need it in the first thing loaded by nailgun, meaning it can't be part of the compatibility interface right now. Maybe we can avoid the needs for exit code trapping in nailgun launcher, maybe we can split it into a part that doesn't. maybe we can compile compatibility from bash and then restart nailgun when it changes (but ideally we'd move stuff away from bash not to it).

cvogt avatar Mar 19 '17 01:03 cvogt