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

Some Windows Support #150

Merged
merged 7 commits into from
Jun 14, 2018
Merged

Some Windows Support #150

merged 7 commits into from
Jun 14, 2018

Conversation

siennathesane
Copy link
Contributor

Starts to fix #103. Not sure what full support would look like, but this is a start. In retrospect, I likely should've branched instead of doing this on master.

Fixed build number and OS version for Windows.

Signed-off-by: Mike Lloyd <[email protected]>
Mostly fixed character encoding and stuff.

Signed-off-by: Mike Lloyd <[email protected]>
@siennathesane
Copy link
Contributor Author

siennathesane commented Jun 4, 2018

image

It's not perfect, but it's a good starting place for now.

@siennathesane siennathesane mentioned this pull request Jun 4, 2018
@senorprogrammer
Copy link
Collaborator

I have no way to test this out. It would be great to have this code-reviewed and corroborated by a few other people.

@siennathesane
Copy link
Contributor Author

Sure. There's no rush.

@senorprogrammer
Copy link
Collaborator

One question I'm not clear on from the code: how does it know which platform to load? For example, with dns_darwin.go and dns_windows.go, how does it know which one to use?

@senorprogrammer
Copy link
Collaborator

Also, could you rebase against master for me? Once I understand this a bit better and the rebase is done, I'll merge it in. Thanks!

@siennathesane
Copy link
Contributor Author

siennathesane commented Jun 6, 2018

@senorprogrammer when you do go build, the compiler will build the binary based off the target OS. So if your GOOS is darwin, which is the default for macos, it will build anything with the *_darwin.go* flags. You can find more information on golang build tags here - I just use the *_windows.go build tag since they are nearly identical and it's easier for us humans to understand. :)

@senorprogrammer
Copy link
Collaborator

Awesome. Thank you for the explanation. If you're able to rebase this against master, I'll merge it in.

@senorprogrammer
Copy link
Collaborator

Just touching base. No hurry, when you're able to rebase this against master, I'll merge it right in.

@siennathesane
Copy link
Contributor Author

siennathesane commented Jun 11, 2018

Should be good now. I really meant to do this on a branch. Next time I will do so.

@siennathesane
Copy link
Contributor Author

Also, feel free to ping me for Windows stuff down the road since that's my domain. It's a nifty tool and would love to see better support for it.

Signed-off-by: Mike Lloyd <[email protected]>
@siennathesane
Copy link
Contributor Author

Travis is failing because you have go get ./... && go get github.com/go-test/deep && go test -v github.com/senorprogrammer/wtf/wtf_tests as one command and I don't know which part of it is failing, so I can't fix my builds until you're able to fix Travis.

@senorprogrammer
Copy link
Collaborator

The following errors:

18.51s$ go get ./... && go get github.com/go-test/deep && go test -v github.com/senorprogrammer/wtf/wtf_tests
# github.com/senorprogrammer/wtf/security
security/security_data.go:24:13: undefined: DnsServers
security/security_data.go:27:23: undefined: LoggedInUsers
# github.com/senorprogrammer/wtf/system
system/widget.go:17:14: undefined: SystemInfo

TravisCI runs on Linux and the changes you've made are now Mac & Windows-only.

Take a look at the way power/battery.go and power/batter_linux.go are defined at the top of the file. This might be fixed by adding // +build !windows and // +build windows to the respected files.

In the meantime I'll look into getting TravisCI to present useful error messages somehow.

@siennathesane
Copy link
Contributor Author

I think it would be good to cross-compile, but I'm not sure what that would look like on Travis.

@senorprogrammer senorprogrammer merged commit b04d444 into wtfutil:master Jun 14, 2018
@senorprogrammer
Copy link
Collaborator

Got it working. Thanks for making this PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Windows Support
2 participants