Closed vincentbernat closed 8 years ago
Hum, #83 introduced use of virDomainInterface*
which are only available from libvirt 1.2.14. What should we do about this? Give up about 1.2.12 compatibility or revert the commit since it is quite recent and tagged yet?
This PR shouldn't matter in the decision of course, I'll go another way if needed.
cc @dmacvicar @rgbkrk
You can't let an Ubuntu version dominate all aspects of software development :-)
In terraform-provider-libvirt we had to build our own, given that TravisCI only supports ancient Ubuntu.
https://github.com/dmacvicar/terraform-provider-libvirt/blob/master/.travis.yml
(btw, compatibility was originally broken here https://github.com/rgbkrk/libvirt-go/pull/79 and discussed here https://github.com/rgbkrk/libvirt-go/issues/50)
Oh, great! I didn't find an appropriate PPA. I'll update the .travis.yaml
to do like you did. I'll also update the README with the minimal version of libvirt supported.
If we broke backwards compatibility with the API we should likely revert the commits.
We broke compatibility with libvirt 1.2.12. I wouldn't say that backward compatibility is broken. Code that was working with a previous version will still work if libvirt is recent enough. I don't have an opinion on this matter (personally, I am using a more recent version of libvirt)
What would be possible would be to use tags to build or not build features requiring a more recent version of libvirt. For example, let's suppose we stick with libvirt 1.2.12, people can enable more features with the tag "future". We would put those features in distinct files with
// +build future
And people would need to use -tags future
. Or maybe -tags libvirt.future
to avoid collision. Or we could use -tags libvirt.1.2.14
which would enable all features compatible with libvirt 1.2.14:
// +build libvirt.1.2.13 libvirt.1.2.14
I think this proposition is the most extensive one (hoping we can use a dot).
+1 for moving to travis.
Ok, so libvirt is now compiled from source. Tests are done for Go 1.5 and Go 1.6. libvirt 1.2.2 and 1.2.14 are tested. And I have added a commit to make the conditional compilation like I described above.
A project needing features from libvirt 1.2.14 should build with -tags libvirt.1.2.14
. Only a few tags are valid (currently one) to not have too long // +build
lines. But let's suppose we want to add feature virDomanRename
from libvirt 1.2.19, we would add the tag libvirt.1.2.19
and a user wanting this feature would build with -tags libvirt.1.2.19
, we would add a domain_1.2.19.go
file with// +build libvirt.1.2.19
and the domain_1.2.14.go
file would get // +build libvirt.1.2.14 libvirt.1.2.19
.
We can of course only keep the first commit and I can do a PR for the second one.
And integration tests are not run. Maybe at a later point.
Thank you so much for this legwork @vincentbernat
Not to be merged yet, not tested!