GithubHelp home page GithubHelp logo

Comments (13)

freeformz avatar freeformz commented on June 30, 2024

@kr I would assume that godep (or similar tooling) would DTRT when vendoring here instead of pushing this down to the build pack.

from heroku-buildpack-go.

kr avatar kr commented on June 30, 2024

Yes, godep should do the right thing. But this issue also has to do with projects that don't use godep. It used to be that, for such projects, the buildpack had no way to know the import path (which is why we defined the .godir convention). Now, the buildpack can check for a canonical import path magic comment.

Of the three possible ways to figure out the app's import path (Godeps.json, .godir, canonical import path), the canonical import path is the only one defined and approved by the Go team and used by stock go tooling that ships with the compiler. So I think if the canonical import path is present, it should be used.

from heroku-buildpack-go.

cyx avatar cyx commented on June 30, 2024

Do you mean defining GOPATH as an environment variable and having the
buildpack read that?

On Sun, May 17, 2015 at 12:40 PM, Keith Rarick [email protected]
wrote:

Yes, godep should do the right thing. But this issue also has to do with
projects that don't use godep. It used to be that, for such projects, the
buildpack had no way to know the import path (which is why we defined the
.godir convention). Now, the buildpack can check for a canonical import
path magic comment.

Of the three possible ways to figure out the app's import path (
Godeps.json, .godir, canonical import path), the canonical import path is
the only one defined and approved by the Go team and used by stock go
tooling that ships with the compiler. So I think if the canonical import
path is present, it should be used.


Reply to this email directly or view it on GitHub
#63 (comment)
.

from heroku-buildpack-go.

kr avatar kr commented on June 30, 2024

Do you mean defining GOPATH as an environment variable and having the
buildpack read that?

No, please see the link above for the definition of a canonical import path. This is about determining the base import path for the app. It is orthogonal to the choice of GOPATH.

from heroku-buildpack-go.

freeformz avatar freeformz commented on June 30, 2024

@kr My plan (pending some discussion and fact finding) is to remove support for non godep deploys, possibly adding in support for tools like https://github.com/kardianos/vendor and https://github.com/constabulary/gb as they become more feature complete.

from heroku-buildpack-go.

elithrar avatar elithrar commented on June 30, 2024

@freeformz Before I consider hacking on anything, have you started any work on making gb build (and/or also gb-vendor) an option for the buildpack?

from heroku-buildpack-go.

freeformz avatar freeformz commented on June 30, 2024

@elithrar Not as of yet as we've been focused on prepping some other stuff.

I'm happy to review your work when it's ready!

from heroku-buildpack-go.

kr avatar kr commented on June 30, 2024

Some more facts for your finding: this thread was revived today. https://groups.google.com/d/msg/golang-dev/74zjMON9glU/4lWCRDCRZg0J

If we're lucky, all the vendoring tools (and users thereof) will converge on this convention, and the buildpack will have only to run go install -vendor ./... and care not which vendoring tool was used. 😁

(Of course, that doesn't solve the issue of how to find the import path of the repo root, but this issue provides a pretty clear way to handle that: canonical import paths.)

from heroku-buildpack-go.

elithrar avatar elithrar commented on June 30, 2024

Yep, that's what prompted me to comment here! I'm thinking (with Go 1.5 in
mind) of the following changes:

  • When Go 1.5 hits we test for the presence of a /vendor directory in the
    build dir and (if so) run go install -vendor ./... - should be able to
    drop it in ahead of the godeps checks in
    https://github.com/heroku/heroku-buildpack-go/blob/master/bin/compile#L58
    and other areas where we check for godeps today.
  • Else we continue to either run godep or go get (if .godir exists) as
    per the present

That way, if a user is using (for example) gb-vendor it doesn't matter:
that's something for them to manage at a repo level. Heroku just accepts
the push and the buildpack detects the appropriate action. Since the
buildpack hardcodes the Go version there shouldn't be a need to do a
version check to determine if go build -vendor is safe either.

On Fri, Jun 12, 2015 at 12:44 PM Keith Rarick [email protected]
wrote:

Some more facts for your finding: this thread was revived today.
https://groups.google.com/d/msg/golang-dev/74zjMON9glU/4lWCRDCRZg0J

If we're lucky, all the vendoring tools (and users thereof) will converge
on this convention, and the buildpack will have only to run go install
-vendor ./... and care not which vendoring tool was used. [image: 😁]

(Of course, that doesn't solve the issue of how to find the import path of
the repo root, but this issue provides a pretty clear way to handle that:
canonical import paths.)


Reply to this email directly or view it on GitHub
#63 (comment)
.

from heroku-buildpack-go.

kr avatar kr commented on June 30, 2024

In the spirit of being a little more on-topic, here is how to get the canonical import path, aka "import comment":

go list -f {{.ImportComment}}

from heroku-buildpack-go.

freeformz avatar freeformz commented on June 30, 2024

Please see #83. I haven't tested it yet.
/cc @cyx

from heroku-buildpack-go.

cyx avatar cyx commented on June 30, 2024

Cool, will check in a few.

On Tue, Jun 16, 2015 at 11:33 AM, Edward Muller [email protected]
wrote:

Please see #83 #83. I
haven't tested it yet.
/cc @cyx https://github.com/cyx


Reply to this email directly or view it on GitHub
#63 (comment)
.

from heroku-buildpack-go.

freeformz avatar freeformz commented on June 30, 2024

Closing this in favor of #88

from heroku-buildpack-go.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.