plgd-dev / go-coap

Implementation of CoAP Server & Client in Go
https://coap.technology
Apache License 2.0
443 stars 116 forks source link

Pion pkg/net dependency error #533

Closed nealjack closed 6 months ago

nealjack commented 6 months ago

Hey there,

There seems to be a dependency error with pion dtls. If I create a new go module with go mod init <modulename>, with a main.go that imports github.com/plgd-dev/go-coap/v3 and run go mod tidy, github.com/pion/dtls/v2/pkg/net can't be found.

❯ go mod tidy
go: finding module for package github.com/plgd-dev/go-coap/v3/mux
go: finding module for package github.com/plgd-dev/go-coap/v3/message
go: finding module for package github.com/plgd-dev/go-coap/v3/message/codes
go: finding module for package github.com/pion/dtls/v2
go: finding module for package github.com/plgd-dev/go-coap/v3
go: found github.com/pion/dtls/v2 in github.com/pion/dtls/v2 v2.2.10
go: found github.com/plgd-dev/go-coap/v3 in github.com/plgd-dev/go-coap/v3 v3.3.2
go: found github.com/plgd-dev/go-coap/v3/message in github.com/plgd-dev/go-coap/v3 v3.3.2
go: found github.com/plgd-dev/go-coap/v3/message/codes in github.com/plgd-dev/go-coap/v3 v3.3.2
go: found github.com/plgd-dev/go-coap/v3/mux in github.com/plgd-dev/go-coap/v3 v3.3.2
go: finding module for package github.com/pion/dtls/v2/pkg/net
go: <modulename> imports
        github.com/plgd-dev/go-coap/v3 imports
        github.com/plgd-dev/go-coap/v3/dtls imports
        github.com/pion/dtls/v2/pkg/net: module github.com/pion/dtls/v2@latest found (v2.2.10), but does not contain package github.com/pion/dtls/v2/pkg/net

This issue can be recreated as far back as v3.1.5 by creating a module with the dtls psk example.

Danielius1922 commented 6 months ago

I see the problem, we're using the master branch, where github.com/pion/dtls/v2/pkg/net exists. This state exists since commit https://github.com/plgd-dev/go-coap/commit/0b3dbf03683400972fd074bdd440d836e6f83b83. Whilst latest uses the release (v2) branch and in v2 the pkg/net does not exists. I've excluded v2.2.9 in go.mod previously, so the master branch would continue to be used instead of latest release. But I see that v2.2.10 has been released, so I need to exclude that version as well.

@hasheddan, any idea if pkg/net will be merged into release from master? Or is that a v3 feature? Until it is merged I need to keep excluding new releases in our go.mod file.

hasheddan commented 6 months ago

@Danielius1922 it will be a v3 feature, but we should get a v3.0.0. release out soon. I'll follow up on that and circle back here to update the dependency when done 👍🏻

Danielius1922 commented 6 months ago

@Danielius1922 it will be a v3 feature, but we should get a v3.0.0. release out soon. I'll follow up on that and circle back here to update the dependency when done 👍🏻

Great, thanks!