lifadev / archive_aws-lambda-go-shim

Author your AWS Lambda functions in Go, effectively.
https://github.com/eawsy/aws-lambda-go-shim
Apache License 2.0
789 stars 66 forks source link

Windows 7 MakeFile issue #40

Closed gopal-ramadugu closed 6 years ago

gopal-ramadugu commented 6 years ago

The make fails with below command. I am using cygwin64 for make. Am I missing something here ?

C:\docker>make docker run --rm\ -e HANDLER=handler\ -e PACKAGE=handler\ -e GOPATH=/C/Users/user/go\ -e LDFLAGS=''\ -v /C/docker:/C/docker\ -v /C/Users/user/go:/C/Users/user/go\ -w /C/docker\ eawsy/aws-lambda-go-shim:latest make -f makefile all make: makefile: No such file or directory make: No rule to make target `makefile'. Stop. make: [docker] Error 2

dir command:

Directory of C:\docker

10/23/2017 12:16 PM

. 10/23/2017 12:16 PM .. 10/23/2017 12:11 PM main 10/25/2017 01:34 PM 2,213 Makefile 10/23/2017 12:16 PM preview

fsenart commented 6 years ago

@gopal-ramadugu the build process inside windows is intended to be used with Make for Windows and not cygwin.

gopal-ramadugu commented 6 years ago

@fsenart I am getting the same error with gnuwin32 as well.

fsenart commented 6 years ago

@gopal-ramadugu do you use the official Makefile to run your build?

gopal-ramadugu commented 6 years ago

@fsenart I downloaded the file from git using wget -O Makefile https://git.io/vytH8

fsenart commented 6 years ago

Seeing your output it seems that the makefile is named 'makefile' and not 'Makefile'! It explains why it cannot find the file.

fsenart commented 6 years ago

Can you please modify your local Makefile and change eawsy/aws-lambda-go-shim:latest make -f makefile all by eawsy/aws-lambda-go-shim:latest make -f Makefile all to see if it works. After what we have to know why the the makefile name is interpreted in lowercase.

gopal-ramadugu commented 6 years ago

I am getting same error after changing it to MakeFile.

C:\docker\preview>make docker run --rm\ -e HANDLER=handler\ -e PACKAGE=handler\ -e GOPATH=/C/Users/gopal.ramadugu/go\ -e LDFLAGS=''\ -v /C/docker/preview:/C/docker/preview\ -v /C/Users/gopal.ramadugu/go:/C/Users/gopal.ramadugu/go\ -w /C/docker/preview\ eawsy/aws-lambda-go-shim:latest make -f Makefile all make: Makefile: No such file or directory make: No rule to make target `Makefile'. Stop. make: [docker] Error 2

C:\docker\preview>dir Volume in drive C has no label. Volume Serial Number is

Directory of C:\docker\preview

10/25/2017 03:37 PM

. 10/25/2017 03:37 PM .. 10/20/2017 03:44 PM 188 handler.go 10/25/2017 03:36 PM 11,614 index.html 10/25/2017 03:43 PM 2,210 Makefile

fsenart commented 6 years ago

@lsuss discovered the problem :wink: It seems you have a not properly configured Docker on your windows. Please read this article to allow your C drive to be mounted and shared by Docker and all should work. PS: obviously restart you windows, etc :trollface:

gopal-ramadugu commented 6 years ago

I use windows 7. We dont have the shared drivers on the docker settings. Windows 7 uses virtual box. There is a shared drive mapped in windows 7 for virtual box.

gopal-ramadugu commented 6 years ago

If I run below command it works. It seems to have an issue with eval of the directories. docker run --rm\ -e HANDLER=$(HANDLER)\ -e PACKAGE=$(PACKAGE)\ -e GOPATH=/c/Users/gopal.ramadugu/go\ -e LDFLAGS=''\ -v /c/Users/gopal.ramadugu/GoLambda/preview://c/Users/gopal.ramadugu/GoLambda/preview -v /c/Users/gopal.ramadugu/go:/c/Users/gopal.ramadugu/go\ -w /c/Users/gopal.ramadugu/GoLambda/preview\ eawsy/aws-lambda-go-shim:latest make -f /c/Users/gopal.ramadugu/GoLambda/preview/Makefile all

fsenart commented 6 years ago

@gopal-ramadugu I don't understand why above in your beginning logs you have -v /C/docker/preview:/C/docker/preview and now you have -v /c/Users/gopal.ramadugu/GoLambda/preview://c/Users/gopal.ramadugu/GoLambda/preview. Have you changes anything between the two runs? I think we have to create a dummy Makefile which prints various folders, etc to spot the difference between expectations and happenings.

fsenart commented 6 years ago

@gopal-ramadugu:

Please keep me informed about theses two remarks so we can resolve this issue soon. Thank you very much for your contribution.

fsenart commented 6 years ago

I'm assuming this issue is resolved. Please reopen and comment if otherwise.