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

kn fails to build for Windows platform #365

Closed
navidshaikh opened this issue Aug 15, 2019 · 2 comments · Fixed by #367
Closed

kn fails to build for Windows platform #365

navidshaikh opened this issue Aug 15, 2019 · 2 comments · Fixed by #367
Labels
kind/bug Categorizes issue or PR as related to a bug.
Milestone

Comments

@navidshaikh
Copy link
Collaborator

Current master fails to build for Windows

 GO111MODULE=on GOOS=windows GOARCH=amd64 go build -mod=vendor ./cmd/...
# github.com/knative/client/pkg/kn/commands/plugin
pkg/kn/commands/plugin/plugin_verifier.go:138:11: undefined: syscall.Stat_t
pkg/kn/commands/plugin/plugin_verifier.go:140:32: undefined: syscall.Stat_t
@navidshaikh navidshaikh added the kind/bug Categorizes issue or PR as related to a bug. label Aug 15, 2019
@navidshaikh
Copy link
Collaborator Author

We should delegate the executable check for plugin to underlying platform.

@navidshaikh
Copy link
Collaborator Author

var sys *syscall.Stat_t
var ok bool
if sys, ok = fileInfo.Sys().(*syscall.Stat_t); !ok {
// We can check the files' owner/group
return eaw.addWarning("cannot check owner/group of file %s", path)
}
isOwner := checkIfUserIsFileOwner(sys.Uid)
isInGroup, err := checkIfUserInGroup(sys.Gid)

Apparently, this part is not portable, https://groups.google.com/forum/#!topic/golang-nuts/ywS7xQYJkHY

navidshaikh added a commit to navidshaikh/client that referenced this issue Aug 15, 2019
 Fixes knative#365
 The code used for checking whether plugin is executable or not in plugin verifier
 does not build for Windows.

 Removing the executable check to unblock Windows builds, we could add the check back
 which is portable.
@navidshaikh navidshaikh added this to the v0.8.0 milestone Aug 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant