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

chore: upgrade quic-go to 0.37.4 to support go1.21 #270

Merged
merged 8 commits into from
Aug 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ jobs:
strategy:
matrix:
goos: [ linux ]
goarch: [ arm64, 386, riscv64, mips64, mips64le, mipsle, mips ]
goarch: [ 386, riscv64, mips64, mips64le, mipsle, mips ]
include:
# BEGIN Linux ARM 5 6 7
# BEGIN Linux ARM 5 6 7 64
- goos: linux
goarch: arm64
buildargs: -buildmode=pie
- goos: linux
goarch: arm
goarm: 7
Expand All @@ -30,12 +33,15 @@ jobs:
- goos: linux
goarch: amd64
goamd64: v1
buildargs: -buildmode=pie
- goos: linux
goarch: amd64
goamd64: v2
buildargs: -buildmode=pie
- goos: linux
goarch: amd64
goamd64: v3
buildargs: -buildmode=pie
# END Linux AMD64 v1 v2 v3
fail-fast: false

Expand All @@ -46,6 +52,7 @@ jobs:
GOARM: ${{ matrix.goarm }}
GOAMD64: ${{ matrix.goamd64 }}
CGO_ENABLED: 0
BUILD_ARGS: ${{ matrix.buildargs }}

steps:
- name: Checkout codebase
Expand Down Expand Up @@ -73,7 +80,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '^1.19'
go-version: '^1.21'

- name: Install Dependencies
run: |
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ jobs:
strategy:
matrix:
goos: [ linux ]
goarch: [ arm64, 386, riscv64, mips64, mips64le, mipsle, mips ]
goarch: [ 386, riscv64, mips64, mips64le, mipsle, mips ]
include:
# BEGIN Linux ARM 5 6 7
# BEGIN Linux ARM 5 6 7 64
- goos: linux
goarch: arm64
buildargs: -buildmode=pie
- goos: linux
goarch: arm
goarm: 7
Expand All @@ -30,12 +33,15 @@ jobs:
- goos: linux
goarch: amd64
goamd64: v1
buildargs: -buildmode=pie
- goos: linux
goarch: amd64
goamd64: v2
buildargs: -buildmode=pie
- goos: linux
goarch: amd64
goamd64: v3
buildargs: -buildmode=pie
# END Linux AMD64 v1 v2 v3
fail-fast: false

Expand All @@ -46,6 +52,7 @@ jobs:
GOARM: ${{ matrix.goarm }}
GOAMD64: ${{ matrix.goamd64 }}
CGO_ENABLED: 0
BUILD_ARGS: ${{ matrix.buildargs }}

steps:
- name: Checkout codebase
Expand Down Expand Up @@ -73,7 +80,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '^1.19'
go-version: '^1.21'

- name: Install Dependencies
run: |
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/seed-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,12 @@ jobs:
strategy:
matrix:
goos: [ linux ]
goarch: [ arm64, 386, riscv64, mips64, mips64le, mipsle, mips ]
goarch: [ 386, riscv64, mips64, mips64le, mipsle, mips ]
include:
# BEGIN Linux ARM 5 6 7
# BEGIN Linux ARM 5 6 7 64
- goos: linux
goarch: arm64
buildargs: -buildmode=pie
- goos: linux
goarch: arm
goarm: 7
Expand All @@ -47,12 +50,15 @@ jobs:
- goos: linux
goarch: amd64
goamd64: v1
buildargs: -buildmode=pie
- goos: linux
goarch: amd64
goamd64: v2
buildargs: -buildmode=pie
- goos: linux
goarch: amd64
goamd64: v3
buildargs: -buildmode=pie
# END Linux AMD64 v1 v2 v3
fail-fast: false

Expand All @@ -63,6 +69,7 @@ jobs:
GOARM: ${{ matrix.goarm }}
GOAMD64: ${{ matrix.goamd64 }}
CGO_ENABLED: 0
BUILD_ARGS: ${{ matrix.buildargs }}

steps:
- name: Checkout codebase
Expand Down Expand Up @@ -99,7 +106,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '^1.19'
go-version: '^1.21'

- name: Install Dependencies
run: |
Expand All @@ -116,7 +123,6 @@ jobs:
- name: Build dae
run: |
mkdir -p ./build/
export CGO_ENABLED=0
export GOFLAGS="-trimpath -modcacherw"
export OUTPUT=build/dae-$ASSET_NAME
export VERSION=${{ steps.get_version.outputs.VERSION }}
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,15 @@ else
VERSION ?= unstable-$(date).r$(count).$(commit)
endif

BUILD_ARGS := -trimpath -ldflags "-s -w -X github.com/daeuniverse/dae/cmd.Version=$(VERSION) -X github.com/daeuniverse/dae/common/consts.MaxMatchSetLen_=$(MAX_MATCH_SET_LEN)" $(BUILD_ARGS)

.PHONY: clean-ebpf ebpf dae submodule submodules

## Begin Dae Build
dae: export GOOS=linux
dae: ebpf
go build -o $(OUTPUT) -trimpath -buildmode=pie -ldflags "-s -w -X github.com/daeuniverse/dae/cmd.Version=$(VERSION) -X github.com/daeuniverse/dae/common/consts.MaxMatchSetLen_=$(MAX_MATCH_SET_LEN)" .
@echo $(CFLAGS)
go build -o $(OUTPUT) $(BUILD_ARGS) .
## End Dae Build

## Begin Git Submodules
Expand Down
4 changes: 2 additions & 2 deletions cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ func newControlPlane(log *logrus.Logger, bpf interface{}, dnsCache map[string]*c
client := http.Client{
Transport: &http.Transport{
DialContext: func(ctx context.Context, network, addr string) (c net.Conn, err error) {
cd := netproxy.ContextDialer{Dialer: direct.SymmetricDirect}
cd := netproxy.ContextDialerConverter{Dialer: direct.SymmetricDirect}
conn, err := cd.DialContext(ctx, common.MagicNetwork("tcp", conf.Global.SoMarkFromDae), addr)
if err != nil {
return nil, err
Expand Down Expand Up @@ -319,7 +319,7 @@ func newControlPlane(log *logrus.Logger, bpf interface{}, dnsCache map[string]*c
client := http.Client{
Transport: &http.Transport{
DialContext: func(ctx context.Context, network, addr string) (c net.Conn, err error) {
cd := netproxy.ContextDialer{Dialer: direct.SymmetricDirect}
cd := netproxy.ContextDialerConverter{Dialer: direct.SymmetricDirect}
conn, err := cd.DialContext(ctx, common.MagicNetwork("tcp", conf.Global.SoMarkFromDae), addr)
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion common/netutils/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ func resolve(ctx context.Context, d netproxy.Dialer, dns netip.AddrPort, host st
}

// Dial and write.
cd := &netproxy.ContextDialer{Dialer: d}
cd := &netproxy.ContextDialerConverter{Dialer: d}
c, err := cd.DialContext(ctx, network, dns.String())
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion component/outbound/dialer/connectivity_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ func (d *Dialer) HttpCheck(ctx context.Context, u *netutils.URL, ip netip.Addr,
if method == "" {
method = http.MethodGet
}
cd := &netproxy.ContextDialer{Dialer: d.Dialer}
cd := &netproxy.ContextDialerConverter{Dialer: d.Dialer}
cli := http.Client{
Transport: &http.Transport{
DialContext: func(ctx context.Context, network, addr string) (c net.Conn, err error) {
Expand Down
2 changes: 1 addition & 1 deletion component/outbound/dialer/trojan/trojan.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func (s *Trojan) Dialer(option *dialer.GlobalOption, nextDialer netproxy.Dialer)
serviceName = "GunService"
}
d = &grpc.Dialer{
NextDialer: &netproxy.ContextDialer{Dialer: d},
NextDialer: &netproxy.ContextDialerConverter{Dialer: d},
ServiceName: serviceName,
ServerName: s.Sni,
AllowInsecure: s.AllowInsecure || option.AllowInsecure,
Expand Down
2 changes: 1 addition & 1 deletion component/outbound/dialer/v2ray/v2ray.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func (s *V2Ray) Dialer(option *dialer.GlobalOption, nextDialer netproxy.Dialer)
serviceName = "GunService"
}
d = &grpc.Dialer{
NextDialer: &netproxy.ContextDialer{Dialer: d},
NextDialer: &netproxy.ContextDialerConverter{Dialer: d},
ServiceName: serviceName,
ServerName: sni,
AllowInsecure: s.AllowInsecure || option.AllowInsecure,
Expand Down
2 changes: 1 addition & 1 deletion control/dns_control.go
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ func (c *DnsController) dialSend(invokingDepth int, req *udpRequest, data []byte

ctxDial, cancel := context.WithTimeout(context.TODO(), consts.DefaultDialTimeout)
defer cancel()
bestContextDialer := netproxy.ContextDialer{
bestContextDialer := netproxy.ContextDialerConverter{
Dialer: dialArgument.bestDialer,
}

Expand Down
2 changes: 1 addition & 1 deletion control/tcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ func (c *ControlPlane) RouteDialTcp(p *RouteDialParam) (conn netproxy.Conn, err
}
ctx, cancel := context.WithTimeout(context.TODO(), consts.DefaultDialTimeout)
defer cancel()
cd := netproxy.ContextDialer{
cd := netproxy.ContextDialerConverter{
Dialer: d,
}
return cd.DialContext(ctx, common.MagicNetwork("tcp", routingResult.Mark), dialTarget)
Expand Down
2 changes: 1 addition & 1 deletion control/udp_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ begin:
if err != nil {
return nil, false, err
}
cd := netproxy.ContextDialer{
cd := netproxy.ContextDialerConverter{
Dialer: dialOption.Dialer,
}
ctx, cancel := context.WithTimeout(context.TODO(), consts.DefaultDialTimeout)
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/bits-and-blooms/bloom/v3 v3.5.0
github.com/cilium/ebpf v0.11.0
github.com/daeuniverse/dae-config-dist/go/dae_config v0.0.0-20230604120805-1c27619b592d
github.com/daeuniverse/softwind v0.0.0-20230806140139-8dd211d63c60
github.com/daeuniverse/softwind v0.0.0-20230809141237-cbe650b0e27c
github.com/gorilla/websocket v1.5.0
github.com/json-iterator/go v1.1.12
github.com/miekg/dns v1.1.55
Expand All @@ -34,7 +34,7 @@ require (
github.com/golang/mock v1.6.0 // indirect
github.com/google/pprof v0.0.0-20230705174524-200ffdc848b8 // indirect
github.com/klauspost/compress v1.16.7 // indirect
github.com/mzz2017/quic-go v0.0.0-20230806040851-f9ecab3bb42a // indirect
github.com/mzz2017/quic-go v0.0.0-20230809140948-2ea096492e36 // indirect
github.com/onsi/ginkgo/v2 v2.11.0 // indirect
github.com/quic-go/qtls-go1-20 v0.3.1 // indirect
golang.org/x/mod v0.12.0 // indirect
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ github.com/cilium/ebpf v0.11.0/go.mod h1:WE7CZAnqOL2RouJ4f1uyNhqr2P4CCvXFIqdRDUg
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/daeuniverse/dae-config-dist/go/dae_config v0.0.0-20230604120805-1c27619b592d h1:hnC39MjR7xt5kZjrKlef7DXKFDkiX8MIcDXYC/6Jf9Q=
github.com/daeuniverse/dae-config-dist/go/dae_config v0.0.0-20230604120805-1c27619b592d/go.mod h1:VGWGgv7pCP5WGyHGUyb9+nq/gW0yBm+i/GfCNATOJ1M=
github.com/daeuniverse/softwind v0.0.0-20230806140139-8dd211d63c60 h1:3h6gBNiPvaEINMKJWwjAz6TojZ4MpSj+fLWj/uvqrRs=
github.com/daeuniverse/softwind v0.0.0-20230806140139-8dd211d63c60/go.mod h1:SXBNF3LXl1cfYKxoRJO/aK5ycoTNdou280mM9cGZYr4=
github.com/daeuniverse/softwind v0.0.0-20230809141237-cbe650b0e27c h1:CWSa7Jnmuz8pWjMi31wxbSC+cPDzk9eZ5UClZMC2uIc=
github.com/daeuniverse/softwind v0.0.0-20230809141237-cbe650b0e27c/go.mod h1:fL1IT5Qi5oZsrZwq38b4HYQH5AFe8XofpuukHQByTbM=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down Expand Up @@ -91,8 +91,8 @@ github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8=
github.com/mzz2017/disk-bloom v1.0.1 h1:rEF9MiXd9qMW3ibRpqcerLXULoTgRlM21yqqJl1B90M=
github.com/mzz2017/disk-bloom v1.0.1/go.mod h1:JLHETtUu44Z6iBmsqzkOtFlRvXSlKnxjwiBRDapizDI=
github.com/mzz2017/quic-go v0.0.0-20230806040851-f9ecab3bb42a h1:clBJMmZdRtli4Tko2ZdQ+3n1cA4Es/0ao3tB5vXvctY=
github.com/mzz2017/quic-go v0.0.0-20230806040851-f9ecab3bb42a/go.mod h1:DBA25b2LoPhrfSzOPE8KcDOicysx00qvvnqe0BpA8DQ=
github.com/mzz2017/quic-go v0.0.0-20230809140948-2ea096492e36 h1:ikWpUK6uyLmECHFDL/ZU3KA86l7eqIpDf3L46GA42jI=
github.com/mzz2017/quic-go v0.0.0-20230809140948-2ea096492e36/go.mod h1:DBA25b2LoPhrfSzOPE8KcDOicysx00qvvnqe0BpA8DQ=
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
Expand Down