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

tidy mods #70

Merged
merged 1 commit into from
Dec 20, 2023
Merged

tidy mods #70

merged 1 commit into from
Dec 20, 2023

Conversation

mohammed90
Copy link
Contributor

@mohammed90 mohammed90 commented Dec 20, 2023

Fixes #69

@mholt mholt merged commit 8789126 into caddy-dns:master Dec 20, 2023
@mholt
Copy link
Contributor

mholt commented Dec 20, 2023

Huh, wow -- thanks so much!

@wazerstar
Copy link

wazerstar commented Dec 20, 2023

Thanks !

Still does it however

2023/12/20 19:22:15 [INFO] exec (timeout=0s): C:\Program Files\Go\bin\go.exe get -d -v github.com/caddy-dns/cloudflare github.com/caddyserver/caddy/v2@master
go: github.com/caddy-dns/cloudflare@v0.0.0-20231220181002-8789126791ed requires
        github.com/caddyserver/caddy/v2@v2.7.6, but v2.7.6-0.20231220153721-f976c84d9e5b is requested
go: github.com/caddy-dns/cloudflare@upgrade (v0.0.0-20231220181002-8789126791ed) requires github.com/caddyserver/caddy/v2@v2.7.6, not github.com/caddyserver/caddy/v2@master (v2.7.6-0.20231220153721-f976c84d9e5b)
2023/12/20 19:22:15 [FATAL] exit status 1

@mholt

@mohammed90

@mohammed90
Copy link
Contributor Author

Thanks !

Still does it however

2023/12/20 19:22:15 [INFO] exec (timeout=0s): C:\Program Files\Go\bin\go.exe get -d -v github.com/caddy-dns/cloudflare github.com/caddyserver/caddy/v2@master
go: github.com/caddy-dns/cloudflare@v0.0.0-20231220181002-8789126791ed requires
        github.com/caddyserver/caddy/v2@v2.7.6, but v2.7.6-0.20231220153721-f976c84d9e5b is requested
go: github.com/caddy-dns/cloudflare@upgrade (v0.0.0-20231220181002-8789126791ed) requires github.com/caddyserver/caddy/v2@v2.7.6, not github.com/caddyserver/caddy/v2@master (v2.7.6-0.20231220153721-f976c84d9e5b)
2023/12/20 19:22:15 [FATAL] exit status 1

@mholt

@mohammed90

Huh, it worked when I tried it before shooting the PR. I can reproduce it now on a mac. Gotta think about it. I don't have a clue from the top of my head.

@mholt
Copy link
Contributor

mholt commented Dec 20, 2023

Works for me. Maybe your go cache needs to know about the latest commit? try @master on the caddy-dns package.

@wazerstar
Copy link

wazerstar commented Dec 20, 2023

Works for me. Maybe your go cache needs to know about the latest commit? try @master on the caddy-dns package.

Nope the same, also it downloads before doing its build I think so cannot be cache issue.

2023/12/20 20:07:14 [INFO] exec (timeout=0s): C:\Program Files\Go\bin\go.exe get -d -v github.com/caddy-dns/cloudflare@master github.com/caddyserver/caddy/v2@master
go: github.com/caddy-dns/cloudflare@v0.0.0-20231220181002-8789126791ed requires
        github.com/caddyserver/caddy/v2@v2.7.6, but v2.7.6-0.20231220153721-f976c84d9e5b is requested
go: github.com/caddy-dns/cloudflare@master (v0.0.0-20231220181002-8789126791ed) requires github.com/caddyserver/caddy/v2@v2.7.6, not github.com/caddyserver/caddy/v2@master (v2.7.6-0.20231220153721-f976c84d9e5b)
2023/12/20 20:07:14 [FATAL] exit status 1

I assume the cache folder is here?

C:\Users\%username%\AppData\Local\go-build

C:\Users\%username%\go\pkg

I renamed both folders and ran again, same thing happen.

I'm confused now, so without master it works but also it downloads much more than needed now?

Not working
xcaddy build master --with github.com/caddy-dns/cloudflare

Working?
xcaddy build --with github.com/caddy-dns/cloudflare

Output from

C:\Users\mask\Desktop\xcaddy>xcaddy build --with github.com/caddy-dns/cloudflare
2023/12/20 20:15:36 [INFO] Temporary folder: C:\Users\mask\AppData\Local\Temp\buildenv_2023-12-20-2015.151873963
2023/12/20 20:15:36 [INFO] Writing main module: C:\Users\mask\AppData\Local\Temp\buildenv_2023-12-20-2015.151873963\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/caddy-dns/cloudflare"
)

func main() {
        caddycmd.Main()
}
2023/12/20 20:15:36 [INFO] Initializing Go module
2023/12/20 20:15:36 [INFO] exec (timeout=0s): C:\Program Files\Go\bin\go.exe mod init caddy
go: creating new go.mod: module caddy
go: to add module requirements and sums:
        go mod tidy
2023/12/20 20:15:36 [INFO] Pinning versions
2023/12/20 20:15:36 [INFO] exec (timeout=0s): C:\Program Files\Go\bin\go.exe 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.7.6
go: downloading github.com/quic-go/quic-go v0.40.0
go: downloading golang.org/x/sys v0.14.0
go: downloading golang.org/x/term v0.13.0
go: downloading golang.org/x/crypto v0.14.0
go: downloading golang.org/x/net v0.17.0
go: downloading golang.org/x/tools v0.10.0
go: downloading github.com/onsi/ginkgo/v2 v2.9.5
go: downloading golang.org/x/exp v0.0.0-20230310171629-522b1b587ee0
go: downloading golang.org/x/mod v0.11.0
go: downloading golang.org/x/text v0.13.0
go: downloading github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1
go: added github.com/beorn7/perks v1.0.1
go: added github.com/caddyserver/caddy/v2 v2.7.6
go: added github.com/caddyserver/certmagic v0.20.0
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/golang/protobuf v1.5.3
go: added github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1
go: added github.com/google/uuid v1.3.1
go: added github.com/klauspost/cpuid/v2 v2.2.5
go: added github.com/libdns/libdns v0.2.1
go: added github.com/matttproud/golang_protobuf_extensions v1.0.4
go: added github.com/mholt/acmez v1.2.0
go: added github.com/miekg/dns v1.1.55
go: added github.com/onsi/ginkgo/v2 v2.9.5
go: added github.com/prometheus/client_golang v1.15.1
go: added github.com/prometheus/client_model v0.4.0
go: added github.com/prometheus/common v0.42.0
go: added github.com/prometheus/procfs v0.9.0
go: added github.com/quic-go/qpack v0.4.0
go: added github.com/quic-go/qtls-go1-20 v0.4.1
go: added github.com/quic-go/quic-go v0.40.0
go: added github.com/zeebo/blake3 v0.2.3
go: added go.uber.org/mock v0.3.0
go: added go.uber.org/multierr v1.11.0
go: added go.uber.org/zap v1.25.0
go: added golang.org/x/crypto v0.14.0
go: added golang.org/x/exp v0.0.0-20230310171629-522b1b587ee0
go: added golang.org/x/mod v0.11.0
go: added golang.org/x/net v0.17.0
go: added golang.org/x/sys v0.14.0
go: added golang.org/x/term v0.13.0
go: added golang.org/x/text v0.13.0
go: added golang.org/x/tools v0.10.0
go: added google.golang.org/protobuf v1.31.0
2023/12/20 20:15:38 [INFO] exec (timeout=0s): C:\Program Files\Go\bin\go.exe get -d -v github.com/caddy-dns/cloudflare github.com/caddyserver/caddy/v2
go: downloading github.com/libdns/cloudflare v0.1.0
go: added github.com/caddy-dns/cloudflare v0.0.0-20231220181002-8789126791ed
go: added github.com/libdns/cloudflare v0.1.0
2023/12/20 20:15:39 [INFO] exec (timeout=0s): C:\Program Files\Go\bin\go.exe get -d -v
go: downloading github.com/aryann/difflib v0.0.0-20210328193216-ff5ff6dc229b
go: downloading github.com/spf13/cobra v1.7.0
go: downloading github.com/spf13/pflag v1.0.5
go: downloading github.com/smallstep/certificates v0.25.0
go: downloading github.com/smallstep/truststore v0.12.1
go: downloading go.step.sm/crypto v0.35.1
go: downloading github.com/go-chi/chi/v5 v5.0.10
go: downloading github.com/smallstep/nosql v0.6.0
go: downloading github.com/tailscale/tscert v0.0.0-20230806124524-28a91b69a046
go: downloading github.com/dustin/go-humanize v1.0.1
go: downloading gopkg.in/natefinch/lumberjack.v2 v2.2.1
go: downloading golang.org/x/sync v0.4.0
go: downloading github.com/klauspost/compress v1.17.0
go: downloading github.com/google/cel-go v0.15.1
go: downloading google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b
go: downloading github.com/mastercactapus/proxyprotocol v0.0.4
go: downloading go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0
go: downloading go.opentelemetry.io/contrib/propagators/autoprop v0.42.0
go: downloading go.opentelemetry.io/otel/sdk v1.21.0
go: downloading go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0
go: downloading go.opentelemetry.io/otel v1.21.0
go: downloading go.opentelemetry.io/otel/trace v1.21.0
go: downloading go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0
go: downloading github.com/BurntSushi/toml v1.3.2
go: downloading github.com/Masterminds/sprig/v3 v3.2.3
go: downloading github.com/alecthomas/chroma/v2 v2.9.1
go: downloading github.com/yuin/goldmark v1.5.6
go: downloading github.com/yuin/goldmark-highlighting/v2 v2.0.0-20230729083705-37449abec8cc
go: downloading gopkg.in/yaml.v3 v3.0.1
go: downloading github.com/cpuguy83/go-md2man/v2 v2.0.2
go: downloading github.com/inconshreveable/mousetrap v1.1.0
go: downloading howett.net/plist v1.0.0
go: downloading github.com/pkg/errors v0.9.1
go: downloading go.step.sm/cli-utils v0.8.0
go: downloading go.step.sm/linkedca v0.20.1
go: downloading github.com/fxamacker/cbor/v2 v2.5.0
go: downloading google.golang.org/grpc v1.59.0
go: downloading github.com/google/go-tpm v0.9.0
go: downloading github.com/smallstep/go-attestation v0.4.4-0.20230627102604-cf579e53cbd2
go: downloading gopkg.in/square/go-jose.v2 v2.6.0
go: downloading github.com/slackhq/nebula v1.6.1
go: downloading github.com/stoewer/go-strcase v1.2.0
go: downloading github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df
go: downloading go.opentelemetry.io/contrib/propagators/aws v1.17.0
go: downloading go.opentelemetry.io/contrib/propagators/b3 v1.17.0
go: downloading go.opentelemetry.io/contrib/propagators/jaeger v1.17.0
go: downloading go.opentelemetry.io/contrib/propagators/ot v1.17.0
go: downloading github.com/felixge/httpsnoop v1.0.3
go: downloading go.opentelemetry.io/otel/metric v1.21.0
go: downloading google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b
go: downloading go.opentelemetry.io/proto/otlp v1.0.0
go: downloading github.com/Masterminds/goutils v1.1.1
go: downloading github.com/Masterminds/semver/v3 v3.2.0
go: downloading github.com/huandu/xstrings v1.3.3
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/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.7
go: downloading github.com/go-sql-driver/mysql v1.7.1
go: downloading github.com/jackc/pgx/v4 v4.18.0
go: downloading github.com/Microsoft/go-winio v0.6.0
go: downloading github.com/mitchellh/go-ps v1.0.0
go: downloading filippo.io/edwards25519 v1.0.0
go: downloading github.com/rs/xid v1.5.0
go: downloading github.com/sirupsen/logrus v1.9.3
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/russross/blackfriday/v2 v2.1.0
go: downloading github.com/x448/float16 v0.8.4
go: downloading github.com/urfave/cli v1.22.14
go: downloading github.com/chzyer/readline v1.5.1
go: downloading github.com/manifoldco/promptui v0.9.0
go: downloading github.com/google/go-tspi v0.3.0
go: downloading github.com/go-logr/logr v1.3.0
go: downloading github.com/cenkalti/backoff/v4 v4.2.1
go: downloading github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0
go: downloading github.com/go-logr/stdr v1.2.2
go: downloading github.com/mitchellh/reflectwalk v1.0.2
go: downloading github.com/dgraph-io/ristretto v0.1.0
go: downloading github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13
go: downloading github.com/dlclark/regexp2 v1.10.0
go: downloading github.com/jackc/pgconn v1.14.0
go: downloading github.com/jackc/pgtype v1.14.0
go: downloading github.com/jackc/pgio v1.0.0
go: downloading github.com/jackc/pgproto3/v2 v2.3.2
go: downloading github.com/go-kit/kit v0.10.0
go: downloading github.com/google/certificate-transparency-go v1.1.6
go: downloading github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96
go: downloading github.com/golang/snappy v0.0.4
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-20221227161230-091c0ba34f0a
go: downloading github.com/golang/glog v1.1.2
go: downloading github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d
go: downloading github.com/shurcooL/sanitized_anchor_name v1.0.0
go: downloading github.com/mattn/go-colorable v0.1.8
go: downloading github.com/mattn/go-isatty v0.0.16
go: downloading github.com/go-logfmt/logfmt v0.5.1
2023/12/20 20:15:47 [INFO] Build environment ready
2023/12/20 20:15:47 [INFO] Building Caddy
2023/12/20 20:15:47 [INFO] exec (timeout=0s): C:\Program Files\Go\bin\go.exe mod tidy -e
go: downloading github.com/stretchr/testify v1.8.4
go: downloading go.uber.org/goleak v1.3.0
go: downloading github.com/smallstep/assert v0.0.0-20200723003110-82e2b9b3b262
go: downloading github.com/onsi/gomega v1.27.6
go: downloading gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c
go: downloading github.com/zeebo/assert v1.1.0
go: downloading github.com/benbjohnson/clock v1.3.0
go: downloading github.com/google/go-cmp v0.6.0
go: downloading github.com/davecgh/go-spew v1.1.1
go: downloading github.com/alecthomas/assert/v2 v2.2.1
go: downloading github.com/pmezard/go-difflib v1.0.0
go: downloading github.com/google/go-tpm-tools v0.4.1
go: downloading github.com/peterbourgon/diskv/v3 v3.0.1
go: downloading github.com/schollz/jsonstore v1.1.0
go: downloading gopkg.in/yaml.v2 v2.4.0
go: downloading github.com/alecthomas/repr v0.2.0
go: downloading github.com/cockroachdb/apd v1.1.0
go: downloading github.com/gofrs/uuid v4.0.0+incompatible
go: downloading github.com/kr/pretty v0.3.1
go: downloading github.com/aws/aws-sdk-go v1.45.12
go: downloading cloud.google.com/go/kms v1.15.2
go: downloading github.com/googleapis/gax-go/v2 v2.12.0
go: downloading google.golang.org/api v0.142.0
go: downloading github.com/chzyer/test v1.0.0
go: downloading github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65
go: downloading github.com/lib/pq v1.10.9
go: downloading github.com/hexops/gotextdiff v1.0.3
go: downloading github.com/zeebo/pcg v1.0.1
go: downloading github.com/go-stack/stack v1.8.0
go: downloading github.com/chzyer/logex v1.2.1
go: downloading github.com/google/btree v1.1.2
go: downloading github.com/OneOfOne/xxhash v1.2.2
go: downloading cloud.google.com/go v0.110.7
go: downloading github.com/spaolacci/murmur3 v1.1.0
go: downloading github.com/kr/text v0.2.0
go: downloading github.com/rogpeppe/go-internal v1.10.0
go: downloading google.golang.org/genproto v0.0.0-20231012201019-e917dd12ba7a
go: downloading cloud.google.com/go/iam v1.1.2
go: downloading golang.org/x/oauth2 v0.12.0
go: downloading cloud.google.com/go/compute/metadata v0.2.3
go: downloading github.com/google/s2a-go v0.1.7
go: downloading go.opencensus.io v0.24.0
go: downloading github.com/googleapis/enterprise-certificate-proxy v0.2.5
go: downloading cloud.google.com/go/compute v1.23.0
go: downloading github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da
go: downloading google.golang.org/appengine v1.6.7
go: downloading github.com/jmespath/go-jmespath v0.4.0
2023/12/20 20:15:55 [INFO] exec (timeout=0s): C:\Program Files\Go\bin\go.exe build -o C:\Users\mask\Desktop\xcaddy\caddy.exe -ldflags -w -s -trimpath
2023/12/20 20:16:07 [INFO] Build complete: .\caddy.exe
2023/12/20 20:16:07 [INFO] Cleaning up temporary folder: C:\Users\mask\AppData\Local\Temp\buildenv_2023-12-20-2015.151873963

Again I always used master and it also works when I take the older commit, I use a batch script where the info is saved in so I dont have to remember it all the time, and its still unedited from back in march 2023

btw. when you dont include master in xcaddy in the beginning does it only take the official release or is it still the latest/master commit?

@mohammed90 mohammed90 mentioned this pull request Dec 21, 2023
@wazerstar
Copy link

@mohammed90 are we still into this issue?

@mholt
Copy link
Contributor

mholt commented Jan 9, 2024

Mohammed's linked PR has the correct explanation; also from bcmills in the Gopher slack:

Yes, this is because the v2.7.6 tag is on a release branch. Since github.com/caddyserver/caddy/v2@master does not descend from v2.7.6, the go command doesn't know that it should be considered semantically higher than v2.7.6. You can fix that by adding a pre-release tag on the master branch, like v2.8.0-0.dev, which will then be used as the basis for pseudo-versions for the commits on that branch.

We're reconsidering our branching approach because I don't love this (personally).

@wazerstar
Copy link

Mohammed's linked PR has the correct explanation; also from bcmills in the Gopher slack:

Yes, this is because the v2.7.6 tag is on a release branch. Since github.com/caddyserver/caddy/v2@master does not descend from v2.7.6, the go command doesn't know that it should be considered semantically higher than v2.7.6. You can fix that by adding a pre-release tag on the master branch, like v2.8.0-0.dev, which will then be used as the basis for pseudo-versions for the commits on that branch.

We're reconsidering our branching approach because I don't love this (personally).

Can you give me an example for how I would build the latest master as today, tried various method to add a prelease tag, never succeed.

I use this atm.

xcaddy build master --with github.com/caddy-dns/cloudflare --with github.com/caddyserver/transform-encoder --with github.com/WeidiDeng/caddy-cloudflare-ip --with github.com/porech/caddy-maxmind-geolocation

@mohammed90
Copy link
Contributor Author

Try this:

xcaddy build master --with github.com/caddy-dns/cloudflare=github.com/mohammed90/cloudflare --with github.com/caddyserver/transform-encoder --with github.com/WeidiDeng/caddy-cloudflare-ip --with github.com/porech/caddy-maxmind-geolocation

@wazerstar
Copy link

wazerstar commented Jan 28, 2024

Try this:

xcaddy build master --with github.com/caddy-dns/cloudflare=github.com/mohammed90/cloudflare --with github.com/caddyserver/transform-encoder --with github.com/WeidiDeng/caddy-cloudflare-ip --with github.com/porech/caddy-maxmind-geolocation

Hi, thanks for taking time, however gives another error now.

-replace=github.com/caddy-dns/cloudflare=github.com/mohammed90/cloudflare: unversioned new path must be local directory
2024/01/28 13:38:14 [FATAL] exit status 1

I also tried just to use your url github.com/mohammed90/cloudflare instead of github.com/caddy-dns/cloudflare

2024/01/28 13:41:18 [INFO] exec (timeout=0s): C:\Program Files\Go\bin\go.exe get -d -v github.com/mohammed90/cloudflare github.com/caddyserver/caddy/v2@master
go: downloading github.com/mohammed90/cloudflare v0.0.0-20231221081826-7ec39dafb7a1
go: github.com/mohammed90/cloudflare@v0.0.0-20231221081826-7ec39dafb7a1 found: parsing go.mod:
        module declares its path as: github.com/caddy-dns/cloudflare
                but was required as: github.com/mohammed90/cloudflare
go: github.com/mohammed90/cloudflare@upgrade (v0.0.0-20231221081826-7ec39dafb7a1) requires github.com/mohammed90/cloudflare@v0.0.0-20231221081826-7ec39dafb7a1: parsing go.mod:
        module declares its path as: github.com/caddy-dns/cloudflare
                but was required as: github.com/mohammed90/cloudflare
2024/01/28 13:41:21 [FATAL] exit status 1

@mohammed90
Copy link
Contributor Author

Try this:

xcaddy build master --with github.com/caddy-dns/cloudflare=github.com/mohammed90/cloudflare --with github.com/caddyserver/transform-encoder --with github.com/WeidiDeng/caddy-cloudflare-ip --with github.com/porech/caddy-maxmind-geolocation

Hi, thanks for taking time, however gives another error now.

-replace=github.com/caddy-dns/cloudflare=github.com/mohammed90/cloudflare: unversioned new path must be local directory
2024/01/28 13:38:14 [FATAL] exit status 1

Sigh, sorry, my bad. This one works:

xcaddy build master --with github.com/caddy-dns/cloudflare@master=github.com/mohammed90/cloudflare@master --with github.com/caddyserver/transform-encoder --with github.com/WeidiDeng/caddy-cloudflare-ip --with github.com/porech/caddy-maxmind-geolocation

This time, I checked it myself my creating a custom build using the same command.

@wazerstar
Copy link

xcaddy build master --with github.com/caddy-dns/cloudflare@master=github.com/mohammed90/cloudflare@master --with github.com/caddyserver/transform-encoder --with github.com/WeidiDeng/caddy-cloudflare-ip --with github.com/porech/caddy-maxmind-geolocation

Great it works, thanks! 👍 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fatal error build with windows using master with latest release
3 participants