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

The user's path is not passed to oracle, preventing use of cgo #33

Open
gavrie opened this issue Aug 17, 2015 · 1 comment
Open

The user's path is not passed to oracle, preventing use of cgo #33

gavrie opened this issue Aug 17, 2015 · 1 comment

Comments

@gavrie
Copy link

gavrie commented Aug 17, 2015

When the plugin runs oracle, it disregards the user's path from the environment. This, in turn, prevents cgo from working if Go is not installed in a standard system directory.

For example, on my setup, Go is installed in /usr/local/go. This directory is added to the PATH in my ~/.bashrc file, and is inherited by the Atom environment. But when the plugin runs oracle it runs it without the current customized path, causing it to fail. Copied from the Atom dev console:

/home/gavrie/work/go/bin/oracle -pos=/home/gavrie/work/go/src/github.com/elastifile/tesla/cmd/tesla/cli.go:#365 -format=plain callers github.com/elastifile/tesla/cmd/tesla
cgo failed: [go tool cgo -objdir /tmp/net_C590577505 -- -I /tmp/net_C590577505 cgo_linux.go cgo_unix.go]: exec: "go": executable file not found in $PATH
/usr/local/go/src/net/lookup_unix.go:56:20: undeclared name: cgoLookupHost
/usr/local/go/src/net/lookup_unix.go:64:20: undeclared name: cgoLookupIP
/usr/local/go/src/net/lookup_unix.go:72:19: undeclared name: cgoLookupPort
/usr/local/go/src/net/lookup_unix.go:80:20: undeclared name: cgoLookupCNAME
oracle: couldn't load packages due to errors: net

As a workaround, I've written a small wrapper script to run oracle with the correct path. As a full solution, I suggest passing in the current path when calling oracle. Alternatively, please allow the path to be configurable (similar to the Go path).

@anacrolix
Copy link

I'm getting this error too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants