AUR (en) - repoctl
yochananmarqos commented on 2020-09-01 15:34 (UTC)
duffydack commented on 2020-09-01 09:08 (UTC)
Confirm -3 builds fine. Only way I could build -2 was in a chroot (I use aurutils, but makepkg failed also)
cassava commented on 2020-09-01 08:54 (UTC) (edited on 2020-09-01 09:12 (UTC) by cassava)
Hey @johnramsden, thanks for the info. I've updated the PKGBUILD to leave out testing till I find out what the issue is. Could you tell me what the output of file /var/lib/pacman/sync/custom.db is?
cassava commented on 2020-09-01 08:52 (UTC)
@yochananmarqos: The local GOPATH variable is set in the build() function, is that sufficient? Or does it need to be in prepare()? With the settings as they are currently set, wouldn't everything be within the ${srcdir} and therefore a go clean is not necessary?
yochananmarqos commented on 2020-09-01 04:19 (UTC) (edited on 2020-09-01 04:22 (UTC) by yochananmarqos)
@cassava: Thanks. One thing you left out is using a local GOPATH and cleaning up afterward. If it's not set, it clutters the user's home directory. Sometimes ~/go/ cannot be removed without using sudo. If there are leftover files, makepkg -C fails because it can't remove them.
johnramsden commented on 2020-09-01 04:13 (UTC)
I'm getting the following errors when I try to build:
==> Starting check()...
? github.com/cassava/repoctl [no test files]
? github.com/cassava/repoctl/conf [no test files]
? github.com/cassava/repoctl/internal/term [no test files]
--- FAIL: TestReadAllSyncDatabases (0.53s)
read-db_test.go:61: unexpected error: read database /var/lib/pacman/sync/custom.db: unknown compression codec
read-db_test.go:81: package 'a' not found in database
[SNIP]
read-db_test.go:81: package 'z' not found in database
read-db_test.go:87: database size mismatch: expected 11239, got 0
FAIL
FAIL github.com/cassava/repoctl/pacman 0.558s
ok github.com/cassava/repoctl/pacman/alpm 5.951s
ok github.com/cassava/repoctl/pacman/aur 2.396s
? github.com/cassava/repoctl/pacman/graph [no test files]
? github.com/cassava/repoctl/pacman/meta [no test files]
? github.com/cassava/repoctl/pacman/pkgutil [no test files]
? github.com/cassava/repoctl/repo [no test files]
? github.com/cassava/repoctl/shortry [no test files]
FAIL
==> ERROR: A failure occurred in check().
cassava commented on 2020-08-31 19:53 (UTC)
Thanks for the heads-up yochananmarqos! I've implemented most of your suggestions after cross-referencing the Go package guidelines. Main deviation is that I use -mod=vendor to prevent the need for downloading all the dependencies a second time.
yochananmarqos commented on 2020-08-31 18:37 (UTC)
Using a local Go cache and updated build for new Go package guidelines:
prepare() {
export GOPATH="$srcdir/gopath"
go clean -modcache
}
build() {
cd "$pkgname-$pkgver"
export CGO_CPPFLAGS="${CPPFLAGS}"
export CGO_CFLAGS="${CFLAGS}"
export CGO_CXXFLAGS="${CXXFLAGS}"
export CGO_LDFLAGS="${LDFLAGS}"
export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
go build -v -o "$pkgname"
# Generate the completion files
./repoctl completion zsh > completion.zsh
./repoctl completion bash > completion.bash
./repoctl completion fish > completion.fish
go clean -modcache
}
cassava commented on 2020-01-03 21:46 (UTC)
Hey guys, the newest version of repoctl should resolve the problems with Zstd. Sorry about that! (Will investigate it further to prevent such things causing issues in the future, as soon as I find the time. But for now, it should work.)
Also, thanks for the advice yochanmarqos, I'll see if I can implement this soon.
yochananmarqos commented on 2020-01-01 23:53 (UTC) (edited on 2020-07-24 15:41 (UTC) by yochananmarqos)
No need for both ln and mv when it can be done in one command:
prepare() {
mkdir -p gopath/src/github.com/cassava
ln -rTsf "$pkgname-$pkgver" \
"gopath/src/github.com/cassava/$pkgname"
}
Please use the updated Go package guidelines.
Do not use the !strip option; in fact the binary needs to be stripped of the build path using the -trimpath flags:
build() {
export GOPATH="$srcdir"
cd "gopath/src/github.com/cassava/$pkgname/cmd/$pkgname"
go build \
-trimpath \
-buildmode=pie \
-ldflags "-extldflags \"${LDFLAGS}\"" \
-v .
cd "$srcdir/gopath/src/github.com/cassava/$pkgname/cmd/repols"
go build \
-trimpath \
-buildmode=pie \
-ldflags "-extldflags \"${LDFLAGS}\"" \
-v .
}
@cassava: What you have now is fine, really. The cleaning before and after is mainly to make sure
makepkg -Cworks even if the build fails.