Skip to content

Add fake-git.sh script to embed version information #155

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tianon
Copy link
Owner

@tianon tianon commented Jan 22, 2025

This requires Go 1.24+ (golang/go#50603), but allows us to embed the (semver-mangled 🙃💩) version of gosu in the standard Go metadata such that scanning tools can pick up the version of gosu directly.

In theory, this will enable us to publish official VEX statements for gosu in a way that scanning tools can actually consume and match correctly.

$ go version -m ./gosu-amd64
./gosu-amd64: go1.24rc2
	path	github.com/tianon/gosu
	mod	github.com/tianon/gosu	v1.17.0
	dep	github.com/moby/sys/user	v0.1.0	h1:WmZ93f5Ux6het5iituh9x2zAG7NFY9Aqi49jjE1PaQg=
	dep	golang.org/x/sys	v0.1.0	h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U=
	build	-buildmode=exe
	build	-compiler=gc
	build	-trimpath=true
	build	DefaultGODEBUG=asynctimerchan=1,gotestjsonbuildtext=1,gotypesalias=0,httplaxcontentlength=1,httpmuxgo121=1,httpservecontentkeepheaders=1,multipathtcp=0,panicnil=1,randseednop=0,rsa1024min=0,tls10server=1,tls3des=1,tlsmlkem=0,tlsrsakex=1,tlsunsafeekm=1,winreadlinkvolume=0,winsymlink=0,x509keypairleaf=0,x509negativeserial=1,x509rsacrt=0,x509usepolicies=0
	build	CGO_ENABLED=0
	build	GOARCH=amd64
	build	GOOS=linux
	build	GOAMD64=v1
	build	vcs=git
	build	vcs.revision=1.17
	build	vcs.time=1970-01-01T00:00:00Z
	build	vcs.modified=false

@lart2150
Copy link

with 1.24.2 out I think it would make sense to move off the RC version.

This requires Go 1.24+, but allows us to embed the (semver-mangled 🙃💩) version of `gosu` in the standard Go metadata such that scanning tools can pick up the version of `gosu` directly.

In theory, this will enable us to publish official VEX statements for `gosu` in a way that scanning tools can actually consume and match correctly.

```console
$ go version -m ./gosu-amd64
./gosu-amd64: go1.24rc2
	path	github.com/tianon/gosu
	mod	github.com/tianon/gosu	v1.17.0
	dep	github.com/moby/sys/user	v0.1.0	h1:WmZ93f5Ux6het5iituh9x2zAG7NFY9Aqi49jjE1PaQg=
	dep	golang.org/x/sys	v0.1.0	h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U=
	build	-buildmode=exe
	build	-compiler=gc
	build	-trimpath=true
	build	DefaultGODEBUG=asynctimerchan=1,gotestjsonbuildtext=1,gotypesalias=0,httplaxcontentlength=1,httpmuxgo121=1,httpservecontentkeepheaders=1,multipathtcp=0,panicnil=1,randseednop=0,rsa1024min=0,tls10server=1,tls3des=1,tlsmlkem=0,tlsrsakex=1,tlsunsafeekm=1,winreadlinkvolume=0,winsymlink=0,x509keypairleaf=0,x509negativeserial=1,x509rsacrt=0,x509usepolicies=0
	build	CGO_ENABLED=0
	build	GOARCH=amd64
	build	GOOS=linux
	build	GOAMD64=v1
	build	vcs=git
	build	vcs.revision=1.17
	build	vcs.time=1970-01-01T00:00:00Z
	build	vcs.modified=false
```
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

Successfully merging this pull request may close these issues.

2 participants