Skip to content
This repository was archived by the owner on Mar 28, 2018. It is now read-only.

Make build fail with clear error message if not run from $GOPATH #1029

Description

@jodh-intel

If the user runs make from a directory outside their $GOPATH, they get a very confusing error message:

$ make
proxy/vm.go:25:2: cannot find package "github.com/containers/virtcontainers/hyperstart" in any of:
        /usr/local/go/src/github.com/containers/virtcontainers/hyperstart (from $GOROOT)
        /home/james/go/src/github.com/containers/virtcontainers/hyperstart (from $GOPATH)
Makefile:5300: recipe for target 'cc-proxy' failed
make[1]: *** [cc-proxy] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/home/james/git/cc-oci-runtime'
Makefile:1686: recipe for target 'all' failed
make: *** [all] Error 2

We should find a way to make the build (and maybe even the configure stage) fail with a sane message along the lines of:

ERROR: You are attempting to build outside of $GOPATH.
ERROR: The build should be run from "$GOPATH/src/github.com/01org/cc-oci-runtime/".

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions