FiloSottile / age

A simple, modern and secure encryption tool (and Go library) with small explicit keys, no config options, and UNIX-style composability.
https://age-encryption.org
BSD 3-Clause "New" or "Revised" License
17.35k stars 511 forks source link

brew install: not a tagged release #542

Closed dolmen closed 5 months ago

dolmen commented 9 months ago

When installing age on MacOS using Homebrew, the installed binary was not built from a tagged release. As a result go version -m applied to the binary reports (devel) as the version instead of v1.1.1.

$ brew install age
...
==> Pouring age--1.1.1.arm64_sonoma.bottle.tar.gz
🍺  /opt/homebrew/Cellar/age/1.1.1: 9 files, 7.2MB
...
$ go version -m $(which age)
/opt/homebrew/bin/age: go1.21.1
    path    filippo.io/age/cmd/age
    mod filippo.io/age  (devel) 
    dep filippo.io/edwards25519 v1.0.0  h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek=
    dep golang.org/x/crypto v0.4.0  h1:UVQgzMY87xqpKNgb+kDsll2Igd33HszWHFLmpaRMq/8=
    dep golang.org/x/sys    v0.3.0  h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ=
    dep golang.org/x/term   v0.3.0  h1:qoo4akIqOcDME5bhc/NgxUdovd6BSS2uMsVjB56q1xI=
    build   -buildmode=exe
    build   -compiler=gc
    build   -trimpath=true
    build   DefaultGODEBUG=panicnil=1
    build   CGO_ENABLED=1
    build   GOARCH=arm64
    build   GOOS=darwin
FiloSottile commented 5 months ago

We don't control the age Formula, so this would be a homebrew-core issue, but I also understand it applies to all Go binaries they build.

It's actually kind of hard to install from a checked out tree (as opposed to "go install foo@version") while preserving the version. This is https://github.com/golang/go/issues/50603.