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

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

Closed
CarlJi opened this issue Feb 2, 2024 · 1 comment

Comments

@CarlJi
Copy link
Member

CarlJi commented Feb 2, 2024

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:

gop/cmd/make.go

Line 482 in 1d25500

versionFile := filepath.Join(gopRoot, "VERSION")

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 VERSIONgop 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
@xushiwei
Copy link
Member

xushiwei commented Mar 5, 2024

The VERSION file was mistakenly entered into the main branch, which is an incorrect state.

@xushiwei xushiwei closed this as completed Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants