Boringproxy fails to compile on Ubuntu 22

Hi,

Trying to compile boringproxy so I can run the latest fix for crypto (as Ubuntu 22.04.1 LTS ships with OpenSSH_8.9p1) but running into errors trying to compile it:

root@zur:~/buildbore/cmd/boringproxy# go build
package github.com/boringproxy/boringproxy/cmd/boringproxy
        imports crypto/tls
        imports crypto/ecdsa
        imports crypto/elliptic
        imports crypto/internal/nistec
        imports crypto/elliptic: import cycle not allowed
/usr/local/go/src/crypto/elliptic/nistec.go:8:2: import "crypto/internal/nistec" is a program, not an importable package
/usr/local/go/src/crypto/internal/nistec/p224.go:10:2: found packages fiat (fiat_test.go) and main (generate.go) in /usr/local/go/src/crypto/internal/nistec/fiat
package github.com/boringproxy/boringproxy/cmd/boringproxy
        imports context
        imports errors
        imports internal/reflectlite
        imports runtime
        imports internal/goarch
        imports bytes
        imports errors: import cycle not allowed
/usr/local/go/src/runtime/signal_linux_loong64.go:10:2: import "internal/goarch" is a program, not an importable package
/usr/local/go/src/runtime/internal/sys/consts.go:9:2: import "internal/goos" is a program, not an importable package
package github.com/boringproxy/boringproxy/cmd/boringproxy
        imports context
        imports errors
        imports internal/reflectlite
        imports runtime
        imports internal/goarch
        imports fmt
        imports internal/fmtsort
        imports sort
        imports internal/reflectlite: import cycle not allowed
package github.com/boringproxy/boringproxy/cmd/boringproxy
        imports context
        imports errors
        imports internal/reflectlite
        imports runtime
        imports internal/goarch
        imports bytes
        imports io
        imports sync
        imports runtime: import cycle not allowed
root@zur:~/buildbore/cmd/boringproxy# go version
go version go1.15 linux/amd64

What am I missing? I tried to use latest go version (1.19) but that gives even more errors.

Thanks for the report @kassemz. I’ll try building on Ubuntu 22.04.1 and let you know if I figure anything out.

Can you share the errors from go 1.19?

Hey @kassemz, sorry for the delay.

I just tried on a fresh Ubuntu 22.04.1 VM based off the official Ubuntu Docker image. Building master worked for me. The default version of golang was 1.18. I also manually installed 1.19 and that also appeared to work.

If you can give more details about the steps you took, I can try to help you debug the problem.

Also I should note that when building from master, you shouldn’t need to worry about the OpenSSH version too much anymore, since boringproxy itself has a fix for the crypto problem. See https://github.com/boringproxy/boringproxy/pull/194.

So you should be able to use the master builds here:

https://gemdrive.io/apps/delver/?drive=https://files.apitman.com&path=/public/boringproxy/master.

Or you can try building another another machine.