gop icon indicating copy to clipboard operation
gop copied to clipboard

Proposal: Remove the logic of using VERSION file to generate `gop version` or move it as the second choice after git tag

Open CarlJi opened this issue 1 year ago • 0 comments

Proposal

I am thinking that building source code without git installed should be pretty race scenario? if so, we can remove such logic since keeping it updated can be quite cumbersome.

Or move it as the second choice after git tag.

Background

The content of VERSION file is still v1.2.0-pre.1 now, which will result wrong version for gop if installing from source. Based on this logic: https://github.com/goplus/gop/blob/1d2550074c22b6722c3ee747bc12c00a19bd6cdc/cmd/make.go#L482

Related Logs:

➜  gop git:(main) cat VERSION
v1.2.0-pre.1
➜  gop git:(main) ./all.bash
+ go run cmd/make.go --install --regtest --autoproxy
Building Go+ tools...


Go+ tools built successfully!
Start Linking.
Link /Users/jicarl/goplus/gop/bin/gop to /Users/jicarl/gopath/bin/gop successfully.
Link /Users/jicarl/goplus/gop/bin/gopfmt to /Users/jicarl/gopath/bin/gopfmt successfully.
End linking.

Go+ tools installed successfully!

Start running regtests.
GenGo mixgo ...
GenGo mixgo-complex ...
GenGo overloadfunc1 ...
GenGo overloadfunc2 ...
GenGo overloadmethod ...
GenGo overloadop1 ...
GenGo overloadop2 ...
GenGo typeparamscast ...
GenGo unit-test ...
➜  gop git:(main) gop version
gop v1.2.0-pre.1 darwin/amd64

Workarounds

Remove VERSION file, and Run ./all.bash again, we can get the correct gop version as

➜  gop git:(main) rm VERSION
➜  gop git:(main) ✗ ./all.bash
+ go run cmd/make.go --install --regtest --autoproxy
Building Go+ tools...


Go+ tools built successfully!
Start Linking.
Link /Users/jicarl/goplus/gop/bin/gop to /Users/jicarl/gopath/bin/gop successfully.
Link /Users/jicarl/goplus/gop/bin/gopfmt to /Users/jicarl/gopath/bin/gopfmt successfully.
End linking.

Go+ tools installed successfully!

Start running regtests.
GenGo mixgo ...
GenGo mixgo-complex ...
GenGo overloadfunc1 ...
GenGo overloadfunc2 ...
GenGo overloadmethod ...
GenGo overloadop1 ...
GenGo overloadop2 ...
GenGo typeparamscast ...
GenGo unit-test ...
➜  gop git:(main) ✗ gop version
gop v1.2.0 devel darwin/amd64

CarlJi avatar Feb 02 '24 06:02 CarlJi