Comments (13)
@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.
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.
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.
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.
@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.
@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.
@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.
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.
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) rungo 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/4lWCRDCRZg0JIf 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.
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.
Please see #83. I haven't tested it yet.
/cc @cyx
from heroku-buildpack-go.
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.
Closing this in favor of #88
from heroku-buildpack-go.
Related Issues (20)
- Custom build tags HOT 1
- Builds failing on Go 1.16rc1 HOT 3
- Error decompressing go1.15.8.linux-amd64.tar.gz HOT 2
- Push rejected, failed to compile Go app. HOT 10
- Failed to compile Go app without vendor on Go 1.16 HOT 4
- Way to set GO111MODULE for 1.16?
- Custom Vendoring doesnt work!
- go: command not found HOT 4
- go_pre_compile does not work HOT 2
- Error decompressing go1.16.10.linux-amd64.tar.gz HOT 2
- Mulitple instances of app running HOT 2
- Requested file unknown to the buildpack HOT 5
- Add Go 1.18.6 and 1.19.1
- go cmd unavailable for go-pre-compile or go-post-compile HOT 1
- Add Go 1.20
- build fails on specific packages - go1.20
- Go 1.21.1 is released!
- Go 1.22 was released on 07.02.2024
- Feature Request: Optionally print `go env`
- Feature Request: Output any env vars that are picked up
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from heroku-buildpack-go.