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

Go version in mod file too low for webrtc v3 #2728

Closed
hansgylling opened this issue Apr 3, 2024 · 5 comments
Closed

Go version in mod file too low for webrtc v3 #2728

hansgylling opened this issue Apr 3, 2024 · 5 comments

Comments

@hansgylling
Copy link
Contributor

hansgylling commented Apr 3, 2024

Your environment.

  • Version: 3.2.34
  • Browser: N/A
  • Other Information: This is also a problem in most of the other repos from pion as well. I don't have time to report that right now.

What did you do?

Try to run tests or build example programs with the Go version declared in the go.mod file, i.e. Go 1.13.

What did you expect?

That programs compile with the version that is declared as minimum/compatible.

What happened?

Programs didn't compile.

Solution

Increase Go version in go.mod file to 1.19.

Shell session that demonstrate the problem

As can be seen in my example, programs and tests in this repo compiles with Go 1.19 but not with Go 1.18.

$ cd pion/webrtc
$ git checkout v3
Switched to branch 'v3'
Your branch is up-to-date with 'origin/v3'.
$ git pull
Already up-to-date.
$ switchgo go1.18.10
Switched to Go installation: go version go1.18.10 linux/amd64
$ go test -count=1 -p=1 ./...
# github.com/pion/transport/v2/udp
/home/hansg/go/pkg/mod/github.com/pion/transport/[email protected]/udp/batchconn.go:50:16: undefined: atomic.Bool
FAIL	github.com/pion/webrtc/v3 [build failed]
?   	github.com/pion/webrtc/v3/examples	[no test files]
ok  	github.com/pion/webrtc/v3/internal/fmtp	0.001s
FAIL	github.com/pion/webrtc/v3/internal/mux [build failed]
ok  	github.com/pion/webrtc/v3/internal/util	0.001s
ok  	github.com/pion/webrtc/v3/pkg/media	0.001s [no tests to run]
ok  	github.com/pion/webrtc/v3/pkg/media/h264reader	0.001s
ok  	github.com/pion/webrtc/v3/pkg/media/h264writer	0.002s
ok  	github.com/pion/webrtc/v3/pkg/media/ivfreader	0.002s
ok  	github.com/pion/webrtc/v3/pkg/media/ivfwriter	0.001s
ok  	github.com/pion/webrtc/v3/pkg/media/oggreader	0.002s
ok  	github.com/pion/webrtc/v3/pkg/media/oggwriter	0.002s
ok  	github.com/pion/webrtc/v3/pkg/media/rtpdump	0.001s
ok  	github.com/pion/webrtc/v3/pkg/media/samplebuilder	0.151s
ok  	github.com/pion/webrtc/v3/pkg/null	0.002s
$ find . -name main.go -exec go build {} \;
./examples/rtp-forwarder/main.go
# github.com/pion/transport/v2/udp
/home/hansg/go/pkg/mod/github.com/pion/transport/[email protected]/udp/batchconn.go:50:16: undefined: atomic.Bool
./examples/data-channels-flow-control/main.go
# github.com/pion/transport/v2/udp
/home/hansg/go/pkg/mod/github.com/pion/transport/[email protected]/udp/batchconn.go:50:16: undefined: atomic.Bool
./examples/broadcast/main.go
# github.com/pion/transport/v2/udp
/home/hansg/go/pkg/mod/github.com/pion/transport/[email protected]/udp/batchconn.go:50:16: undefined: atomic.Bool
./examples/vnet/show-network-usage/main.go
# github.com/pion/transport/v2/udp
/home/hansg/go/pkg/mod/github.com/pion/transport/[email protected]/udp/batchconn.go:50:16: undefined: atomic.Bool
./examples/trickle-ice/main.go
# github.com/pion/transport/v2/udp
/home/hansg/go/pkg/mod/github.com/pion/transport/[email protected]/udp/batchconn.go:50:16: undefined: atomic.Bool
./examples/ice-tcp/main.go
# github.com/pion/transport/v2/udp
/home/hansg/go/pkg/mod/github.com/pion/transport/[email protected]/udp/batchconn.go:50:16: undefined: atomic.Bool
./examples/pion-to-pion/answer/main.go
# github.com/pion/transport/v2/udp
/home/hansg/go/pkg/mod/github.com/pion/transport/[email protected]/udp/batchconn.go:50:16: undefined: atomic.Bool
./examples/pion-to-pion/offer/main.go
# github.com/pion/transport/v2/udp
/home/hansg/go/pkg/mod/github.com/pion/transport/[email protected]/udp/batchconn.go:50:16: undefined: atomic.Bool
./examples/insertable-streams/main.go
# github.com/pion/transport/v2/udp
/home/hansg/go/pkg/mod/github.com/pion/transport/[email protected]/udp/batchconn.go:50:16: undefined: atomic.Bool
./examples/rtcp-processing/main.go
# github.com/pion/transport/v2/udp
/home/hansg/go/pkg/mod/github.com/pion/transport/[email protected]/udp/batchconn.go:50:16: undefined: atomic.Bool
./examples/play-from-disk-renegotiation/main.go
# github.com/pion/transport/v2/udp
/home/hansg/go/pkg/mod/github.com/pion/transport/[email protected]/udp/batchconn.go:50:16: undefined: atomic.Bool
./examples/reflect/main.go
# github.com/pion/transport/v2/udp
/home/hansg/go/pkg/mod/github.com/pion/transport/[email protected]/udp/batchconn.go:50:16: undefined: atomic.Bool
./examples/data-channels-detach/jsfiddle/main.go
package command-line-arguments
	imports syscall/js: build constraints exclude all Go files in /usr/local/go/src/syscall/js
./examples/data-channels-detach/main.go
# github.com/pion/transport/v2/udp
/home/hansg/go/pkg/mod/github.com/pion/transport/[email protected]/udp/batchconn.go:50:16: undefined: atomic.Bool
./examples/save-to-disk-av1/main.go
# github.com/pion/transport/v2/udp
/home/hansg/go/pkg/mod/github.com/pion/transport/[email protected]/udp/batchconn.go:50:16: undefined: atomic.Bool
./examples/swap-tracks/main.go
# github.com/pion/transport/v2/udp
/home/hansg/go/pkg/mod/github.com/pion/transport/[email protected]/udp/batchconn.go:50:16: undefined: atomic.Bool
./examples/rtp-to-webrtc/main.go
# github.com/pion/transport/v2/udp
/home/hansg/go/pkg/mod/github.com/pion/transport/[email protected]/udp/batchconn.go:50:16: undefined: atomic.Bool
./examples/ice-restart/main.go
# github.com/pion/transport/v2/udp
/home/hansg/go/pkg/mod/github.com/pion/transport/[email protected]/udp/batchconn.go:50:16: undefined: atomic.Bool
./examples/simulcast/main.go
# github.com/pion/transport/v2/udp
/home/hansg/go/pkg/mod/github.com/pion/transport/[email protected]/udp/batchconn.go:50:16: undefined: atomic.Bool
./examples/stats/main.go
# github.com/pion/transport/v2/udp
/home/hansg/go/pkg/mod/github.com/pion/transport/[email protected]/udp/batchconn.go:50:16: undefined: atomic.Bool
./examples/data-channels/jsfiddle/main.go
package command-line-arguments
	imports syscall/js: build constraints exclude all Go files in /usr/local/go/src/syscall/js
./examples/data-channels/main.go
# github.com/pion/transport/v2/udp
/home/hansg/go/pkg/mod/github.com/pion/transport/[email protected]/udp/batchconn.go:50:16: undefined: atomic.Bool
./examples/ortc/main.go
# github.com/pion/transport/v2/udp
/home/hansg/go/pkg/mod/github.com/pion/transport/[email protected]/udp/batchconn.go:50:16: undefined: atomic.Bool
./examples/ice-single-port/main.go
# github.com/pion/transport/v2/udp
/home/hansg/go/pkg/mod/github.com/pion/transport/[email protected]/udp/batchconn.go:50:16: undefined: atomic.Bool
./examples/bandwidth-estimation-from-disk/main.go
# github.com/pion/transport/v2/udp
/home/hansg/go/pkg/mod/github.com/pion/transport/[email protected]/udp/batchconn.go:50:16: undefined: atomic.Bool
./examples/save-to-disk/main.go
# github.com/pion/transport/v2/udp
/home/hansg/go/pkg/mod/github.com/pion/transport/[email protected]/udp/batchconn.go:50:16: undefined: atomic.Bool
./examples/play-from-disk/main.go
# github.com/pion/transport/v2/udp
/home/hansg/go/pkg/mod/github.com/pion/transport/[email protected]/udp/batchconn.go:50:16: undefined: atomic.Bool
./examples/custom-logger/main.go
# github.com/pion/transport/v2/udp
/home/hansg/go/pkg/mod/github.com/pion/transport/[email protected]/udp/batchconn.go:50:16: undefined: atomic.Bool
$ switchgo go1.19.13
Switched to Go installation: go version go1.19.13 linux/amd64
$ go test -count=1 -p=1 ./...
ok  	github.com/pion/webrtc/v3	72.853s
?   	github.com/pion/webrtc/v3/examples	[no test files]
?   	github.com/pion/webrtc/v3/examples/bandwidth-estimation-from-disk	[no test files]
?   	github.com/pion/webrtc/v3/examples/broadcast	[no test files]
?   	github.com/pion/webrtc/v3/examples/custom-logger	[no test files]
?   	github.com/pion/webrtc/v3/examples/data-channels	[no test files]
?   	github.com/pion/webrtc/v3/examples/data-channels-detach	[no test files]
?   	github.com/pion/webrtc/v3/examples/data-channels-flow-control	[no test files]
?   	github.com/pion/webrtc/v3/examples/ice-restart	[no test files]
?   	github.com/pion/webrtc/v3/examples/ice-single-port	[no test files]
?   	github.com/pion/webrtc/v3/examples/ice-tcp	[no test files]
?   	github.com/pion/webrtc/v3/examples/insertable-streams	[no test files]
?   	github.com/pion/webrtc/v3/examples/internal/signal	[no test files]
?   	github.com/pion/webrtc/v3/examples/ortc	[no test files]
?   	github.com/pion/webrtc/v3/examples/pion-to-pion/answer	[no test files]
?   	github.com/pion/webrtc/v3/examples/pion-to-pion/offer	[no test files]
?   	github.com/pion/webrtc/v3/examples/play-from-disk	[no test files]
?   	github.com/pion/webrtc/v3/examples/play-from-disk-renegotiation	[no test files]
?   	github.com/pion/webrtc/v3/examples/reflect	[no test files]
?   	github.com/pion/webrtc/v3/examples/rtcp-processing	[no test files]
?   	github.com/pion/webrtc/v3/examples/rtp-forwarder	[no test files]
?   	github.com/pion/webrtc/v3/examples/rtp-to-webrtc	[no test files]
?   	github.com/pion/webrtc/v3/examples/save-to-disk	[no test files]
?   	github.com/pion/webrtc/v3/examples/save-to-disk-av1	[no test files]
?   	github.com/pion/webrtc/v3/examples/simulcast	[no test files]
?   	github.com/pion/webrtc/v3/examples/stats	[no test files]
?   	github.com/pion/webrtc/v3/examples/swap-tracks	[no test files]
?   	github.com/pion/webrtc/v3/examples/trickle-ice	[no test files]
?   	github.com/pion/webrtc/v3/examples/vnet/show-network-usage	[no test files]
ok  	github.com/pion/webrtc/v3/internal/fmtp	0.001s
ok  	github.com/pion/webrtc/v3/internal/mux	0.002s
ok  	github.com/pion/webrtc/v3/internal/util	0.001s
ok  	github.com/pion/webrtc/v3/pkg/media	0.001s [no tests to run]
ok  	github.com/pion/webrtc/v3/pkg/media/h264reader	0.001s
ok  	github.com/pion/webrtc/v3/pkg/media/h264writer	0.002s
ok  	github.com/pion/webrtc/v3/pkg/media/ivfreader	0.001s
ok  	github.com/pion/webrtc/v3/pkg/media/ivfwriter	0.001s
ok  	github.com/pion/webrtc/v3/pkg/media/oggreader	0.001s
ok  	github.com/pion/webrtc/v3/pkg/media/oggwriter	0.001s
ok  	github.com/pion/webrtc/v3/pkg/media/rtpdump	0.001s
ok  	github.com/pion/webrtc/v3/pkg/media/samplebuilder	0.144s
ok  	github.com/pion/webrtc/v3/pkg/null	0.001s
?   	github.com/pion/webrtc/v3/pkg/rtcerr	[no test files]
$ find . -name main.go -print -exec go build {} \;
./examples/rtp-forwarder/main.go
./examples/data-channels-flow-control/main.go
./examples/broadcast/main.go
./examples/vnet/show-network-usage/main.go
./examples/trickle-ice/main.go
./examples/ice-tcp/main.go
./examples/pion-to-pion/answer/main.go
./examples/pion-to-pion/offer/main.go
./examples/insertable-streams/main.go
./examples/rtcp-processing/main.go
./examples/play-from-disk-renegotiation/main.go
./examples/reflect/main.go
./examples/data-channels-detach/jsfiddle/main.go
package command-line-arguments
	imports syscall/js: build constraints exclude all Go files in /usr/local/go/src/syscall/js
./examples/data-channels-detach/main.go
./examples/save-to-disk-av1/main.go
./examples/swap-tracks/main.go
./examples/rtp-to-webrtc/main.go
./examples/ice-restart/main.go
./examples/simulcast/main.go
./examples/stats/main.go
./examples/data-channels/jsfiddle/main.go
package command-line-arguments
	imports syscall/js: build constraints exclude all Go files in /usr/local/go/src/syscall/js
./examples/data-channels/main.go
./examples/ortc/main.go
./examples/ice-single-port/main.go
./examples/bandwidth-estimation-from-disk/main.go
./examples/save-to-disk/main.go
./examples/play-from-disk/main.go
./examples/custom-logger/main.go
@Sean-Der
Copy link
Member

Sean-Der commented Apr 3, 2024

Hey @hansgylling

Do you want to use Go 1.18 or is it ok to use 1.19?

I can update the go.mod file now on /v3 branch, but want to make sure we aren't negatively impacting you!

@hansgylling
Copy link
Contributor Author

I don't need Go 1.18. I just want the go.mod file to tell the truth about what's the actual minimum version. I'm already working on a PR. The change is done, just writing the PR now.

@hansgylling
Copy link
Contributor Author

Reporting this issue was triggered by your change in #2727 which used retract in the go.mod file, but the retract feature wasn't added until Go 1.16, https://go.dev/ref/mod#go-mod-file-retract

@hansgylling
Copy link
Contributor Author

I have tried to run the tests in most of the other pion repos and almost all of the ones I tested need a higher Go version to build the code than what is declared in go.mod.

@Sean-Der
Copy link
Member

Sean-Der commented Apr 4, 2024

Fixed with c1e5386

@Sean-Der Sean-Der closed this as completed Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants