Building caddy 2.5.2 with cgiv2 fails

1. Caddy version (caddy version):

2.5.2

2. How I run Caddy:

Slackware rc script

a. System environment:

Slackware64-15.0, bsd rc script, ho 1.17.9

b. Command:

not related

c. Service/unit/compose file:

not related

d. My complete Caddyfile or JSON config:

not related

3. The problem I’m having:

$ xcaddy build --with github.com/aksdb/caddy-cgi/v2
2022/07/25 20:51:26 [INFO] Temporary folder: /tmp/buildenv_2022-07-25-2051.1107117446                                                                                                                                                                                                       [0/453]
2022/07/25 20:51:26 [INFO] Writing main module: /tmp/buildenv_2022-07-25-2051.1107117446/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/aksdb/caddy-cgi/v2"
)
                                                                        
func main() {                                                                                                                                    
        caddycmd.Main()              
}                                       
2022/07/25 20:51:26 [INFO] Initializing Go module
2022/07/25 20:51:26 [INFO] exec (timeout=10s): /usr/lib64/go1.17.9/go/bin/go mod init caddy                                                      
go: creating new go.mod: module caddy                                                                                                            
go: to add module requirements and sums:    
        go mod tidy                                 
2022/07/25 20:51:26 [INFO] Pinning versions           
2022/07/25 20:51:26 [INFO] exec (timeout=0s): /usr/lib64/go1.17.9/go/bin/go get -d -v github.com/caddyserver/caddy/v2                            
go get: added github.com/beorn7/perks v1.0.1    
go get: added github.com/caddyserver/caddy/v2 v2.5.2
go get: added github.com/caddyserver/certmagic v0.16.1                                                                                           
go get: added github.com/cespare/xxhash/v2 v2.1.2
go get: added github.com/cheekybits/genny v1.0.0
go get: added github.com/fsnotify/fsnotify v1.5.1  
go get: added github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0                                                                   
go get: added github.com/golang/protobuf v1.5.2        
go get: added github.com/google/uuid v1.3.0         
go get: added github.com/klauspost/cpuid/v2 v2.0.13       
go get: added github.com/libdns/libdns v0.2.1             
go get: added github.com/lucas-clemente/quic-go v0.28.0   
go get: added github.com/marten-seemann/qpack v0.2.1             
go get: added github.com/marten-seemann/qtls-go1-16 v0.1.5           
go get: added github.com/marten-seemann/qtls-go1-17 v0.1.2
go get: added github.com/marten-seemann/qtls-go1-18 v0.1.2
go get: added github.com/marten-seemann/qtls-go1-19 v0.1.0-beta.1
go get: added github.com/matttproud/golang_protobuf_extensions v1.0.1
go get: added github.com/mholt/acmez v1.0.2              
go get: added github.com/miekg/dns v1.1.46             
go get: added github.com/nxadm/tail v1.4.8        
go get: added github.com/onsi/ginkgo v1.16.4     
go get: added github.com/prometheus/client_golang v1.12.1
go get: added github.com/prometheus/client_model v0.2.0
go get: added github.com/prometheus/common v0.32.1
go get: added github.com/prometheus/procfs v0.7.3                   
go get: added go.uber.org/atomic v1.9.0
go get: added go.uber.org/multierr v1.6.0                        
go get: added go.uber.org/zap v1.21.0                            
go get: added golang.org/x/crypto v0.0.0-20220210151621-f4118a5b28e2
go get: added golang.org/x/mod v0.4.2                               
go get: added golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e
go get: added golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a    
go get: added golang.org/x/term v0.0.0-20210927222741-03fcf44c2211
go get: added golang.org/x/text v0.3.8-0.20211004125949-5bd84dd9b33b
go get: added golang.org/x/tools v0.1.7                                                                                                                                                                                                                                                            
go get: added golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
go get: added google.golang.org/protobuf v1.28.0                                                                                                 
go get: added gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7                                                                                
2022/07/25 20:51:30 [INFO] exec (timeout=0s): /usr/lib64/go1.17.9/go/bin/go get -d -v github.com/aksdb/caddy-cgi/v2 github.com/caddyserver/caddy/v2                                                                                                                                                
go get: added github.com/aksdb/caddy-cgi/v2 v2.0.1
go get: upgraded github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20220418222510-f25a4f6275ed => v0.0.0-20220722194653-14703f21b580
2022/07/25 20:51:38 [INFO] exec (timeout=0s): /usr/lib64/go1.17.9/go/bin/go get -d -v                                                            
2022/07/25 20:51:44 [INFO] Build environment ready
2022/07/25 20:51:44 [INFO] Building Caddy                        
2022/07/25 20:51:44 [INFO] exec (timeout=0s): /usr/lib64/go1.17.9/go/bin/go mod tidy                                                             
caddy imports                                                                                                                                    
        github.com/aksdb/caddy-cgi/v2 imports
        github.com/caddyserver/caddy/v2/modules/caddyhttp imports                                                                                
        github.com/google/cel-go/parser imports                                                                                                                                                                                                                                                    
        github.com/antlr/antlr4/runtime/Go/antlr loaded from github.com/antlr/antlr4/runtime/Go/antlr@v0.0.0-20220722194653-14703f21b580,                                                                                                                                                          
        but go 1.16 would fail to locate it:                            
        ambiguous import: found package github.com/antlr/antlr4/runtime/Go/antlr in multiple modules:                                            
        github.com/antlr/antlr4 v0.0.0-20200503195918-621b933c7a7f (/home/myuser/go/pkg/mod/github.com/antlr/antlr4@v0.0.0-20200503195918-621b933c7a7f/runtime/Go/antlr)                                                                                                                           
        github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20220722194653-14703f21b580 (/home/myuser/go/pkg/mod/github.com/antlr/antlr4/runtime/!go/antlr@v0.0.0-20220722194653-14703f21b580)                                                                                                         
                                                                        
To proceed despite packages unresolved in go 1.16:
        go mod tidy -e                        
If reproducibility with go 1.16 is not needed:                                                                                                   
        go mod tidy -compat=1.17         
For other options, see:                                                                                                                                                                                                                                                                            
        https://golang.org/doc/modules/pruning                                                                                                                                                                                                                                                     
2022/07/25 20:51:44 [INFO] Cleaning up temporary folder: /tmp/buildenv_2022-07-25-2051.1107117446                                                                                                                                                                                                  
2022/07/25 20:51:44 [FATAL] exit status 1

4. Error messages and/or full log output:

5. What I already tried:

deleting local /home/myuser/go folder and trying again

6. Links to relevant resources:

What version of xcaddy are you using? You’ll need to use the latest version, unfortunately. (This is an issue with Go dependency management and a broken upstream dependency.)

I think I’m actually using the latest

$ xcaddy version
v0.3.0 h1:3LTHAhHb5YKKqTLLj8kdF9cfGMl4jHV4uRbtw7LBJ6k=

Hmm, maybe you also need to specify --with github.com/caddyserver/caddy/v2@v2.5.2 until they update their go.mod?

I tried also on another install where I hadn’t built any go stuff before but with no luck

$ xcaddy build --with github.com/caddyserver/caddy/v2@v2.5.2 --with github.com/aksdb/caddy-cgi/v2
2022/07/26 09:03:19 [INFO] Temporary folder: /tmp/buildenv_2022-07-26-0903.1124971836
2022/07/26 09:03:19 [INFO] Writing main module: /tmp/buildenv_2022-07-26-0903.1124971836/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/caddy/v2"              
        _ "github.com/aksdb/caddy-cgi/v2"              
)                                                         
                                                                                           
func main() {                                                                           
        caddycmd.Main()                                                              
}                                                                    
2022/07/26 09:03:19 [INFO] Initializing Go module                                     
2022/07/26 09:03:19 [INFO] exec (timeout=10s): /usr/lib64/go1.17.9/go/bin/go mod init caddy  
go: creating new go.mod: module caddy          
go: to add module requirements and sums:           
        go mod tidy                                                     
2022/07/26 09:03:19 [INFO] Pinning versions            
2022/07/26 09:03:19 [INFO] exec (timeout=0s): /usr/lib64/go1.17.9/go/bin/go get -d -v github.com/caddyserver/caddy/v2 
go: downloading github.com/caddyserver/caddy v1.0.5  
go: downloading github.com/caddyserver/caddy/v2 v2.5.2
go: downloading github.com/caddyserver/certmagic v0.16.1
go: downloading github.com/google/uuid v1.3.0                  
go: downloading github.com/lucas-clemente/quic-go v0.28.0           
go: downloading github.com/prometheus/client_golang v1.12.1
go: downloading go.uber.org/zap v1.21.0                          
go: downloading golang.org/x/term v0.0.0-20210927222741-03fcf44c2211         
go: downloading golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a
go: downloading go.uber.org/atomic v1.9.0                           
go: downloading go.uber.org/multierr v1.6.0          
go: downloading github.com/beorn7/perks v1.0.1                       
go: downloading github.com/prometheus/client_model v0.2.0
go: downloading github.com/golang/protobuf v1.5.2                
go: downloading github.com/cespare/xxhash/v2 v2.1.2                                                                                                                                    
go: downloading github.com/prometheus/common v0.32.1                                                                                                                                   
go: downloading github.com/prometheus/procfs v0.7.3
go: downloading google.golang.org/protobuf v1.28.0                            
go: downloading github.com/cespare/xxhash v1.1.0                                  
go: downloading github.com/marten-seemann/qpack v0.2.1
go: downloading golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e          
go: downloading github.com/cheekybits/genny v1.0.0       
go: downloading github.com/onsi/ginkgo v1.16.4     
go: downloading github.com/klauspost/cpuid/v2 v2.0.13               
go: downloading github.com/libdns/libdns v0.2.1                               
go: downloading github.com/mholt/acmez v1.0.2                                                                                                                                          
go: downloading github.com/miekg/dns v1.1.46             
go: downloading golang.org/x/crypto v0.0.0-20220210151621-f4118a5b28e2      
go: downloading github.com/marten-seemann/qtls-go1-16 v0.1.5
go: downloading github.com/marten-seemann/qtls-go1-17 v0.1.2
go: downloading github.com/marten-seemann/qtls-go1-18 v0.1.2              
go: downloading github.com/marten-seemann/qtls-go1-19 v0.1.0-beta.1      
go: downloading github.com/matttproud/golang_protobuf_extensions v1.0.1   
go: downloading golang.org/x/text v0.3.8-0.20211004125949-5bd84dd9b33b
go: downloading github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0
go: downloading golang.org/x/tools v0.1.7            
go: downloading github.com/nxadm/tail v1.4.8                    
go: downloading gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7     
go: downloading github.com/fsnotify/fsnotify v1.5.1
go: downloading golang.org/x/mod v0.4.2                         
go: downloading golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
go get: added github.com/beorn7/perks v1.0.1             
go get: added github.com/caddyserver/caddy/v2 v2.5.2
go get: added github.com/caddyserver/certmagic v0.16.1
go get: added github.com/cespare/xxhash/v2 v2.1.2 
go get: added github.com/cheekybits/genny v1.0.0      
go get: added github.com/fsnotify/fsnotify v1.5.1                     
go get: added github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0
go get: added github.com/golang/protobuf v1.5.2   
go get: added github.com/google/uuid v1.3.0     
go get: added github.com/klauspost/cpuid/v2 v2.0.13                            
go get: added github.com/libdns/libdns v0.2.1                          
go get: added github.com/lucas-clemente/quic-go v0.28.0          
go get: added github.com/marten-seemann/qpack v0.2.1
go get: added github.com/marten-seemann/qtls-go1-16 v0.1.5
go get: added github.com/marten-seemann/qtls-go1-17 v0.1.2
go get: added github.com/marten-seemann/qtls-go1-18 v0.1.2
go get: added github.com/marten-seemann/qtls-go1-19 v0.1.0-beta.1
go get: added github.com/matttproud/golang_protobuf_extensions v1.0.1
go get: added github.com/mholt/acmez v1.0.2         
go get: added github.com/miekg/dns v1.1.46                                                                                                                                             
go get: added github.com/nxadm/tail v1.4.8          
go get: added github.com/onsi/ginkgo v1.16.4                                                                                                                                           
go get: added github.com/prometheus/client_golang v1.12.1                                                                                                                              
go get: added github.com/prometheus/client_model v0.2.0                                                                                                                                                                                                                                                                                                                       
go get: added github.com/prometheus/common v0.32.1      
go get: added github.com/prometheus/procfs v0.7.3 
go get: added go.uber.org/atomic v1.9.0              
go get: added go.uber.org/multierr v1.6.0      
go get: added go.uber.org/zap v1.21.0        
go get: added golang.org/x/crypto v0.0.0-20220210151621-f4118a5b28e2
go get: added golang.org/x/mod v0.4.2                                              
go get: added golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e                                                                                                                      
go get: added golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a                 
go get: added golang.org/x/term v0.0.0-20210927222741-03fcf44c2211
go get: added golang.org/x/text v0.3.8-0.20211004125949-5bd84dd9b33b
go get: added golang.org/x/tools v0.1.7            
go get: added golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1                      
go get: added google.golang.org/protobuf v1.28.0
go get: added gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7                                                                                                                      
2022/07/26 09:05:12 [INFO] exec (timeout=0s): /usr/lib64/go1.17.9/go/bin/go get -d -v github.com/caddyserver/caddy/v2@v2.5.2 github.com/caddyserver/caddy/v2 
2022/07/26 09:05:16 [INFO] exec (timeout=0s): /usr/lib64/go1.17.9/go/bin/go get -d -v github.com/aksdb/caddy-cgi/v2 github.com/caddyserver/caddy/v2 
go: downloading github.com/aksdb/caddy-cgi v1.11.4
go: downloading github.com/aksdb/caddy-cgi/v2 v2.0.1                                       
go: downloading github.com/dustin/go-humanize v1.0.1-0.20200219035652-afde56e7acac                                                                                                     
go: downloading github.com/google/cel-go v0.11.4            
go: downloading google.golang.org/genproto v0.0.0-20220502173005-c8bf987b8c21              
go: downloading github.com/smallstep/certificates v0.19.0                                                                                                                              
go: downloading github.com/smallstep/cli v0.18.0                                       
go: downloading github.com/smallstep/truststore v0.11.0  
go: downloading github.com/tailscale/tscert v0.0.0-20220316030059-54bbcb9f74e2
go: downloading github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20220418222510-f25a4f6275ed 
go: downloading github.com/stoewer/go-strcase v1.2.0                                       
go: downloading github.com/aryann/difflib v0.0.0-20210328193216-ff5ff6dc229b            
go: downloading howett.net/plist v1.0.0                                              
go: downloading github.com/mitchellh/go-ps v1.0.0                    
go: downloading github.com/antlr/antlr4 v0.0.0-20200503195918-621b933c7a7f            
go: downloading go.step.sm/cli-utils v0.7.0                                                                                                                                            
go: downloading github.com/pkg/errors v0.9.1   
go: downloading github.com/urfave/cli v1.22.5      
go: downloading github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e
go: downloading github.com/manifoldco/promptui v0.9.0  
go: downloading github.com/cpuguy83/go-md2man/v2 v2.0.0                                                                                                                                
go: downloading github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d
go: downloading go.step.sm/crypto v0.16.1             
go: downloading github.com/shurcooL/sanitized_anchor_name v1.0.0
go: downloading github.com/cpuguy83/go-md2man v1.0.10          
go: downloading github.com/russross/blackfriday/v2 v2.0.1           
go: downloading github.com/mattn/go-colorable v0.1.8       
go: downloading github.com/russross/blackfriday v1.5.2           
go: downloading github.com/mattn/go-isatty v0.0.13                           
go: downloading github.com/smallstep/nosql v0.4.0                  
go: downloading go.step.sm/linkedca v0.15.0                         
go: downloading google.golang.org/grpc v1.46.0       
go: downloading gopkg.in/square/go-jose.v2 v2.6.0                    
go: downloading github.com/slackhq/nebula v1.5.2         
go: downloading github.com/micromdm/scep/v2 v2.1.0               
go: downloading go.mozilla.org/pkcs7 v0.0.0-20210826202110-33d05740a352                                                                                                                
go: downloading github.com/Masterminds/sprig/v3 v3.2.2                                                                                                                                 
go: downloading filippo.io/edwards25519 v1.0.0-rc.1
go: downloading github.com/Masterminds/goutils v1.1.1                         
go: downloading github.com/Masterminds/semver/v3 v3.1.1                           
go: downloading github.com/huandu/xstrings v1.3.2     
go: downloading github.com/imdario/mergo v0.3.12                             
go: downloading github.com/mitchellh/copystructure v1.2.0
go: downloading github.com/shopspring/decimal v1.2.0
go: downloading github.com/spf13/cast v1.4.1                        
go: downloading github.com/Masterminds/semver v1.4.2                          
go: downloading github.com/rs/xid v1.2.1                                                                                                                                               
go: downloading github.com/sirupsen/logrus v1.8.1        
go: downloading github.com/dgraph-io/badger v1.6.2                          
go: downloading github.com/dgraph-io/badger/v2 v2.2007.4    
go: downloading go.etcd.io/bbolt v1.3.6                     
go: downloading github.com/go-sql-driver/mysql v1.6.0                     
go: downloading github.com/jackc/pgx/v4 v4.14.0                          
go: downloading github.com/go-kit/kit v0.10.0                             
go: downloading github.com/mitchellh/reflectwalk v1.0.2               
go: downloading github.com/dgraph-io/ristretto v0.0.4-0.20200906165740-41ebdbffecfd
go: downloading github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13
go: downloading github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96
go: downloading github.com/golang/snappy v0.0.4                         
go: downloading github.com/klauspost/compress v1.15.6
go: downloading github.com/jackc/pgtype v1.9.0                  
go: downloading github.com/jackc/pgconn v1.10.1                        
go: downloading github.com/jackc/pgio v1.0.0             
go: downloading github.com/jackc/pgproto3/v2 v2.2.0 
go: downloading github.com/go-logfmt/logfmt v0.5.0    
go: downloading github.com/jackc/chunkreader/v2 v2.0.1
go: downloading github.com/jackc/pgpassfile v1.0.0    
go: downloading github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b
go: downloading github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20220722194653-14703f21b580 
go: downloading github.com/antlr/antlr4 v4.10.1+incompatible
go get: added github.com/aksdb/caddy-cgi/v2 v2.0.1
go get: upgraded github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20220418222510-f25a4f6275ed => v0.0.0-20220722194653-14703f21b580
2022/07/26 09:06:57 [INFO] exec (timeout=0s): /usr/lib64/go1.17.9/go/bin/go get -d -v  
go: downloading github.com/go-chi/chi v4.1.2+incompatible        
go: downloading gopkg.in/natefinch/lumberjack.v2 v2.0.0
go: downloading github.com/BurntSushi/toml v1.1.0         
go: downloading github.com/yuin/goldmark v1.4.12          
go: downloading github.com/yuin/goldmark-highlighting v0.0.0-20220208100518-594be1970594
go: downloading go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.29.0
go: downloading github.com/alecthomas/chroma v0.10.0                 
go: downloading go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.4.0
go: downloading gopkg.in/yaml.v3 v3.0.1                                                                                                                                                
go: downloading go.opentelemetry.io/otel v1.4.0     
go: downloading go.opentelemetry.io/otel/sdk v1.4.0                                                                                                                                    
go: downloading go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.4.0                                                                                                               
go: downloading go.opentelemetry.io/contrib v0.20.0                                                                                                                                                                                                                                                                                                                           
go: downloading github.com/dlclark/regexp2 v1.4.0       
go: downloading go.opentelemetry.io/otel/trace v1.4.0
go: downloading github.com/go-logr/logr v1.2.2       
go: downloading github.com/go-logr/stdr v1.2.2 
go: downloading go.opentelemetry.io/otel/exporters/otlp v0.20.0
go: downloading go.opentelemetry.io/otel/metric v0.27.0             
go: downloading github.com/felixge/httpsnoop v1.0.2                                
go: downloading go.opentelemetry.io/proto/otlp v0.12.0                                                                                                                                 
go: downloading go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.4.0     
go: downloading go.opentelemetry.io/otel/internal/metric v0.27.0
go: downloading github.com/grpc-ecosystem/grpc-gateway v1.16.0      
go: downloading github.com/cenkalti/backoff/v4 v4.1.2
go: downloading github.com/cenkalti/backoff v2.2.1+incompatible      
2022/07/26 09:07:18 [INFO] Build environment ready       
2022/07/26 09:07:18 [INFO] Building Caddy                        
2022/07/26 09:07:18 [INFO] exec (timeout=0s): /usr/lib64/go1.17.9/go/bin/go mod tidy                                                                                                   
go: downloading github.com/google/go-cmp v0.5.7                                                                                                                                        
go: downloading gopkg.in/yaml.v2 v2.4.0            
go: downloading github.com/smallstep/assert v0.0.0-20200723003110-82e2b9b3b262
go: downloading github.com/stretchr/testify v1.7.1                                
go: downloading go.uber.org/goleak v1.1.12            
go: downloading github.com/golang/mock v1.6.0                                
go: downloading github.com/onsi/gomega v1.13.0           
go: downloading github.com/benbjohnson/clock v1.1.0 
go: downloading golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
go: downloading gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c          
go: downloading github.com/cockroachdb/apd v1.1.0                                                                                                                                      
go: downloading github.com/gofrs/uuid v4.0.0+incompatible
go: downloading github.com/aws/aws-sdk-go v1.37.0                           
go: downloading cloud.google.com/go/kms v1.4.0              
go: downloading github.com/googleapis/gax-go/v2 v2.1.1      
go: downloading google.golang.org/api v0.70.0                             
go: downloading github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1
go: downloading github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65
go: downloading github.com/lib/pq v1.10.2                             
go: downloading github.com/davecgh/go-spew v1.1.1                                  
go: downloading github.com/pmezard/go-difflib v1.0.0                         
go: downloading github.com/googleapis/gax-go v2.0.2+incompatible                  
go: downloading github.com/go-stack/stack v1.8.0                        
go: downloading github.com/OneOfOne/xxhash v1.2.2    
go: downloading github.com/spaolacci/murmur3 v1.1.0             
go: downloading cloud.google.com/go v0.100.2                           
go: downloading github.com/kr/pretty v0.2.1              
go: downloading github.com/chzyer/logex v1.1.10     
go: downloading github.com/kr/text v0.2.0             
go: downloading cloud.google.com/go/iam v0.1.0        
go: downloading github.com/jmespath/go-jmespath v0.4.0
go: downloading golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8           
go: downloading cloud.google.com/go/compute v1.3.0                                                                                                                                     
go: downloading google.golang.org/appengine v1.6.7          
go: downloading go.opencensus.io v0.23.0          
go: downloading github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da                                                                                                        
go: downloading github.com/klauspost/cpuid v1.2.5                                      
go: downloading github.com/Masterminds/sprig v2.22.0+incompatible
go: downloading github.com/Masterminds/semver v1.5.0   
go: downloading github.com/jackc/pgproto3 v1.1.0          
go: downloading github.com/jackc/chunkreader v1.0.0       
caddy imports                                                                           
        github.com/aksdb/caddy-cgi/v2 imports                                        
        github.com/caddyserver/caddy/v2/modules/caddyhttp imports    
        github.com/google/cel-go/parser imports                                       
        github.com/antlr/antlr4/runtime/Go/antlr loaded from github.com/antlr/antlr4/runtime/Go/antlr@v0.0.0-20220722194653-14703f21b580,                                              
        but go 1.16 would fail to locate it:        
        ambiguous import: found package github.com/antlr/antlr4/runtime/Go/antlr in multiple modules:                                                                                  
        github.com/antlr/antlr4 v0.0.0-20200503195918-621b933c7a7f (/home/myuser/go/pkg/mod/github.com/antlr/antlr4@v0.0.0-20200503195918-621b933c7a7f/runtime/Go/antlr)               
        github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20220722194653-14703f21b580 (/home/myuser/go/pkg/mod/github.com/antlr/antlr4/runtime/!go/antlr@v0.0.0-20220722194653-14703f21b580)                                                                                                                                                                                    
                                                                                           
To proceed despite packages unresolved in go 1.16:   
        go mod tidy -e                               
If reproducibility with go 1.16 is not needed: 
        go mod tidy -compat=1.17                               
For other options, see:                                             
        https://golang.org/doc/modules/pruning                                     
2022/07/26 09:07:43 [INFO] Cleaning up temporary folder: /tmp/buildenv_2022-07-26-0903.1124971836                                                                                      
2022/07/26 09:07:43 [FATAL] exit status 1

I hope I’m not missing anything obvious (total go noob here)…

What version of Go are you using? Please try with Go 1.18 if you aren’t already.

2 Likes

I was using go 1.17.9, but I can confirm that it works fine with 1.18.4, thanks a lot!

2 Likes

Ohh, interesting. I forgot about that.