galene icon indicating copy to clipboard operation
galene copied to clipboard

Show the version in the gui

Open gedw99 opened this issue 4 years ago • 13 comments

Noticed a lot of small bugs from people being reported.

Mit might be a good idea to have a page or something that shows:

Version of build ( githash ) User agent

you could even add a button that creates an issue and passes that data perhaps but that maybe not needed.

gedw99 avatar Oct 02 '21 11:10 gedw99

Yes, it would be a good idea. It should also be shown at startup.

Unfortunately, I don't think it is possible with current versions of Go. The runtime/debug.BuildInfo function does not return useful information about the main module, only about dependencies. So I don't know how to do that in a portable way (recall that Galene builds fine on Windows, which does not necessarily have make or a sane shell).

jech avatar Oct 02 '21 12:10 jech

In Go-1.18, due in December, runtime/debug.BuildInfo provides information about the git hash from which Galene has been built. Perhaps something can be done with that, at least when Galene is built from a Git repository.

jech avatar Oct 30 '21 19:10 jech

Just have a version.go file

and at compile time populate it

it a very common pattern used in golang .

ld flags can also be used but I don’t think you can read them at runtime.

gedw99 avatar Oct 31 '21 09:10 gedw99

@gedw99 I could be wrong, but I don't think that go build supports running arbitrary code at build time. How do you suggest the version.go file should be generated?

jech avatar Oct 31 '21 12:10 jech

Found this about auto build versioning, seems to answer the question : https://www.atatus.com/blog/golang-auto-build-versioning/

UnSeulT avatar Nov 16 '21 14:11 UnSeulT

Please add me to this issue. It would be nice to see a human readable version, either in the GUI or on the command line at start up. It makes raising issues, and you debugging them, much easier.

cvmiller avatar Nov 30 '21 20:11 cvmiller

@jech here is an example: https://github.com/alda-lang/alda/blob/master/client/gen/version/main.go

i only had time to have a brief look. Maybe it helps !!

gedw99 avatar Nov 30 '21 22:11 gedw99

Alda is compiled using a Unix script:

https://github.com/alda-lang/alda/blob/master/client/bin/build

That script runs the code that you point at to generate the version file at compile time. This makes Alda impossible to cross-compile, at least out of the box, and impossible to build under Windows.

Compare this with Galene, which cross-compiles easily and builds under Windows without requiring a compatible shell.

jech avatar Dec 01 '21 23:12 jech

hey @jech

ah i see. Ok maybe this helps : https://github.com/oligot/go-mod-upgrade/issues/19

gedw99 avatar Dec 09 '21 14:12 gedw99

Ok maybe this helps : oligot/go-mod-upgrade#19

This seems to depend on Taskfile. Let me stress once again that Galene can be built using just go build, and I like it that way.

jech avatar Dec 09 '21 19:12 jech

@jech i dont think it is dependent on Task file.

https://github.com/oligot/go-mod-upgrade does not have one.

gedw99 avatar Dec 09 '21 20:12 gedw99

Waiting on https://github.com/golang/go/issues/50603.

jech avatar Jul 16 '22 15:07 jech

I used this: https://github.com/greenpau/versioned

Will try to make a PR, but got some issues with runtime at the moment with Caddy Reverse proxy and auth.

gedw99 avatar Nov 09 '23 17:11 gedw99