Open gorets opened 1 year ago
Hi, thanks for opening this issue. Just to confirm, the directory looks something like this:
├── layer
│ └── Makefile
├── package.json
├── src
│ └── lambda.js
└── template.yaml
Where there is a package.json
at the root level, and you are executing sam build --manifest package.json
?
If that is the case, would it be possible to move the package.json
into the src
and/or the layer
folder, that way --manifest
does not have to be provided? The issue appears to be coming from using --manifest
for the Layer.
Since --manifest
replaces the default file for the build method/runtime, it'll search for that file instead to use. When it builds the function, it expects a package.json
so this is fine. However, --manifest
will replace the file location for the layer's Makefile too.
Hi. I have a very complex project structure and the package.json file is located in a different directory, not near template.yaml.
Therefore, when starting the build, I need to specify the custom path to the file package.json with --manifest
parameter, but this breaks the layer build.
Due to this error, I can't use a custom folder structure in my project.
Would it be possible to adjust the folder structure to support using the package.json
file without having to specify it? Is the package.json
currently being reused for multiple resources? It might be possible to work around this if you are able to share the folder structure.
Hi. You can see my folder structure in example https://github.com/gorets/sam-bug
Thanks for taking the time to create a repository to show the file structure. Is there any particular reason sam build
is being invoked as a script through npm
? If the template was moved to the root, and the package.json
is moved to src
, then the template could be written in a way such that the package file is picked up by the Lambda functions and there wouldn't be a need to use the manifest option, if the package.json
file is meant to be shared.
Yes, I can change the project structure and not use the --manifest
option to define the path for package.json
, but this does not solve the problem with the aws-cli library and others may have problems in the future.
I have also encountered this issue, and not specifying --manifest
is not really an option. This is obviously a bug or incompatibility issue that should be resolved
Description:
There are LambdaFunction & LambdaLayer in the my SAM template. LambdaLayer has BuildMethod: makefile
command
sam build with parameter --manifest (-m)
leads to error**Build Failed Error: CustomMakeBuilder:MakeBuild - Make Failed: ~/sam-bug/package.json:1: * missing separator. Stop.
I think MakeBuild also has parameter -m and it use my value from input parameter --manifest
runs without
--manifest
is successSteps to reproduce:
/template.yaml
/package.json
/layer/Makefile
Observed result:
Expected result:
Build success
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)