aws-sam-cli-local icon indicating copy to clipboard operation
aws-sam-cli-local copied to clipboard

The wrong path to samlocal is being used in makefile for-loops

Open bamajap opened this issue 3 years ago • 3 comments

I am running my make commands within a Git bash shell on Windows 10.

Actual Makefile target causing the problem:

TEMPLATES = $(shell find . -type f -name 'template.yml')

## Check
## Validate the SAM template
.PHONY: check
check: $(TEMPLATES)
    for template in $^ ; do samlocal validate -t $${template} ; done

Altered Makefile target that easily reproduces the problem:

test: $(shell ls *.*)
    for template in $^ ; do samlocal --version ; done

Running make test with samlocal in the for-loop yields:

C:\My\Path\To\python.exe: can't open file 'C:\\c\\_git\\localstack-poc\\.venv\\Scripts\\samlocal': [Errno 2] No such file or directory
make: *** [Makefile:43: test] Error 2

Running make test with sam in the for-loop yields:

SAM CLI, version 1.61.0

NOTE:

I do NOT have issues running samlocal outside the context of loops (i.e. stand-alone lines). Those commands run successfully.

bamajap avatar Nov 07 '22 19:11 bamajap

Thanks for reporting @bamajap . We have just released a new version to pypi - can you please verify if the problem still persists with the latest version of samlocal? Thanks!

whummer avatar Jan 04 '23 01:01 whummer

(Apologies for the (very) delayed response, but I had to wait until I could get a new license.)

This is still happening as of version SAM CLI 1.98.0. The C: at the beginning of the path to samlocal should be removed, but it appears that it is still prepended to the path.

bamajap avatar Oct 16 '23 20:10 bamajap

Hi @bamajap, Just reaching out to check if you were able to resolve this issue or do you need our assistance?

lakkeger avatar Jun 26 '24 12:06 lakkeger

Closing issue due to inactivity.

lakkeger avatar Aug 26 '24 10:08 lakkeger