googlearchive / cloud-functions-go

Unofficial Native Go Runtime for Google Cloud Functions
Apache License 2.0
423 stars 44 forks source link

Improve Windows support #26

Closed iangudger closed 6 years ago

iangudger commented 6 years ago

Updates #12 (Windows support) Updates #6 (eliminates the dependency on GCC for packaging function.zip)

iangudger commented 6 years ago

@albertog, want to try this out?

iangudger commented 6 years ago

@ssttevee, this avoids compiling the native module when packaging for GCF which goes along nicely with your godev change.

albertog commented 6 years ago

yes I am interesting

2018-01-29 2:31 GMT+01:00 Ian Gudger notifications@github.com:

@albertog https://github.com/albertog, want to try this out?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/GoogleCloudPlatform/cloud-functions-go/pull/26#issuecomment-361116982, or mute the thread https://github.com/notifications/unsubscribe-auth/AADNevGT7ukt27HvHtuCfMWDLoQi4R96ks5tPR-DgaJpZM4Rv9J7 .

ssttevee commented 6 years ago

I haven't been able to get this to work, it just fails with a connection error. Is the execer module supposed to get compiled on the function instance?

iangudger commented 6 years ago

I downloaded the Windows 10 trial and installed it in VirtualBox. I then installed Cygwin x64 with the optional make and zip packages (selectable during the install process) and Node.js for Windows 64-bit msi installer. Then, in the Cygwin Terminal (I think this was previously called the Cygwin Bash Shell) I ran make. The resulting zip worked fine on GCF.

iangudger commented 6 years ago

@ssttevee The execer module gets compiled by GCF during the initial deployment. In fact, we never include compiled node modules in the function.zip file: https://github.com/GoogleCloudPlatform/cloud-functions-go/blob/master/Makefile#L19

ssttevee commented 6 years ago

I should have noticed 😅

It seems to be working fine after reinstalling cygwin. It also works with msys2. I think it should work as long as the user has access to the make and zip commands in their environment, not necessarily restricted to a specific POSIX emulator.

It may be worthwhile to look into a native windows method using a powershell command.

iangudger commented 6 years ago

@ssttevee

If you want to send a PR adding either PowerShell support or msys2 instructions, I will happily review it.

If this works and looks good, could you approve this PR?