opnsense / ports

OPNsense ports on top of FreeBSD
https://opnsense.org/
Other
157 stars 112 forks source link

www/caddy-custrom: Tether www/caddy_custom build version to www/caddy #198

Closed Monviech closed 2 months ago

Monviech commented 2 months ago

Fixes: https://github.com/opnsense/ports/issues/197

Tether caddy_custom build version to caddy_version, to prevent xcaddy pulling latest caddy version before the tracked distversion www/caddy has been upgraded.

A version tag consists always of three numbers + v. Since CADDY_VERSION can include more numbers, it's not valid to use it straightly without extracting only the first three numbers.

Example: Currently it has 2.7.6.6 But only this tag is valid: v2.7.6

Version tag always have three numbers, latest is 2.8.0 and 2.8.1.

Logs with new Makefile:

[20240531055601] ===> Building for caddy-custom-2.7.6.6.0.4.1.1_17
/bin/mkdir -p /usr/obj/usr/ports/www/caddy-custom/work/caddy-custom-2.7.6.6.0.4.1.1
cd /usr/obj/usr/ports/www/caddy-custom/work/caddy-custom-2.7.6.6.0.4.1.1 && XCADDY_WHICH_GO="/usr/local/bin/go121"  XCADDY_GO_BUILD_FLAGS="-buildmode=exe -v -trimpath -ldflags=-s -buildvcs=false" /usr/local/bin/xcaddy build v2.7.6 --with github.com/caddyserver/ntlm-transport@e0c1e46a30093fa243d06a83964da5573ee6a51f --with github.com/mholt/caddy-dynamicdns@012a1d4347472eaf4b78826b86c8f35bda919f72
2024/05/31 05:56:01 [INFO] absolute output file path: /usr/obj/usr/ports/www/caddy-custom/work/caddy-custom-2.7.6.6.0.4.1.1/caddy
2024/05/31 05:56:01 [INFO] Temporary folder: /tmp/buildenv_2024-05-31-0556.3169768182
2024/05/31 05:56:01 [INFO] Writing main module: /tmp/buildenv_2024-05-31-0556.3169768182/main.go
package main

import (
        caddycmd "github.com/caddyserver/caddy/v2/cmd"

        // plug in Caddy modules here
        _ "github.com/caddyserver/caddy/v2/modules/standard"
        _ "github.com/caddyserver/ntlm-transport"
        _ "github.com/mholt/caddy-dynamicdns"
)

func main() {
        caddycmd.Main()
}
2024/05/31 05:56:01 [INFO] Initializing Go module
2024/05/31 05:56:01 [INFO] exec (timeout=0s): /usr/local/bin/go121 mod init caddy 
go: creating new go.mod: module caddy
go: to add module requirements and sums:
        go mod tidy
2024/05/31 05:56:01 [INFO] Pinning versions
2024/05/31 05:56:01 [INFO] exec (timeout=0s): /usr/local/bin/go121 get -d -v -buildmode=exe -v -trimpath -ldflags=-s -buildvcs=false github.com/caddyserver/caddy/v2@v2.7.6 
go: downloading github.com/caddyserver/caddy/v2 v2.7.6
go: downloading github.com/caddyserver/certmagic v0.20.0

2024/05/31 05:58:31 [INFO] Build complete: ./caddy
2024/05/31 05:58:31 [INFO] Cleaning up temporary folder: /tmp/buildenv_2024-05-31-0556.3169768182
[20240531055831] ===> Staging for caddy-custom-2.7.6.6.0.4.1.1_17
[20240531055831] ===> Generating temporary packing list
install  -s -m 555 /usr/obj/usr/ports/www/caddy-custom/work/caddy-custom-2.7.6.6.0.4.1.1/caddy /usr/obj/usr/ports/www/caddy-custom/work/stage/usr/local/bin
[20240531055831] ====> Compressing man pages (compress-man)
[20240531055831] ===> Staging rc.d startup script(s)
[20240531055831] ===> Installing for caddy-custom-2.7.6.6.0.4.1.1_17
[20240531055831] ===> Checking if caddy-custom is already installed
[20240531055831] ===> Registering installation for caddy-custom-2.7.6.6.0.4.1.1_17
Installing caddy-custom-2.7.6.6.0.4.1.1_17...
Creating package for caddy-custom-2.7.6.6.0.4.1.1_17
fichtner commented 2 months ago

We can take this upstream, possibly try to lose the PORTREVISION from the caddy version.. it's doable if the maintainer commits it with an update of www/caddy to a new version which then won't run the risk of caddy-custom version going backwards.

fichtner commented 2 months ago

Sorry I messed up the merge here and had to force push to 58e93c8775ffd

Monviech commented 2 months ago

Who will take this upstream? I made an account at the bugzilla of freebsd sometime ago but I'm a little uncertain how it works. If I can see how you would do it I could learn from it.

fichtner commented 2 months ago

Can you add a ticket there with the problem description. I'll upload a patch for them with the state that I think it should have in the future. Ok?