Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show the version in the gui #114

Open
gedw99 opened this issue Oct 2, 2021 · 13 comments
Open

Show the version in the gui #114

gedw99 opened this issue Oct 2, 2021 · 13 comments

Comments

@gedw99
Copy link

gedw99 commented Oct 2, 2021

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.

@jech
Copy link
Owner

jech commented Oct 2, 2021

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
Copy link
Owner

jech commented Oct 30, 2021

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.

@gedw99
Copy link
Author

gedw99 commented Oct 31, 2021

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.

@jech
Copy link
Owner

jech commented Oct 31, 2021

@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?

@UnSeulT
Copy link
Contributor

UnSeulT commented Nov 16, 2021

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

@cvmiller
Copy link

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.

@gedw99
Copy link
Author

gedw99 commented Nov 30, 2021

@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 !!

@jech
Copy link
Owner

jech commented Dec 1, 2021

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.

@gedw99
Copy link
Author

gedw99 commented Dec 9, 2021

hey @jech

ah i see. Ok maybe this helps : oligot/go-mod-upgrade#19

@jech
Copy link
Owner

jech commented Dec 9, 2021

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.

@gedw99
Copy link
Author

gedw99 commented Dec 9, 2021

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

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

@jech
Copy link
Owner

jech commented Jul 16, 2022

Waiting on golang/go#50603.

@gedw99
Copy link
Author

gedw99 commented Nov 9, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants