pkgbuild: add GOFLAGS for rw modecache, pie

Fixes a few namcap complaints and allows a standard rm -rf to clean the
go modcache. Also ensure go does not attempt to update the go.mod file
during the build.
This commit is contained in:
Paul Stemmet 2024-02-04 20:49:02 +00:00
parent 9b1253314c
commit 100085c886
Signed by: Paul Stemmet
GPG Key ID: EDEA539F594E7E75
2 changed files with 5 additions and 2 deletions

View File

@ -1,7 +1,7 @@
pkgbase = docker-credential-vault-login pkgbase = docker-credential-vault-login
pkgdesc = Docker Credential Helper for Vault-stored Credentials pkgdesc = Docker Credential Helper for Vault-stored Credentials
pkgver = 0.3.47 pkgver = 0.3.47
pkgrel = 1 pkgrel = 2
url = https://github.com/morningconsult/docker-credential-vault-login url = https://github.com/morningconsult/docker-credential-vault-login
arch = x86_64 arch = x86_64
license = Apache-2.0 license = Apache-2.0

View File

@ -3,7 +3,7 @@
pkgname=docker-credential-vault-login pkgname=docker-credential-vault-login
pkgdesc='Docker Credential Helper for Vault-stored Credentials' pkgdesc='Docker Credential Helper for Vault-stored Credentials'
pkgver=0.3.47 pkgver=0.3.47
pkgrel=1 pkgrel=2
_commit='ee4808152406c315faa5e78281ab93b97eb2c218' _commit='ee4808152406c315faa5e78281ab93b97eb2c218'
arch=('x86_64') arch=('x86_64')
url='https://github.com/morningconsult/docker-credential-vault-login' url='https://github.com/morningconsult/docker-credential-vault-login'
@ -26,6 +26,8 @@ prepare() {
# download dependencies # download dependencies
export GOPATH="${srcdir}" export GOPATH="${srcdir}"
export GOFLAGS="-mod=readonly -modcacherw -buildmode=pie"
go mod download go mod download
} }
@ -37,6 +39,7 @@ build() {
export CGO_CFLAGS="${CFLAGS}" export CGO_CFLAGS="${CFLAGS}"
export CGO_CXXFLAGS="${CXXFLAGS}" export CGO_CXXFLAGS="${CXXFLAGS}"
export GOPATH="${srcdir}" export GOPATH="${srcdir}"
export GOFLAGS="-mod=readonly -modcacherw -buildmode=pie"
./scripts/build-binary.sh \ ./scripts/build-binary.sh \
"v${pkgver}" \ "v${pkgver}" \