build issues for package managers
- Dominant language
- Go
- Stars
- 9.5k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
Hello,
I maintain the cfssl package on Gentoo Linux and I am running into a couple of small issues I am patching around to get our package manager to build cfssl.
The first is the way VERSION is set in the makefile. This doesn't work if you try to download the archive and build from there, which is what our package manager does. For example:
```
$ cd /tmp
$ wget https://github.com/cloudflare/cfssl/archive/v1.4.1.tar.gz
$ tar -xf v1.4.1.tar.gz
$ cd cfssl-1.4.1
$ make
fatal: not a git repository (or any of the parent directories): .git
go build -ldflags "-s -w -X github.com/cloudflare/cfssl/cli/version.version=" -o bin/cfssl ./cmd/cfssl
go build -ldflags "-s -w -X github.com/cloudflare/cfssl/cli/version.version=" -o bin/cfssl-bundle ./cmd/cfssl-bundle
go build -ldflags "-s -w -X github.com/cloudflare/cfssl/cli/version.version=" -o bin/cfssl-certinfo ./cmd/cfssl-certinfo
go build -ldflags "-s -w -X github.com/cloudflare/cfssl/cli/version.version=" -o bin/cfssl-newkey ./cmd/cfssl-newkey
go build -ldflags "-s -w -X github.com/cloudflare/cfssl/cli/version.version=" -o bin/cfssl-scan ./cmd/cfssl-scan
go build -ldflags "-s -w -X github.com/cloudflare/cfssl/cli/version.version=" -o bin/cfssljson ./cmd/cfssljson
go build -ldflags "-s -w -X github.com/cloudflare/cfssl/cli/version.version=" -o bin/mkbundle ./cmd/mkbundle
go build -ldflags "-s -w -X github.com/cloudflare/cfssl/cli/version.version=" -o bin/multirootca ./cmd/multirootca
$
```
I can pass VERSION= into the makefile, but that doesn't eliminat the attempt to run git and get a version from there:
```
$ make VERSION=1.4.1
fatal: not a git repository (or any of the parent directories): .git
go build -ldflags "-s -w -X github.com/cloudflare/cfssl/cli/version.version=1.4.1" -o bin/cfssl ./cmd/cfssl
...
$
```
The second issue is the use of -s and -w in LDFLAGS.
Normally stripping is handled by the package manager itself, so these options should not be the default.
I have a patch which definitely cannot be submitted to you because it is a hack,, but I was wondering if we can come up with a way of fixing these issues for everyone.
Thanks,
William
Contributor guide
Assessment
This issue has not been assessed yet.