Skip to content

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

@gavrie

Description

@gavrie

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions