go-sdl2: Change bindings version for every breaking change
@veeableful We should look into making the package more dependable in terms of versioning with all the breaking changes we do.
We can use http://labix.org/gopkg.in.
This is the link we have for go-sdl, but since all our tags major versions are zero there is only one version available: https://gopkg.in/veandco/go-sdl2.v0
Installation go get gopkg.in/veandco/go-sdl2.v0
Package import gopkg.in/veandco/go-sdl2.v0/sdl
Whenever a breaking change is committed we should increase the version via tags or a new branch.
The major version should be increased whenever the respective package API is being changed in an incompatible way.
Examples of modifications that DO NEED a major version change are: Removing or renaming any exposed name (function, method, type, etc) Adding, removing or renaming methods in an interface Adding a parameter to a function, method, or interface Changing the type of a parameter or result in a function, method, or interface Changing the number of results in a function, method, or interface Some struct changes (see details below)
On the other hand, the following modifications are FINE WITHOUT a major version change: Adding exposed names (function, method, type, etc) Renaming a parameter or result of a function, method, or interface Some struct changes (see details below)
If we are going to use gopkg.in then we need to decide if branches or tags are used for new versions.
- Tags are less obstructive, since we are already using them and they are hidden in Releases. The problem is that tags are linked to a certain commit and it will be harder to maintain if we are going to update minor versions. Whenever non-breaking change is introduced we should increase minor version to 2.1, for example. When users update their package with
go get gopkg.in/veandco/go-sdl2.v2they will receive v2.1 in that case. And we should probably write what is actually changed in the release notes. - If branches are used: v1, v2 and so on. The latest one will always be up to date and will replace the master branch. But there will be a lot of branches in our case. Example: https://github.com/go-yaml/yaml/tree/v2
About this issue
- Original URL
- State: open
- Created 6 years ago
- Comments: 20 (10 by maintainers)
I’ve just found this issue https://github.com/campoy/flappy-gopher/issues/9.
This means that
gopkg.inwon’t really help with versioning, because optional packages are still importing original"github.com/veandco/go-sdl2/sdl"instead of"gopkg.in/veandco/go-sdl2.v0/sdl".This makes it pretty much pointless.
I’m currently working on
CHANGELOG.md. Found this more or less popular standard Keep a Changelog.Things to point out:
Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
Unreleased
// TODO
0.3.0 - 2018-05-07
// TODO
0.2.0 - 2017-11-01
Added
BYTEORDER.HintCallbacktype andAddHintCallback(),DelHintCallback()functions.GetModState()(#230).PIXELFORMAT_RGBA32,PIXELFORMAT_ARGB32,PIXELFORMAT_BGRA32,PIXELFORMAT_ABGR32.Renderer.GetLogicalSize(),Texture.UpdateYUV()(#264).Changed
sdl_mixer,sdl_image,sdl_ttftoimg,mix,ttf.GFXPrimitiveSetFont()toSetFont().GFXPrimitivesSetFontRotation()toSetFontRotation().QuickLoad_WAV(mem unsafe.Pointer) (*Chunk, error)toQuickLoad_WAV(mem []byte) (*Chunk, error).Update()toJoystickUpdate().Renderer.GetRendererInfo(info *RendererInfo) errortoRenderer.GetInfo() (RendererInfo, error).Texture.Lock(rect *Rect, pixels *unsafe.Pointer, pitch *int) errortoTexture.Lock(rect *Rect) ([]byte, int, error).Texture.Update(rect *Rect, pixels unsafe.Pointer, pitch int) errortoTexture.Update(rect *Rect, pixels []byte, pitch int) error.Renderer.GetRendererOutputSize()toRenderer.GetOutputSize().Fixed
GetFramecount()to callSDL_getFramecount()instead ofSDL_getFramerate(#258).SetFont()segfault when passed a nil font data.min()function used in manygfxcalculations.[0.1.0] - 2017-06-01
I’ve looked in other alternatives and found that there will be and official Go solution to versioning, currently known as vgo.
https://github.com/golang/proposal/blob/master/design/24301-versioned-go.md https://github.com/golang/go/wiki/vgo https://research.swtch.com/vgo https://www.youtube.com/watch?v=F8nrpe0XWRg
There will be some compatibility bits for vgo in Go 1.11 (August 2018), nothing major. Though Youtube video description states:
This twit states that vgo might be merged into 1.12: https://twitter.com/bradfitz/status/991674185612054529
The good thing is that they use tags for it to work. So what we’ve discussed earlier is compatible with vgo.
They propose the following package structures:
go-sdl2,go-sdl2/v2and so on. Each directory containsgo.modfile with package version and its dependencies version.master,v2,v3and so on. Each branch root dir withgo.modfile.Both solutions are good if old versions are kept alive with security or feature patches. In our case one master branch with version tags is enough.
We might need to add
go.modfile later on, once this is a part Go.There is also this: