kreuzwerker / awsu

Enhanced account switching for AWS, supports Yubikey as MFA source
GNU General Public License v3.0
175 stars 16 forks source link

Add windows support #50

Open piksel opened 3 years ago

piksel commented 3 years ago

With this change it seems like windows is fully supported.

Usually, building for all platforms on go works out of the box, but since this uses cgo, I think you need to build the windows binaries on windows (or using an appropriate xplat toolchain setup).

mavogel commented 3 years ago

awesome @piksel! Can you also add tests in GH actions for windows? You might find the windows related commands from here useful: https://github.com/gesellix/awsu/commits/master

piksel commented 3 years ago

I'm not sure I understand what you mean. The https://github.com/gesellix/awsu/commit/ed157b1d43ce608e4632b9c7fba6db1fc718e0f6 commit only deals with a symlink (which does work on recent versions of windows). The test CI action probably does not work on windows, but that is because it relies on tools that might not be available in the windows image:

Why isn't this used for tests?

go test ./... -cover

(the test PHONY in Makefile is this:)

go list ./... | grep -v exp | xargs go test -cover
mavogel commented 3 years ago

I'm sorry, I wasn't precise enough. I was more referring to this commit: https://github.com/gesellix/awsu/commit/663bc0bef84c28f0325b3f7fc6ca4739c84d7122 Feel free to adapt the makefile accordingly :) The repo was outdated and we are refurbishing it now.

piksel commented 3 years ago

I added windows as a matrix target to the test workflow. Gesellix' fork also included macos, and built on ubuntu-latest instead of ubuntu-20.04, but I figured this was what was inside the scope of this PR. Adding support to goreleaser as well might be tricky, since the dependencies work very differently on windows and linux. Have not tried it though...

mavogel commented 3 years ago

Awesome :) thanks. Regarding the builds: we will address this in #56