ops icon indicating copy to clipboard operation
ops copied to clipboard

ops giving unhelpful error msg for missing linked lib on osx

Open eyberg opened this issue 2 years ago • 4 comments

ops currently gives a very un-helpful error msg if it can't find a library that it is trying to load

➜  l ops run test
panic: failed building manifest: file does not exist

goroutine 1 [running]:
github.com/nanovms/ops/cmd.runCommandHandler(0xc000177080, {0xc0002a05f0, 0x1, 0x1})
        /Users/eyberg/go/src/github.com/nanovms/ops/cmd/cmd_run.go:62 +0x348
github.com/spf13/cobra.(*Command).execute(0xc000177080, {0xc0002a05d0, 0x1, 0x1})
        /Users/eyberg/go/pkg/mod/github.com/spf13/[email protected]/command.go:846 +0x5f8
github.com/spf13/cobra.(*Command).ExecuteC(0xc00003edc0)
        /Users/eyberg/go/pkg/mod/github.com/spf13/[email protected]/command.go:950 +0x3ad
github.com/spf13/cobra.(*Command).Execute(...)
        /Users/eyberg/go/pkg/mod/github.com/spf13/[email protected]/command.go:887
main.main()
        /Users/eyberg/go/src/github.com/nanovms/ops/ops.go:8 +0x1e

it should tell the user what file it is trying to load and I don't think this error wrapping lib that's in the codebase is very useful at all and should prob just be yanked

I think the error is that findlib function of lepton/ldd_darwin.go

eyberg avatar Feb 02 '22 20:02 eyberg

I can work on this. Can you elaborate how to reproduce this?

girishramnani avatar Feb 05 '22 19:02 girishramnani

Started playing around with OPS earlier today and having this issue as well. I'm on a m1 with MacOS 12.1, just installed OPS via curl https://ops.city/get.sh -sSfL | sh.

❯ ops version
Ops version: 0.1.29
Nanos version: 0.0

When I try to either ops run my-go-binary or ops image create ... I get a similar error.

❯ ops run main
 100% |████████████████████████████████████████|  [0s:0s]
panic: failed building manifest: file does not exist

goroutine 1 [running]:
github.com/nanovms/ops/cmd.runCommandHandler(0xc0009aeb00, {0xc00097f470, 0x1, 0x1})
	/Users/eyberg/go/src/github.com/nanovms/ops/cmd/cmd_run.go:62 +0x348
github.com/spf13/cobra.(*Command).execute(0xc0009aeb00, {0xc00097f450, 0x1, 0x1})
	/Users/eyberg/go/pkg/mod/github.com/spf13/[email protected]/command.go:846 +0x5f8
github.com/spf13/cobra.(*Command).ExecuteC(0xc000200dc0)
	/Users/eyberg/go/pkg/mod/github.com/spf13/[email protected]/command.go:950 +0x3ad
github.com/spf13/cobra.(*Command).Execute(...)
	/Users/eyberg/go/pkg/mod/github.com/spf13/[email protected]/command.go:887
main.main()
	/Users/eyberg/go/src/github.com/nanovms/ops/ops.go:8 +0x1e

Any hints on which library might be missing would be greatly appreciated.

geoah avatar Feb 10 '22 01:02 geoah

@geoah we're working on a fix for this but if you copy your binary to a linux and run 'ldd my-go-binary' one of the libraries listed in that output it's probably not being found on your mac and will need to be copied down and put into the location it expects - on linux we parse all this output and auto-include the libraries found; typically this isn't a problem w/go unless you are doing something with possibly a cgo dependency

eyberg avatar Feb 10 '22 01:02 eyberg

@eyberg thank you, building my binary with CGO disabled doesn't result in an error.

geoah avatar Feb 10 '22 16:02 geoah