[Help Wanted] The Make file build for Meshery.io repository is failing with Error 125

While working on one of the issues for Meshery.io, I stumbled upon an error.
The makefile build command - make site is failing with the following error:

$ make site
/usr/bin/sh: -c: line 1: syntax error near unexpected token (' /usr/bin/sh: -c: line 1: if command -v docker >/dev/null 2>&1 && docker info >/dev/null 2>&1; then C:/Program Files (x86)/GnuWin32/bin/make docker; elif bundle check >/dev/null 2>&1; then bundle exec jekyll serve --drafts --incremental --livereload --config _config_dev.yml; else echo "Docker is not running and required gems are not installed."; echo "Start Docker (so 'make site' can run in container) or run: bundle install --path vendor/bundle"; exit 1; fi'
make: *** [site] Error 2

Upon checking further, I could identify that the Makefile dynamically expands the $(MAKE) variable on line 8 into the absolute GnuWin32 path (C:/Program Files (x86)/...), which immediately trips up the Git Bash POSIX shell.

Therefore, using the command - make MAKE=make site,
I am getting following error now:

make[1]: Entering directory C:/Users/Tigma/Desktop/GSSoC/meshery.io' docker run --name meshery-io -d --rm -p 4000:4000 -v pwd`:"/srv/jekyll" -w /srv/jekyll jekyll/jekyll:4 jekyll serve --drafts --livereload

What's next:
Debug this container error with Gordon → docker ai "help me fix this container error"
docker: Error response from daemon: the working directory 'C:/Program Files/Git/srv/jekyll' is invalid; it needs to be an absolute path

Run 'docker run --help' for more information
make[1]: *** [docker] Error 125
make[1]: Leaving directory `C:/Users/Tigma/Desktop/GSSoC/meshery.io'
make: *** [site] Error 2

Screenshot

make is installed on my system locally using the Chocolatey package manager with the command choco install make.

The Make command works for other repositories on my machine (eg - Meshery repo, the Docs repo).

OS: Windows 11

Can someone please review this and suggest a fix?

Hi Himanshu, could you try these changes?

In the `site` and `site-no-incremental` targets, add quotes around $(MAKE):

"$(MAKE)" docker

And update the docker target:

docker:
	@MSYS_NO_PATHCONV=1 docker run --name meshery-io -d --rm -p 4000:4000 -v "$(shell pwd -W)":/srv/jekyll -w /srv/jekyll jekyll/jekyll:4 jekyll serve --drafts --livereload

Please try this and let us know if it fixes the issue.

Hi Ragul,

I have tried your method but it seems I am stumbling upon a different error now:


$ make site
pwd: unknown option -- W
Try 'pwd --help' for more information.
make[1]: Entering directory `C:/Users/Tigma/Desktop/GSSoC/meshery.io'

What's next:
Debug this container error with Gordon → docker ai "help me fix this container error"
docker: invalid spec: :/srv/jekyll: empty section between colons

Run 'docker run --help' for more information
make[1]: *** [docker] Error 125
make[1]: Leaving directory `C:/Users/Tigma/Desktop/GSSoC/meshery.io'
make: *** [site] Error 2

Upon checking the https://github.com/meshery/meshery.io/pull/2839/changes
I can see a different docker target has been proposed in the merged PR.

Could you please clarify which is the right one to use?( I am currently using the one mentioned by you)