Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

terminal_check_solaris.go doesn't have a build tag and is breaking the build on AppEngine #947

Closed
Hexcles opened this issue Apr 4, 2019 · 4 comments · May be fixed by #948
Closed

terminal_check_solaris.go doesn't have a build tag and is breaking the build on AppEngine #947

Hexcles opened this issue Apr 4, 2019 · 4 comments · May be fixed by #948
Labels

Comments

@Hexcles
Copy link

Hexcles commented Apr 4, 2019

package logrus

I think this file should have a build tag like:

// +build solaris

similar to

// +build linux aix

I believe this is the reason logrus currently fails to build on AppEngine standard projects (where we can't use golang.org/x/sys/unix).

@dgsb
Copy link
Collaborator

dgsb commented Apr 5, 2019

I don't fix it will fix the build break because the _<platform_name>.go is an implicit +<platform_name> build constraint.
You can try that fix anyway and we will see what happens.

@dgsb
Copy link
Collaborator

dgsb commented Apr 5, 2019

Just curious how do you build for appengine ? Cross-compile from a linux host ?

@Hexcles
Copy link
Author

Hexcles commented Apr 5, 2019

@dgsb sorry, looks like my proposed fix wouldn't solve the problem, but bisecting led me to the real culprit that is also related to terminal: #943 , which moved terminal package into the root logrus package.

My AppEngine project imports the github.com/sirupsen/logrus package but not terminal. Before #943 my project deploys fine but once I check out past #943 I'm seeing this error:

2019/04/05 08:35:03 go-app-builder: Failed parsing input: parser: bad import "unsafe" in golang.org/x/sys/unix/affinity_linux.go

I'm not exactly familiar with the underlying implementation of AppEngine Go. The SDK actually bundles in a special go toolchain to build the binary. Any unsafe stuff (for example in golang.org/x/sys/unix, which is imported by various terminal_check*.go) can't be used on AppEngine. Previously things worked since the terminal package was separate and I never import it.

Hexcles added a commit to Hexcles/logrus that referenced this issue Apr 5, 2019
"unsafe" (in this case, imported via "golang.org/x/sys/unix") cannot be
used on AppEngine, so we need to add the "!appengine" build constraint
to files that use it (namely a few terminal_check_*.go).

Fixes sirupsen#947.
Hexcles added a commit to Hexcles/logrus that referenced this issue Apr 11, 2019
"unsafe" (in this case, imported via "golang.org/x/sys/unix") cannot be
used on AppEngine, so we need to add the "!appengine" build constraint
to files that use it (namely a few terminal_check_*.go).

Fixes sirupsen#947.
Hexcles added a commit to Hexcles/logrus that referenced this issue May 22, 2019
"unsafe" (in this case, imported via "golang.org/x/sys/unix") cannot be
used on AppEngine, so we need to add the "!appengine" build constraint
to terminal_check_unix.go.

Fixes sirupsen#947.
@stale
Copy link

stale bot commented Feb 26, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Feb 26, 2020
@stale stale bot closed this as completed Mar 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants