From 8e6afaa207b0ad1246495a59330ab77f4600b9d8 Mon Sep 17 00:00:00 2001 From: Daniel Canter Date: Tue, 21 Dec 2021 07:39:04 -0500 Subject: [PATCH] Fix $(PWD) issue for Windows makefile Seems $(PWD) if the shell is powershell may not be inherited properly as it ends up being an empty string. The result of this is that using mingw's make with powershell is that $(PWD)/bin ends up being /bin and the windows shim will get placed there. make install afterwards will try to find the shim at $pwd/bin and fail. Changing to CURDIR https://www.gnu.org/software/make/manual/make.html#index-CURDIR seems to be a solution here as it's not inherited by the environment and is set by make itself so should work across any type of shell. Signed-off-by: Daniel Canter --- Makefile.windows | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.windows b/Makefile.windows index 4f4125aa5..6e62a87cf 100644 --- a/Makefile.windows +++ b/Makefile.windows @@ -26,7 +26,7 @@ WINDOWS_SHIM=bin/containerd-shim-runhcs-v1.exe BINARIES := $(addsuffix .exe,$(BINARIES)) $(WINDOWS_SHIM) $(WINDOWS_SHIM): script/setup/install-runhcs-shim go.mod - DESTDIR=$(PWD)/bin $< + DESTDIR=$(CURDIR)/bin $< bin/%.exe: cmd/% FORCE $(BUILD_BINARY)