mailgun / godebug

DEPRECATED! https://github.com/derekparker/delve
Apache License 2.0
2.5k stars 107 forks source link

Use Cmd.CombinedOutput() to get the actual error message #51

Closed Ripounet closed 9 years ago

Ripounet commented 9 years ago

Here is the first error I stumbled on after gogetting :

$ godebug run reorder.go
Failed to identify standard library packages. Here's the error from 'go list std':
cmd/addr2line
cmd/cgo
cmd/fix
cmd/go
cmd/gofmt
...200 more lines...

and here is what the true command displays on my system (error on stderr, list items on stdin) :

$ go list std
can't load package: package pkg/runtime: C source files not allowed when not using cgo: atomic_amd64x.c cgocall.c defs.c env_posix.c float.c heapdump.c lock_futex.c mcache.c mcentral.c mem_linux.c mfixalloc.c mgc0.c mheap.c msize.c netpoll_epoll.c os_linux.c panic.c parfor.c print.c proc.c race0.c rune.c runtime.c signal_amd64x.c signal_unix.c stack.c sys_x86.c traceback_x86.c vdso_linux_amd64.c zalg_linux_amd64.c zchan_linux_amd64.c zcomplex_linux_amd64.c zcpuprof_linux_amd64.c zhashmap_linux_amd64.c ziface_linux_amd64.c zlfstack_linux_amd64.c zmalloc_linux_amd64.c zmprof_linux_amd64.c znetpoll_linux_amd64.c zrdebug_linux_amd64.c zruntime1_linux_amd64.c zsema_linux_amd64.c zsigqueue_linux_amd64.c zslice_linux_amd64.c zstring_linux_amd64.c zsymtab_linux_amd64.c ztime_linux_amd64.c
can't load package: package pkg/runtime/debug: C source files not allowed when not using cgo: debug.c
cmd/addr2line
cmd/cgo
cmd/fix
cmd/go
cmd/gofmt
...200 more lines...
jeremyschlatter commented 9 years ago

Thanks! I would like to solve the underlying issue, too. Could you post a copy of reorder.go or a simplified version that shows the same problem?

Ripounet commented 9 years ago

Hi Jeremy The same happens when godebug running a hello world go file. The root of the problem seems to be that for some reason "go list std" prints errors and returns value 1 (though it also prints the non-error packages). Not sure anything can be done in godebug, it's already sensible to print the error and continue execution. Maybe print the error to Stderr instead of Stdout? Cheers

jeremyschlatter commented 9 years ago

I made it print to stderr and cleaned up the message a bit. Thanks for letting me know about this!

I'm guessing godebug should still work in this case, though possibly a bit slower. Is it otherwise working correctly for you?