-
Notifications
You must be signed in to change notification settings - Fork 128
Use different tool to "go build" per project #76
Comments
Is there any way to detect that an app is a GAE app? A file in the root of the import path? |
I guess this ticket boils down to 2 items:
|
Yes, the top level dir will contain a file named |
This would work for for
[rest of comment redacted] |
@amoghe That's not necessarily true. If you are using modules, they could be nested as in the image below (which is the recommendation from the Google App Engine team). |
It seems so ridiculous that GAE requires different tools because of its restricted runtime environment. Has anyone got access to the new GCE alpha (https://cloud.google.com/container-engine/)? It feels like the fix to this is just to not use a PaaS that requires Now, a cynic would say that I'm saying this because my day job is focused on Cloud Foundry, but seriously - run your go apps in containers rather than using GAE 😄. Sorry, just had to get that off my chest. TL;DR; Happy to accept a PR to fix this! |
Hi Joe, First of all thanks for this amazing package! I recently started using atom.io and I gotta say one of the reasons was this :) I am a Developer Advocate for the Go team and the Google Cloud Platform so we could say that if you have some complaints I'm happy to be your point of contact! I'll try to try to fix this and send a PR as soon as I have some time unless someone has been working on it. Cheers, and thanks again for this great tool! Francesc |
Hey @campoy, thanks for the help! Feel free to join the Gitter room if you'd like to discuss in more detail. |
@campoy @joefitzgerald - Just been dipping my toes in go development on app engine and using the atom editor. Unfortunately, every time I try to import from I'm fairly certain this is related to everything I'm reading here, but I'm wondering if there's been any progress since January on these issues? I'd love to be able to do go development with code assist targeting app engine (rather than requiring billing for the project I'm working on to use containers). But what I'm encountering right now sours me on the whole thing! |
You should consider using the new appengine packages https://godoc.org/google.golang.org/appengine That will solve all your problems :) On Sat, Oct 17, 2015 at 7:27 PM Alexander Trauzzi notifications@github.com
|
@campoy would this allow someone to stop using |
That's a good question ... the answer is no. goapp is still responsible for parsing app.yaml and other config files and On Mon, Oct 19, 2015 at 11:10 AM Joe Fitzgerald notifications@github.com
|
Hm, I'm still noticing an issue where goapp complains about duplicate definitions. Almost like as if it's got two GOPATHs? |
Completely unrelated issue here. If there's more than one way to access an imported package goapp will On Mon, Oct 19, 2015 at 11:20 AM Alexander Trauzzi notifications@github.com
|
@campoy Thanks for the insight. Based on that, is there any way for me to bundle |
@joefitzgerald For everything related to go-plus, using the new appengine packages completely eliminates the need for goapp. |
Wooohoo! On Mon, Oct 19, 2015 at 11:46 AM Derek Perkins notifications@github.com
|
@derekperkins wonderful! So you're saying that https://github.com/joefitzgerald/go-runtime/blob/e5534d1e72a3b410452d8e863925f2b7f8096dd5/lib/locator.js#L23 is effectively not required anymore? As you can see I'm going through a major rewrite of go-plus, and this will be a helpful simplification 😄. |
I'm saying that that fix is not needed for everybody using the new packages. So yeah, probably not many go-plus users care about it anymore :) On Mon, Oct 19, 2015 at 12:07 PM Joe Fitzgerald notifications@github.com
|
Wait, so if I am starting a new project, what do I have to do? |
The plan is:
|
@campoy Haha, I meant for the local development server. What do I run to try my app out from inside of my package? |
No, use On Mon, Oct 19, 2015 at 12:14 PM Joe Fitzgerald notifications@github.com
|
Okay, so when I use |
Expanded answer:
package app
import (
"fmt"
"net/http"
"google.golang.org/appengine"
"google.golang.org/appengine/log"
)
func init() {
http.HandleFunc("/", handler)
}
func handler(w http.ResponseWriter, r *http.Request) {
ctx := appengine.NewContext(r)
log.Infof(ctx, "handler called")
fmt.Fprintln(w, "hello!")
}
runtime: go
api_version: go1
handlers:
- url: /
script: _go_app
|
@atrauzzi: create a new directory |
@campoy Is this directory outside of my GOPATH? |
no On Mon, Oct 19, 2015 at 12:24 PM Alexander Trauzzi notifications@github.com
|
GOPATH
On Mon, Oct 19, 2015 at 12:25 PM Francesc Campoy Flores campoy@google.com
|
Oh, you can do that structure even inside of a package? Well isn't that fancy! #TIL |
@joefitzgerald I don't think you should remove that yet. I don't have any inside info, but from a heavy appengine user, here's the current situation in a nutshell:
It feels like the Google team is actively trying to have people migrate away from using |
When working on golang projects that are meant to run in Google AppEngine (GAE), these projects must be compiled (and tested) with tools that ship with the SDK, namely
goapp
. This is a wrapper around thego
binary, so it is almost fully compatible withgo
(i.e. you can rungoapp <CMD>
instead ofgo <CMD>
, e.g. -goapp test
instead ofgo test
)One way to work with this project in Atom (using go-plus) would be to add a symlink called "go" to point to the "goapp" binary, and set the installation path variable to the dir containing this symlink (thereby "fooling" the plugin to use the wrapper tool). However I believe this would persist the change for all projects (even non GAE ones).
Do you have suggestions on how I could make this change on a per-project basis? (Or maybe have this plugin detect GAE projects (using the index.yaml file in the top dir), and invoke the
goapp
tool instead (which is assumed to be in $PATH, or discoverable in the same way the go bin is detected).The text was updated successfully, but these errors were encountered: