windows support #40

Closed
sobolevn opened this Issue Jun 25, 2016 · 15 comments

Comments

Projects
None yet
5 participants
@sobolevn
Owner

sobolevn commented Jun 25, 2016

Right now git-secret does not support windows operating systems. But the architecture is suitable to handle it.

I have never actually worked with windows. And I have neither time nor will to get starting.

What are the limitations?
What frameworks/external programs does it require to run bash on windows?
Is it even possible?
How many tests do pass right now (if any)?

I would highly appreciate any help on this topic!

@timchurchard

This comment has been minimized.

Show comment
Hide comment
@timchurchard

timchurchard Feb 12, 2017

Contributor

On Windows 10 using Windows Subsystem for Linux (Beta) (Based on Ubuntu 14.04) git-secret worked out of the box 100% test pass after installing git and build-essential.
https://msdn.microsoft.com/en-gb/commandline/wsl/install_guide

I'll try in Windows 7 VM using mingw tomorrow. http://www.mingw.org/

Contributor

timchurchard commented Feb 12, 2017

On Windows 10 using Windows Subsystem for Linux (Beta) (Based on Ubuntu 14.04) git-secret worked out of the box 100% test pass after installing git and build-essential.
https://msdn.microsoft.com/en-gb/commandline/wsl/install_guide

I'll try in Windows 7 VM using mingw tomorrow. http://www.mingw.org/

@sobolevn

This comment has been minimized.

Show comment
Hide comment
@sobolevn

sobolevn Feb 12, 2017

Owner

Wow! Thats great! Are there any ways to automate this testing?
Some kind of Travis for Windows?

Owner

sobolevn commented Feb 12, 2017

Wow! Thats great! Are there any ways to automate this testing?
Some kind of Travis for Windows?

@timchurchard

This comment has been minimized.

Show comment
Hide comment
@timchurchard

timchurchard Feb 13, 2017

Contributor

I've tried using Cygwin https://cygwin.com on Windows 7 but the tests are failing, I think cygwin is having trouble with my username "First Last". I'll continue trying.

For automated test how about http://docs.tea-ci.org -- Although I haven't used it. It's free for open source projects.

Contributor

timchurchard commented Feb 13, 2017

I've tried using Cygwin https://cygwin.com on Windows 7 but the tests are failing, I think cygwin is having trouble with my username "First Last". I'll continue trying.

For automated test how about http://docs.tea-ci.org -- Although I haven't used it. It's free for open source projects.

@sobolevn

This comment has been minimized.

Show comment
Hide comment
@sobolevn

sobolevn Feb 13, 2017

Owner

Hm, maybe https://www.appveyor.com/ is better?
I have never actually used neither of these.

As I see it, TeaCI is a fork of another project (drone.io). The master branch was not updated for 9 months for now.

Owner

sobolevn commented Feb 13, 2017

Hm, maybe https://www.appveyor.com/ is better?
I have never actually used neither of these.

As I see it, TeaCI is a fork of another project (drone.io). The master branch was not updated for 9 months for now.

@beInDev

This comment has been minimized.

Show comment
Hide comment
@beInDev

beInDev May 4, 2017

I had no problem running the tests on cygwin.

Had bats installed and recognized in path.

git secret also seemed to work as expected (haven't tried extensively yet), only had to change _git_secret_tools.sh and uncomment the windows os check case and made it so it would use the _git_secret_tools_linux.sh

OS: Windows 10
Cygwin version: CYGWIN_NT-10.0 2.8.0(0.309/5/3) x86_64 Cygwin

Test Results:

image

beInDev commented May 4, 2017

I had no problem running the tests on cygwin.

Had bats installed and recognized in path.

git secret also seemed to work as expected (haven't tried extensively yet), only had to change _git_secret_tools.sh and uncomment the windows os check case and made it so it would use the _git_secret_tools_linux.sh

OS: Windows 10
Cygwin version: CYGWIN_NT-10.0 2.8.0(0.309/5/3) x86_64 Cygwin

Test Results:

image

@sobolevn

This comment has been minimized.

Show comment
Hide comment
@sobolevn

sobolevn May 4, 2017

Owner

@beInDev wow that's very cool!

What's you gpg, bash and git versions?
Are you interested in making a PR with:

  1. Your changes in code
  2. Documentation (how to set the whole thing up)
  3. CI for Windows, there were some choices in this thread

Thanks!

Owner

sobolevn commented May 4, 2017

@beInDev wow that's very cool!

What's you gpg, bash and git versions?
Are you interested in making a PR with:

  1. Your changes in code
  2. Documentation (how to set the whole thing up)
  3. CI for Windows, there were some choices in this thread

Thanks!

@beInDev

This comment has been minimized.

Show comment
Hide comment
@beInDev

beInDev May 4, 2017

Sure :)

The packages were installed from the original cygwin setup program.

  • GnuPG (GPG) version: 1.4.21
  • Bash version: GNU bash, version 4.4.12(3)-release (x86_64-unknown-cygwin)
  • git: 2.12.2

I'll do a PR ASAP

beInDev commented May 4, 2017

Sure :)

The packages were installed from the original cygwin setup program.

  • GnuPG (GPG) version: 1.4.21
  • Bash version: GNU bash, version 4.4.12(3)-release (x86_64-unknown-cygwin)
  • git: 2.12.2

I'll do a PR ASAP

@yadavnikhil

This comment has been minimized.

Show comment
Hide comment
@yadavnikhil

yadavnikhil Dec 18, 2017

For me, all commands works with just adding below lines in src/_utils/_git_secret_tools.sh for Git Bash (MINGW - Msys) on Windows 10:

MINGW*)
"$1_linux" "${@:2}"
;;

GPG version: gpg (GnuPG) 1.4.21
git version 2.13.0.windows.1
GNU bash, version 4.4.12(1)-release (x86_64-pc-msys)
"uname.exe -s": MINGW64_NT-10.0

Will it possible a add above small change atleast to support Git Bash?

Thanks

yadavnikhil commented Dec 18, 2017

For me, all commands works with just adding below lines in src/_utils/_git_secret_tools.sh for Git Bash (MINGW - Msys) on Windows 10:

MINGW*)
"$1_linux" "${@:2}"
;;

GPG version: gpg (GnuPG) 1.4.21
git version 2.13.0.windows.1
GNU bash, version 4.4.12(1)-release (x86_64-pc-msys)
"uname.exe -s": MINGW64_NT-10.0

Will it possible a add above small change atleast to support Git Bash?

Thanks

@sobolevn

This comment has been minimized.

Show comment
Hide comment
@sobolevn

sobolevn Dec 18, 2017

Owner

@yadavnikhil could you please make a pull request for this feature?

Owner

sobolevn commented Dec 18, 2017

@yadavnikhil could you please make a pull request for this feature?

@yadavnikhil

This comment has been minimized.

Show comment
Hide comment
@yadavnikhil

yadavnikhil Dec 18, 2017

@sobolevn OK, I'll open for this small change, but again challenge is to have automated testing for it.

@sobolevn OK, I'll open for this small change, but again challenge is to have automated testing for it.

@sobolevn

This comment has been minimized.

Show comment
Hide comment
@sobolevn

sobolevn Dec 18, 2017

Owner

Let's leave automated tests for now. It may be a next step.

Owner

sobolevn commented Dec 18, 2017

Let's leave automated tests for now. It may be a next step.

@nozzlegear

This comment has been minimized.

Show comment
Hide comment
@nozzlegear

nozzlegear Dec 24, 2017

Just wanted to chime in and confirm that this is working for me out-of-the-box using WSL on Windows, which (I think?) is no longer in beta. I followed the installation instructions for the deb package and got it running immediately. 🎉

Just wanted to chime in and confirm that this is working for me out-of-the-box using WSL on Windows, which (I think?) is no longer in beta. I followed the installation instructions for the deb package and got it running immediately. 🎉

@sobolevn

This comment has been minimized.

Show comment
Hide comment
@sobolevn

sobolevn Dec 24, 2017

Owner

@nozzlegear could you please share your setup? What's your OS version? How is it all bound together? (Sorry, I have seen Windows for almost 10 years)

Owner

sobolevn commented Dec 24, 2017

@nozzlegear could you please share your setup? What's your OS version? How is it all bound together? (Sorry, I have seen Windows for almost 10 years)

@nozzlegear

This comment has been minimized.

Show comment
Hide comment
@nozzlegear

nozzlegear Dec 24, 2017

Sure! I'm running Windows 10 Fall Creator's Update, which is build 16299, the latest one available at the time I'm writing this unless you're in the Windows beta program.

My dev environment uses a real unix bash (actually zsh) thanks to the "Windows Subsystem for Linux". WSL has had a couple different names while it was in beta, but it seems like everyone has settled on calling it WSL or Windows Subsystem for Linux. You can install it on Windows 10 by downloading the Ubuntu app from the Windows Store. This app gives us developers on Windows access to real bash, including apt/apt-get, git, gpg, vim, emacs and so on because it's running on a native Ubuntu layer (but without any VM between). It loads my .bashrc or .zshrc file on startup and behaves exactly like it would on Ubuntu.

So to use git-secret, all I had to do was open that Ubuntu app which launches the bash shell, and follow the git-secret instructions for installing the deb package. It all works perfectly, I didn't have to configure anything or do anything weird to make it work on Windows. It was just add the apt key, run sudo apt update and sudo apt install git-secret.

I'm pretty sure this will work on older versions of Windows 10 too as the WSL has been available for over a year now on several different versions of Windows 10. WSL is not available on Windows 8 or Windows 7 though.

Sure! I'm running Windows 10 Fall Creator's Update, which is build 16299, the latest one available at the time I'm writing this unless you're in the Windows beta program.

My dev environment uses a real unix bash (actually zsh) thanks to the "Windows Subsystem for Linux". WSL has had a couple different names while it was in beta, but it seems like everyone has settled on calling it WSL or Windows Subsystem for Linux. You can install it on Windows 10 by downloading the Ubuntu app from the Windows Store. This app gives us developers on Windows access to real bash, including apt/apt-get, git, gpg, vim, emacs and so on because it's running on a native Ubuntu layer (but without any VM between). It loads my .bashrc or .zshrc file on startup and behaves exactly like it would on Ubuntu.

So to use git-secret, all I had to do was open that Ubuntu app which launches the bash shell, and follow the git-secret instructions for installing the deb package. It all works perfectly, I didn't have to configure anything or do anything weird to make it work on Windows. It was just add the apt key, run sudo apt update and sudo apt install git-secret.

I'm pretty sure this will work on older versions of Windows 10 too as the WSL has been available for over a year now on several different versions of Windows 10. WSL is not available on Windows 8 or Windows 7 though.

@sobolevn

This comment has been minimized.

Show comment
Hide comment
@sobolevn

sobolevn Dec 25, 2017

Owner

@nozzlegear thank you!

I am going to close this, since we now support:

  1. bash for Windows (thanks to @yadavnikhil via #123, it is now in master)
  2. WSL (by its design)

If anyone finds any issues - feel free to open a new issue.

Owner

sobolevn commented Dec 25, 2017

@nozzlegear thank you!

I am going to close this, since we now support:

  1. bash for Windows (thanks to @yadavnikhil via #123, it is now in master)
  2. WSL (by its design)

If anyone finds any issues - feel free to open a new issue.

@sobolevn sobolevn closed this Dec 25, 2017

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