Skip to content

Errors from git commands when a pkg and its sub-pkg is in Godeps #73

@jpfuentes2

Description

@jpfuentes2

We have a case where we need the top-level pkg of a given Go pkg for use in our application and also one of its sub-pkgs b/c it's a CLI. It seems gpm produces errors in output because it tries to git checkout the sub-pkg even though it's not a submodule but just a sub-directory in the parent pkg.

Fortunately, gpm seems to still work as the binary gets installed in $GOPATH/bin; however, it'd be nice if we could avoid or suppress errors in output from gpm to avoid confusion.

You can see a basic Godeps file here along with the errors from running gpm: https://gist.github.com/jpfuentes2/ad63ff939a87fdb3d92c

Also, I set $GOPATH and $GOBIN to a temporary directory for the test above and, again, the binary was installed along w/ the pkg.

Potential workarounds:

  • Do not issue vcs checkout commands if it's a sub-pkg and it's not a submodule (or equivalent).
  • Add a comment in the version placeholder to designate no checkout whereby the vcs will not attempt to checkout the sub-pkg.
  • Punt and instruct users to move the sub-pkg to a Makefile or other build script using go get after a gpm run.

I don't know if any of these ideas are good but maybe something sparks.

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