Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i just noticed this another behavior on @latest vs @master #201

Closed
ta2013 opened this issue Sep 11, 2024 · 8 comments
Closed

i just noticed this another behavior on @latest vs @master #201

ta2013 opened this issue Sep 11, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@ta2013
Copy link

ta2013 commented Sep 11, 2024

i just noticed this another behavior on @latest vs @master:

with same cmd:
xcaddy build --output ./caddy/caddy --with github.com/caddyserver/caddy/v2=./caddy

On @latest: its building OK with those info about using local caddy folder:
go: to add module requirements and sums:
go mod tidy
2024/09/11 08:15:08 [INFO] Replace github.com/caddyserver/caddy/v2 => /home/dev/caddy
2024/09/11 08:15:08 [INFO] exec (timeout=0s): /usr/bin/go mod edit -replace github.com/caddyserver/caddy/v2=/home/dev/caddy
2024/09/11 08:15:08 [INFO] Pinning versions

On @master: it has no above infor about replacing local caddy folder, and finally binary has no modify

Do i using wrong or some issues?

Thanks!

@mohammed90
Copy link
Member

mohammed90 commented Sep 11, 2024

Can you clarify with more details? The command you shared doesn't have the version specified. How are you specifying the version? Also, why are you doing a --with?

@ta2013
Copy link
Author

ta2013 commented Sep 11, 2024

i was trying xcaddy at branch @latest or @master

@latest :
go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest

@master:
go install github.com/caddyserver/xcaddy/cmd/xcaddy@master

then each xcaddy version, i tried build my custom caddy, and got above behavior.

@mohammed90
Copy link
Member

I see what you're saying now. We missed carrying over replacements from --with when #174 was implemented. Thanks for the report and for using @master xcaddy 😀

@mohammed90 mohammed90 added the bug Something isn't working label Sep 11, 2024
@ta2013
Copy link
Author

ta2013 commented Sep 11, 2024

@mohammed90 i am trying that b72e330, got this error with cmd:
cmd: xcaddy build --with github.com/porech/caddy-maxmind-geolocation

the error:

panic: runtime error: slice bounds out of range [:1073741920] with capacity 5262418

goroutine 1 [running]:
cmd/internal/goobj.(*Reader).StringAt(...)
cmd/internal/goobj/objfile.go:658
cmd/internal/goobj.(*Sym).Name(...)
cmd/internal/goobj/objfile.go:319
cmd/link/internal/loader.(*loadState).preloadSyms(0xc00012d5b0, 0xc0011dd300, 0x0)
cmd/link/internal/loader/loader.go:2192 +0x9a7
cmd/link/internal/loader.(*Loader).LoadSyms(0xc000004708, 0x903380)
cmd/link/internal/loader/loader.go:2251 +0x1fc
cmd/link/internal/ld.(*Link).loadlib(0xc000160200)
cmd/link/internal/ld/lib.go:598 +0x469
cmd/link/internal/ld.Main(_, {0x20, 0x20, 0x1, 0x7, 0x10, 0x0, {0xc0000124f1, 0x1, 0x1}, ...})
cmd/link/internal/ld/main.go:354 +0x12cb
main.main()
cmd/link/main.go:72 +0xddb
2024/09/11 19:12:54 [INFO] Cleaning up temporary folder: /tmp/buildenv_2024-09-11-1912.3145276277
2024/09/11 19:12:54 [FATAL] exit status 1

@mohammed90
Copy link
Member

mohammed90 commented Sep 11, 2024

This is not coming from xcaddy, but appears to be from the Go linker. That said, please share the full, unredacted log.

Edit: I guess this is related: porech/caddy-maxmind-geolocation#20

@ta2013
Copy link
Author

ta2013 commented Sep 11, 2024

Hi, here is full log:

xcaddy build --with github.com/porech/caddy-maxmind-geolocation�����2024/09/11 19:39:40 [INFO] absolute output file path: /home/dev/caddy
2024/09/11 19:39:40 [INFO] Temporary folder: /tmp/buildenv_2024-09-11-1939.4026110036
2024/09/11 19:39:40 [INFO] Writing main module: /tmp/buildenv_2024-09-11-1939.4026110036/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/porech/caddy-maxmind-geolocation"

)

func main() {
caddycmd.Main()
}
2024/09/11 19:39:40 [INFO] Initializing Go module
2024/09/11 19:39:40 [INFO] exec (timeout=0s): /usr/bin/go mod init caddy
go: creating new go.mod: module caddy
go: to add module requirements and sums:
go mod tidy
2024/09/11 19:39:40 [INFO] Pinning versions
2024/09/11 19:39:40 [INFO] exec (timeout=0s): /usr/bin/go get -v github.com/caddyserver/caddy/v2
go: added github.com/beorn7/perks v1.0.1
go: added github.com/caddyserver/caddy/v2 v2.8.4
go: added github.com/caddyserver/certmagic v0.21.3
go: added github.com/caddyserver/zerossl v0.1.3
go: added github.com/cespare/xxhash/v2 v2.2.0
go: added github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572
go: added github.com/google/pprof v0.0.0-20231212022811-ec68065c825e
go: added github.com/google/uuid v1.6.0
go: added github.com/klauspost/cpuid/v2 v2.2.7
go: added github.com/libdns/libdns v0.2.2
go: added github.com/mholt/acmez/v2 v2.0.1
go: added github.com/miekg/dns v1.1.59
go: added github.com/onsi/ginkgo/v2 v2.13.2
go: added github.com/prometheus/client_golang v1.19.1
go: added github.com/prometheus/client_model v0.5.0
go: added github.com/prometheus/common v0.48.0
go: added github.com/prometheus/procfs v0.12.0
go: added github.com/quic-go/qpack v0.4.0
go: added github.com/quic-go/quic-go v0.44.0
go: added github.com/zeebo/blake3 v0.2.3
go: added go.uber.org/mock v0.4.0
go: added go.uber.org/multierr v1.11.0
go: added go.uber.org/zap v1.27.0
go: added go.uber.org/zap/exp v0.2.0
go: added golang.org/x/crypto v0.23.0
go: added golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842
go: added golang.org/x/mod v0.17.0
go: added golang.org/x/net v0.25.0
go: added golang.org/x/sync v0.7.0
go: added golang.org/x/sys v0.20.0
go: added golang.org/x/term v0.20.0
go: added golang.org/x/text v0.15.0
go: added golang.org/x/time v0.5.0
go: added golang.org/x/tools v0.21.0
go: added google.golang.org/protobuf v1.34.1
2024/09/11 19:39:41 [INFO] exec (timeout=0s): /usr/bin/go get -v github.com/porech/caddy-maxmind-geolocation github.com/caddyserver/caddy/v2
go: accepting indirect upgrade from github.com/cespare/xxhash/[email protected] to v2.3.0
go: accepting indirect upgrade from github.com/google/[email protected] to v0.0.0-20240727154555-813a5fbdbec8
go: accepting indirect upgrade from github.com/klauspost/cpuid/[email protected] to v2.2.8
go: accepting indirect upgrade from github.com/miekg/[email protected] to v1.1.61
go: accepting indirect upgrade from github.com/onsi/ginkgo/[email protected] to v2.19.1
go: accepting indirect upgrade from github.com/prometheus/[email protected] to v0.6.1
go: accepting indirect upgrade from github.com/prometheus/[email protected] to v0.55.0
go: accepting indirect upgrade from github.com/prometheus/[email protected] to v0.15.1
go: accepting indirect upgrade from github.com/quic-go/[email protected] to v0.46.0
go: accepting indirect upgrade from golang.org/x/[email protected] to v0.26.0
go: accepting indirect upgrade from golang.org/x/[email protected] to v0.0.0-20240719175910-8a7402abbf56
go: accepting indirect upgrade from golang.org/x/[email protected] to v0.20.0
go: accepting indirect upgrade from golang.org/x/[email protected] to v0.28.0
go: accepting indirect upgrade from golang.org/x/[email protected] to v0.8.0
go: accepting indirect upgrade from golang.org/x/[email protected] to v0.23.0
go: accepting indirect upgrade from golang.org/x/[email protected] to v0.23.0
go: accepting indirect upgrade from golang.org/x/[email protected] to v0.17.0
go: accepting indirect upgrade from golang.org/x/[email protected] to v0.6.0
go: accepting indirect upgrade from golang.org/x/[email protected] to v0.24.0
go: accepting indirect upgrade from google.golang.org/[email protected] to v1.34.2
go: upgraded github.com/Masterminds/semver/v3 v3.2.0 => v3.2.1
go: upgraded github.com/Microsoft/go-winio v0.6.0 => v0.6.2
go: upgraded github.com/antlr4-go/antlr/v4 v4.13.0 => v4.13.1
go: upgraded github.com/cespare/xxhash/v2 v2.2.0 => v2.3.0
go: upgraded github.com/cpuguy83/go-md2man/v2 v2.0.3 => v2.0.4
go: upgraded github.com/dgraph-io/ristretto v0.1.0 => v0.1.1
go: upgraded github.com/go-sql-driver/mysql v1.7.1 => v1.8.1
go: added github.com/go-task/slim-sprig/v3 v3.0.0
go: upgraded github.com/golang/glog v1.2.0 => v1.2.2
go: upgraded github.com/google/cel-go v0.20.1 => v0.21.0
go: upgraded github.com/google/pprof v0.0.0-20231212022811-ec68065c825e => v0.0.0-20240727154555-813a5fbdbec8
go: upgraded github.com/huandu/xstrings v1.3.3 => v1.5.0
go: upgraded github.com/imdario/mergo v0.3.12 => v0.3.16
go: upgraded github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a => v0.0.0-20240606120523-5a60cdf6a761
go: added github.com/jackc/pgx/v5 v5.6.0
go: added github.com/jackc/puddle/v2 v2.2.1
go: upgraded github.com/klauspost/compress v1.17.8 => v1.17.9
go: upgraded github.com/klauspost/cpuid/v2 v2.2.7 => v2.2.8
go: upgraded github.com/miekg/dns v1.1.59 => v1.1.61
go: added github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822
go: upgraded github.com/onsi/ginkgo/v2 v2.13.2 => v2.19.1
go: added github.com/oschwald/maxminddb-golang v1.13.1
go: added github.com/porech/caddy-maxmind-geolocation v0.0.0-20240808060618-c7dd9b5c8231
go: upgraded github.com/prometheus/client_model v0.5.0 => v0.6.1
go: upgraded github.com/prometheus/common v0.48.0 => v0.55.0
go: upgraded github.com/prometheus/procfs v0.12.0 => v0.15.1
go: upgraded github.com/quic-go/quic-go v0.44.0 => v0.46.0
go: upgraded github.com/shopspring/decimal v1.2.0 => v1.4.0
go: upgraded github.com/slackhq/nebula v1.6.1 => v1.9.3
go: upgraded github.com/smallstep/certificates v0.26.1 => v0.27.2
go: upgraded github.com/smallstep/nosql v0.6.1 => v0.7.0
go: upgraded github.com/smallstep/pkcs7 v0.0.0-20231024181729-3b98ecc1ca81 => v0.0.0-20240723090913-5e2c6a136dfa
go: upgraded github.com/smallstep/scep v0.0.0-20231024192529-aee96d7ad34d => v0.0.0-20240214080410-892e41795b99
go: upgraded github.com/spf13/cast v1.4.1 => v1.7.0
go: upgraded github.com/spf13/cobra v1.8.0 => v1.8.1
go: upgraded github.com/stoewer/go-strcase v1.2.0 => v1.3.0
go: upgraded github.com/tailscale/tscert v0.0.0-20240517230440-bbccfbf48933 => v0.0.0-20240608151842-d3f834017e53
go: upgraded github.com/urfave/cli v1.22.14 => v1.22.15
go: upgraded go.etcd.io/bbolt v1.3.9 => v1.3.10
go: upgraded go.step.sm/crypto v0.45.0 => v0.51.1
go: upgraded go.step.sm/linkedca v0.20.1 => v0.22.1
go: upgraded golang.org/x/crypto v0.23.0 => v0.26.0
go: upgraded golang.org/x/crypto/x509roots/fallback v0.0.0-20240507223354-67b13616a595 => v0.0.0-20240806160748-b2d3a6a4b4d3
go: upgraded golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 => v0.0.0-20240719175910-8a7402abbf56
go: upgraded golang.org/x/mod v0.17.0 => v0.20.0
go: upgraded golang.org/x/net v0.25.0 => v0.28.0
go: upgraded golang.org/x/sync v0.7.0 => v0.8.0
go: upgraded golang.org/x/sys v0.20.0 => v0.23.0
go: upgraded golang.org/x/term v0.20.0 => v0.23.0
go: upgraded golang.org/x/text v0.15.0 => v0.17.0
go: upgraded golang.org/x/time v0.5.0 => v0.6.0
go: upgraded golang.org/x/tools v0.21.0 => v0.24.0
go: upgraded google.golang.org/genproto/googleapis/api v0.0.0-20240506185236-b8a5c65736ae => v0.0.0-20240805194559-2c9e96a0b5d4
go: upgraded google.golang.org/genproto/googleapis/rpc v0.0.0-20240429193739-8cf5692501f6 => v0.0.0-20240805194559-2c9e96a0b5d4
go: upgraded google.golang.org/grpc v1.63.2 => v1.65.0
go: upgraded google.golang.org/protobuf v1.34.1 => v1.34.2
go: upgraded howett.net/plist v1.0.0 => v1.0.1
2024/09/11 19:39:42 [INFO] exec (timeout=0s): /usr/bin/go get -v
2024/09/11 19:39:44 [INFO] Build environment ready
2024/09/11 19:39:44 [INFO] Building Caddy
2024/09/11 19:39:44 [INFO] exec (timeout=0s): /usr/bin/go mod tidy -e
2024/09/11 19:39:44 [INFO] exec (timeout=0s): /usr/bin/go build -o /home/dev/caddy -ldflags -w -s -trimpath -tags nobadger

caddy

panic: runtime error: slice bounds out of range [:1073741920] with capacity 5262418

goroutine 1 [running]:
cmd/internal/goobj.(*Reader).StringAt(...)
cmd/internal/goobj/objfile.go:658
cmd/internal/goobj.(*Sym).Name(...)
cmd/internal/goobj/objfile.go:319
cmd/link/internal/loader.(*loadState).preloadSyms(0xc0000e95b0, 0xc001238800, 0x0)
cmd/link/internal/loader/loader.go:2192 +0x9a7
cmd/link/internal/loader.(*Loader).LoadSyms(0xc000616008, 0x903380)
cmd/link/internal/loader/loader.go:2251 +0x1fc
cmd/link/internal/ld.(*Link).loadlib(0xc000122200)
cmd/link/internal/ld/lib.go:598 +0x469
cmd/link/internal/ld.Main(_, {0x20, 0x20, 0x1, 0x7, 0x10, 0x0, {0xc0000b0391, 0x1, 0x1}, ...})
cmd/link/internal/ld/main.go:354 +0x12cb
main.main()
cmd/link/main.go:72 +0xddb
2024/09/11 19:39:44 [INFO] Cleaning up temporary folder: /tmp/buildenv_2024-09-11-1939.4026110036
2024/09/11 19:39:44 [FATAL] exit status 1

@mohammed90
Copy link
Member

You're running into this golang/go#63787. Basically, your Go installation is messed up. Clear the go cache by running go clear -cache -modcache then try again.

@ta2013
Copy link
Author

ta2013 commented Sep 11, 2024

Thanks much! It works again with go clean -cache -modcache

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants