Open malashin opened 6 years ago
My personal opinion is that we don't need to maintain old versions so I think I would go for tags. Perhaps we can start with version v1.0 and increment the minor version after some non-breaking updates. If we have breaking updates, then we'll increment the major version and continue from there (e.g. v1.1 -> v2.0).
I figure that should be simple enough to maintain and doesn't cause a lot of problems for the users. What do you think?
P.S. Do you think I should tag our current master as v1.0 now? :grimacing:
Ye, this is what I proposed in the Tags way.
Keep master as unstable. Add taged releases with every change (perhaps we should think about grouping several changes into one, but it seems not likely with the way development is going so far).
Add changelogs to each release like this: https://github.com/acemod/ACE3/releases https://github.com/Microsoft/vscode-go/releases
I would like all commit names to have issue number in them if they are done in response to an issue. Since there is not much stated in the commit messages, having link to an issue helps with finding what was changed and why.
sdl: events: Split JoyDeviceEvent into two different events #333
sdl: video: Make GL funcs into Window methods #325
Also having one CHAGELOG.md file in root dir with all the changes from version to version is helpful.
If we are going this way this is what needs to be done:
Alright! I think once the existing PR is merged and the few recent issues we have are solved, I will tag master as v1.0, do some of the stuff you listed and we can start practicing our process then. Although I'm not sure if we should make a tagged release for every change. Perhaps we can tag it every month for starters?
As for the release note, I was wondering if we can just use git shortlog v0.2..master
as the base release note, kind of like https://www.winehq.org/announce/3.7 to make the process simpler. We may need to help renaming PR commits that we merge to make them clearer when shown in the shortlog. After that, we can add "What's New" and "Bugs Fixed" stuff on top. Maybe we can label some PRs as "fixes" and "features" so we can find them easier when writing the release note.
Anyway, that's just my two cents. If you feel strongly about the other styles of release notes, I will support you :grimacing:
git log --oneline
seems to be good for this. The problem is that first line of commit message might be too short.
Example of commit:
sdl: events: Split JoyDeviceEvent into two different events #333
What it should be in the changelog imo:
sdl: events: Split JoyDeviceEvent into JoyDeviceAddedEvent and JoyDeviceRemovedEvent #333
This is what I wrote in the BREAKING.md:
Split JoyDeviceEvent into JoyDeviceAddedEvent and JoyDeviceRemovedEvent, since Which field can contain different types of data (int or JoystickID).
And it can get quite wordy to list all the changes. Name changes are really important and should not be hidden. There will be a huge list of them in our case, all done in one commit.
Also I think Wine's sdl/joystick: Commit message
is better then our sdl: joystick: ...
. One character for path separator instead of two. ;)
Doing it every month is great for us, but forces others to use master branch if their issue is solved but not yet tagged.
Hmm you have a point. How about tagging a minor version for every issue that is resolved then? I think we'll have a reasonable number of tags that way and every tag will have a purpose behind it (e.g. every new tag is a new issue fixed!).
About the commit message prefix, I personally think ours is easier to read and more consistent when read in many lines. But I did ask my colleague and he also seems to prefer the slash version so maybe we can think about changing to that :joy:
As for the release note, we can use git log --oneline
or git shortlog
to start with and add on the details such as breaking changes or new stuff on top for the "Breaking Changes" and "What's New" sections. We might need to start squashing the commits into a single change though so it makes more sense when it's read on the log :stuck_out_tongue:
Perhaps we should start writing these guidelines down somewhere, maybe in MAINTAINING.md
file, and we keep revising it. After we're happy, we can start the v1.0 adventure!
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
$ vgo get rsc.io/quote@latest # default
$ vgo get rsc.io/quote@v1.3.0
$ vgo get rsc.io/quote@'<v1.6' # finds v1.5.2
There will be some compatibility bits for vgo in Go 1.11 (August 2018), nothing major. Though Youtube video description states:
Go 1.11 will add opt-in support for package versions.
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/v2
and so on. Each directory contains go.mod
file with package version and its dependencies version.
module "my/thing"
require (
"new/thing" v2.3.4
"old/thing" v1.2.3
)
exclude "old/thing" v1.2.3
replace "bad/thing" v1.4.5 => "good/thing" v1.4.5
master
, v2
, v3
and so on. Each branch root dir with go.mod
file.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.mod
file later on, once this is a part Go.
There is also this:
Preparing New Versions (
go release
) We want to encourage authors to issue tagged releases of their modules, so we need to make that as easy as possible. We intend to add a go release command that can take care of as much of the bookkeeping as needed. For example, it might:
Check for backwards-incompatible type changes, compared to the previous release. We run a check like this when working on the Go standard library, and it is very helpful.
Suggest whether this release should be a new point release or a new minor release (because there's new API or because many lines of code have changed). Or perhaps always suggest a new minor release unless the author asks for a point release, to keep a potential go get -p useful.
Scan all source files in the module, even ones that aren't normally built, to make sure that all imports can be satisfied by the requirements listed in go.mod. Referring back to the example in the download section, this check would make sure that logrus's go.mod lists x/sys.
As new best practices for releases arise, we can add them to go release so that authors always only have one step to check whether their module is ready for a new release.
Nice find! So I guess this means we won't be required to use gopkg.in for versioning in the future. The go release
command will also be quite handy to make sure we version correctly :smile:.
I'm also thinking to tag our current version as v0.3 just so we have some breathing space as we work towards v1.0. Breaking changes since v0.2 are getting pretty long. Do you have any objection? :thinking:
I'm also thinking to tag our current version as v0.3 just so we have some breathing space as we work towards v1.0.
This won't hurt, go for it. There is official dep
tool that can use them since go 1.6 and we are better off doing tagged releases once in a while.
Cool! I pushed v0.3 to the repository now.
I'm currently working on CHANGELOG.md
. Found this more or less popular standard Keep a Changelog.
Things to point out:
- sdl/render: Add
Renderer.GetLogicalSize()
,Texture.UpdateYUV()
(#264).
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.
// TODO
// TODO
BYTEORDER
.HintCallback
type and AddHintCallback()
, DelHintCallback()
functions.GetModState()
(#230).PIXELFORMAT_RGBA32
, PIXELFORMAT_ARGB32
, PIXELFORMAT_BGRA32
, PIXELFORMAT_ABGR32
.Renderer.GetLogicalSize()
, Texture.UpdateYUV()
(#264).sdl_mixer
, sdl_image
, sdl_ttf
to img
, mix
, ttf
.GFXPrimitiveSetFont()
to SetFont()
.GFXPrimitivesSetFontRotation()
to SetFontRotation()
.QuickLoad_WAV(mem unsafe.Pointer) (*Chunk, error)
to QuickLoad_WAV(mem []byte) (*Chunk, error)
.Update()
to JoystickUpdate()
.Renderer.GetRendererInfo(info *RendererInfo) error
to Renderer.GetInfo() (RendererInfo, error)
.Texture.Lock(rect *Rect, pixels *unsafe.Pointer, pitch *int) error
to Texture.Lock(rect *Rect) ([]byte, int, error)
.Texture.Update(rect *Rect, pixels unsafe.Pointer, pitch int) error
to Texture.Update(rect *Rect, pixels []byte, pitch int) error
.Renderer.GetRendererOutputSize()
to Renderer.GetOutputSize()
.GetFramecount()
to call SDL_getFramecount()
instead of SDL_getFramerate
(#258).SetFont()
segfault when passed a nil font data.min()
function used in many gfx
calculations.@malashin Oh I didn't see this! It looks great! I just finished writing the release note but perhaps I should write a Fixed section as well.
Wow, you did a lot :)
I like grouping of functions, structs and types.
UpdateYUV()
was a part of v0.2. It shows up in v0.3 most likely due to not squashed commits added, probably my first merged PR.
You're right, I found the commit as the last one in v0.2. Gonna remove that now :stuck_out_tongue:. Thanks for the tip!
JoyDeviceEvent is now split into JoyDeviceAddedEvent and JoyDeviceRemovedEvent
This was done because JoyDeviceEvent's Which can contain two different types:
Sint32 | which | the joystick device index for the SDL_JOYDEVICEADDED event or the instance id for the SDL_JOYDEVICEREMOVED event
For C it's doesn't matter, but in Go we can't have two different types in one struct field. Convenience has nothing to do with the change, JoyDeviceEvent contained wrong type of Which on addition of joystick device.
@malashin Gotcha! I've tweaked the description to be more correct.
Although on closer inspection, I wonder if any problem will be caused by having the type as int
instead of int32
? Specifically, I'm concerned about the extra 4 bytes because int
in Go is 8 bytes for 64-bit machines according to my knowledge.
@veeableful
Although on closer inspection, I wonder if any problem will be caused by having the type as
int
instead ofint32
? Specifically, I'm concerned about the extra 4 bytes becauseint
in Go is 8 bytes for 64-bit machines according to my knowledge.
Yes, this is the case. Go int
is 8 bytes on 64-bit, C int
is 4 bytes on 64-bit in most compilers (cgo included) for backwards compatibility. Running C.int(goint)
will change the size from 8 to 4 bytes on 64-bit.
So far we've changed it to int32
in all the rendering stuff, but left it as int
in places that return number of things, indexes or IDs. It more or less makes sense with how it is now and shouldn't cause any issues since all Go 64-bit ints are converted to 32-bit with C.int
.
Having consistency with int
types is nice, but not an easy decision if we should change them or not.
Though there is a problem of Go int
becoming -1
if it doesn't fit into int32
after running int32(int)
or C.int(int)
on it.
I've just found this issue https://github.com/campoy/flappy-gopher/issues/9.
This means that gopkg.in
won'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.
Yeah, that's true... I didn't think of that. I'll remove the note about it in README.md.
@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 importgopkg.in/veandco/go-sdl2.v0/sdl
Whenever a breaking change is committed we should increase the version via tags or a new branch.
If we are going to use gopkg.in then we need to decide if branches or tags are used for new versions.
go get gopkg.in/veandco/go-sdl2.v2
they will receive v2.1 in that case. And we should probably write what is actually changed in the release notes.