[V2][ARCHLINUX][AUR] Unable to build and install Caddy V2

[developer@code-server-fs caddy2]$ makepkg -si
==> Making package: caddy2 2.1.1-7 (Thu Aug 20 16:47:10 2020)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Updating caddy git repo...
Fetching origin
  -> Found index-a509155e3cff18af793f6af5f930a71c89e05df8.html
  -> Found caddy.service
  -> Found caddy-api.service
  -> Found caddy.tmpfiles
  -> Found caddy.sysusers
  -> Found caddy.conf
  -> Found Caddyfile
==> Validating source files with sha512sums...
    caddy ... Skipped
    index-a509155e3cff18af793f6af5f930a71c89e05df8.html ... Passed
    caddy.service ... Passed
    caddy-api.service ... Passed
    caddy.tmpfiles ... Passed
    caddy.sysusers ... Passed
    caddy.conf ... Passed
    Caddyfile ... Passed
==> Verifying source file signatures with gpg...
    caddy git repo ... Passed
==> Extracting sources...
  -> Creating working copy of caddy git repo...
Reset branch 'makepkg'
==> Starting prepare()...
==> Removing existing $pkgdir/ directory...
==> Starting build()...
# caddy
go.constinfo.syscall: bad reloc size 0x84 for go.info.int
go.constinfo.syscall: unsupported obj reloc 29 (R_DWARFSECREF)/132 to go.info.int
==> ERROR: A failure occurred in build().

I only made one edit to the PKG build so that this log wouldnt be a total nightmare

@@ -44,7 +44,7 @@ prepare() {

 build() {
   cd "${_pkgname}/cmd/caddy/"
-  export GOPATH="$srcdir"/gopath
+  #export GOPATH="$srcdir"/gopath
   export CGO_LDFLAGS="${LDFLAGS}"
   export CGO_CFLAGS="${CFLAGS}"

uname -a
Linux code-server-fs 5.4.54-1-lts #1 SMP Wed, 29 Jul 2020 21:38:41 +0000 x86_64 GNU/Linux

The CPU is 64bit and running Linux,
AMD Phenom II X2 521 (2) @ 3.500GHz

Honestly, why dont you guys just have your PKGBUILD download latest release from github via a shell script instead of building it from source, and have the source code version be called caddy2-git like the rest of programs built from source?

The Arch package isn’t officially maintained by the Caddy team. It’s maintained by members of the Arch community.

I have no idea what’s going on in those logs, I don’t find it clear what’s going on.

I’m also not really sure what you’re asking for here. My understanding of Arch is that packages are typically scripts for building from source on your own machine, but feel free to correct me if that’s not a correct assumption.

If you want to your own build, I recommend following the steps described here, using xcaddy:

you are half right, they are just scripts that define a package install method. This can be running a makefile and packaging it, or just downloading a binary and installing it,

All of the packages on the main repos, are prebuilt, so they are just a pkg.tar.gz file,
All of the packages on the AUR are a git repo with a pkgbuild file, which defines how do download and install the rest of it, this method allows the AUR to exist without having a whole new git service for people to use. they can jsut write a pkgbuild that downloads their repo, and builds.

Normally on the aur you have two types of packages, sourcecode and prebuilt,
most prebuilts are simply just downloading a prebuilt binary from somewhere (this can litterally be anywhere), and are titled package or package-bin

Sourcecode generally are titled package-git and compile the package on the machine itself, this is what the current aur package for caddy2 is,

I would reccomend getting the maintainer of the current aur package to seperate into caddy2-bin and caddy2-git

This topic was automatically closed after 30 days. New replies are no longer allowed.