sandia-minimega / minimega

minimega
GNU General Public License v3.0
148 stars 66 forks source link

Can't build some components #1431

Closed floren closed 3 years ago

floren commented 3 years ago

Describe your environment

  1. master (75fe6c97a83e143bd61ca5e0744c12f05c16e501)
  2. Debian, kernel 4.19.0
  3. Go 1.15.2 linux/amd64
  4. N/A

Describe the bug

I want to update my binaries so I can use a more recent protonuke. build.bash complains about a dependency:

john@thufir:~/minimega$ ./build.bash 
BUILD PACKAGES (linux)
apigen
bridge
gonetflow
igor
igorweb
iomeshage
meshage
miniccc
minicli
miniclient
minidoc
minifuzzer
minilog
minimega
minipager
miniplumber
minirouter
minitest
minitunnel
miniweb
nbd
nfcat
passwordify
src/passwordify/main.go:10:2: code in directory /home/john/minimega/src/vendor/golang.org/x/crypto/ssh/terminal expects import "ssh/terminal"

and so does trying to build directly:

john@thufir:~/minimega/src/protonuke$ GOPATH=/home/john/minimega/ go build
ssh.go:18:2: code in directory /home/john/minimega/src/vendor/golang.org/x/crypto/ssh expects import "ssh"
ssh.go:19:2: code in directory /home/john/minimega/src/vendor/golang.org/x/crypto/ssh/terminal expects import "ssh/terminal"

What's the right way to build things?

mkunz7 commented 3 years ago

use go 1.12 for now ku.nz/miniclass

jecompton commented 3 years ago

Actually, this is just the go format checker dying on comments. In src/vendor/golang.org/x/crypto/ssh/terminal/util.go and src/vendor/golang.org/x/crypto/ssh/doc.go there are comments on the package line like package terminal // import "ssh/terminal".

Delete the double-slash to the end of the line for those two lines and you should be able to build.

jecompton commented 3 years ago

Actually, this is just the go format checker dying on comments. In src/vendor/golang.org/x/crypto/ssh/terminal/util.go and src/vendor/golang.org/x/crypto/ssh/doc.go there are comments on the package line like package terminal // import "ssh/terminal".

Delete the double-slash to the end of the line for those two lines and you should be able to build.

Oops, maybe it's not just a format error. I think it's actually trying to parse it as something like package terminal//import and thinks it is trying to include itself.

Anyway, the fix is the same, and the lesson is don't put comments on package lines in .go code.

aherna commented 3 years ago

@jecompton interesting ill have to check this out. These are vendor packages and have to dig into what changed in the vetting between 1.12.17 officially support go version and latest versions