inconshreveable / log15

Structured, composable logging for Go
https://godoc.org/github.com/inconshreveable/log15
Other
1.1k stars 145 forks source link

Fix build under appengine #138

Closed arjunnukal closed 6 years ago

arjunnukal commented 6 years ago

Seems like appengine golang currently fails the build because this !appengine isn't being parsed properly. I believe comma-separating the fields is the correct fix there? It functions after this change locally.

arjunnukal commented 6 years ago

Hmm, seems like this actually fails in travis now. Maybe the intent was all of those be notted?

arjunnukal commented 6 years ago

@ChrisHines Seems you've merged most recently. Any chance we could get this in? Can't run an old appengine app until it's in HEAD. =/

kevinburke commented 6 years ago

When you say

appengine golang currently fails the build

Can you describe what you mean?

I believe it's correct as is - it says "build this file on linux but not appengine, and then also build it on Darwin, OpenBSD etc"

arjunnukal commented 6 years ago

@kevinburke appengine in dev is throwing syscall import errors. Looks roughly like:

go-app-builder: Failed parsing input: parser: bad import "syscall"

Manually editing this file in this way led to it being okay with the import, so it seems it's still trying to build it here.

arjunnukal commented 6 years ago

I wish I had better info, but appengine in general is a bit of nonsense magic :(

kevinburke commented 6 years ago

Can you paste a stack trace?

On Mon, Oct 2, 2017 at 21:15 arjunnukal notifications@github.com wrote:

I wish I had better info, but appengine in general is a bit of nonsense magic :(

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/inconshreveable/log15/pull/138#issuecomment-333710757, or mute the thread https://github.com/notifications/unsubscribe-auth/AAOSI5VEwhaXzhumr1HODJdHEFldX8xlks5soYrAgaJpZM4PoCWP .

--

-- Kevin Burke 925.271.7005 | kev.inburke.com

arjunnukal commented 6 years ago

@kevinburke Thanks for taking a look here by the way. I realize this is a somewhat vague one =|

Here's what it gives. Not a stack trace - it's just that it refuses to build =/

make start
dev_appserver.py appengine/app.yaml
INFO     2017-10-03 11:38:11,660 devappserver2.py:115] Skipping SDK update check.
INFO     2017-10-03 11:38:11,701 api_server.py:299] Starting API server at: http://localhost:63805
INFO     2017-10-03 11:38:11,709 dispatcher.py:224] Starting module "default" running at: http://localhost:8080
INFO     2017-10-03 11:38:11,711 admin_server.py:116] Starting admin server at: http://localhost:8000
ERROR    2017-10-03 11:38:13,058 instance_factory.py:194] Failed to build Go application: (Executed command: /path/to/google-cloud-sdk/platform/google_appengine/goroot-1.8/bin/go-app-builder -app_base /path/to/go/src/gitlab.com/my/Project/appengine -arch 6 -dynamic -goroot /path/to/google-cloud-sdk/platform/google_appengine/goroot-1.8 -gopath /path/to/go -nobuild_files ^vendor -incremental_rebuild -unsafe -print_extras_hash main.go)

2017/10/03 07:38:13 go-app-builder: Failed parsing input: parser: bad import "syscall" in github.com/inconshreveable/log15/term/terminal_appengine.go from GOPATH

There is no syscall import in terminal_appengine.go, so what I did to figure out the "culprit" here is rm them one by one until I no longer got a build failure.

Edit: Ooooh. So it looks like if I throw !darwin here, then it works. I guess the problem is actually just that my system is conflicting on !appengine and +darwin? Hmmm, wonder how I avoid that....

Might just be a bug in the appengine builder. glide allowed me to sanely use a fork here, which might just be the best bet for now.

kevinburke commented 6 years ago

I guess the problem is actually just that my system is conflicting on !appengine and +darwin? Hmmm, wonder how I avoid that....

That's probably it... you need to condition App Engine for both linux and mac I think