Skip to content

Bug: Using AWS::Serverless::LayerVersion with BuildMethod: makefile and python runtime fails to build #566

@ghost

Description

Description:

Using a template with AWS::Serverless::LayerVersion and BuildMethod: makefile fails building because tha makefile passed to make command seems wrong. The code aws_lambda_builders/workflows/custom_make/actions.py", line 99 is using variable manifest_path which is a dependency manifest not the makefile

Steps to reproduce:

template.yaml

AWSTemplateFormatVersion : '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: A sample SAM template for deploying Lambda functions.

Resources:

LibsLayer:
Type: AWS::Serverless::LayerVersion
Properties:
ContentUri: ../../layerlibs/
CompatibleRuntimes:
- python3.11
Metadata:
BuildMethod: makefile

/usr/local/bin/sam build --build-dir /tmp/aws-toolkit-vscode/vsctkChoBiG/output --template /home/user/github/LambdAtom/atom_vmaas/.vscode/template.yml --manifest /tmp/aws-toolkit-vscode/vsctkChoBiG/debug-requirements.txt --debug

Observed result:

2023-11-04 12:53:36,389 | CustomMakeBuilder:CopySource succeeded
2023-11-04 12:53:36,390 | LibsLayer: Running CustomMakeBuilder:MakeBuild
2023-11-04 12:53:36,391 | LibsLayer: Current Artifacts Directory : /tmp/aws-toolkit-vscode/vsctkChoBiG/output/LibsLayer
2023-11-04 12:53:36,392 | executing Make: ['make', '--makefile', '/tmp/aws-toolkit-vscode/vsctkChoBiG/debug-requirements.txt', 'build-LibsLayer']
2023-11-04 12:53:36,402 | CustomMakeBuilder:MakeBuild failed
Traceback (most recent call last):
File "aws_lambda_builders/workflows/custom_make/actions.py", line 99, in execute
File "aws_lambda_builders/workflows/custom_make/make.py", line 115, in run
aws_lambda_builders.workflows.custom_make.make.MakeExecutionError: Make Failed: make: *** No rule to make target 'build-LibsLayer'. Stop.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "aws_lambda_builders/workflow.py", line 371, in run
File "aws_lambda_builders/workflows/custom_make/actions.py", line 109, in execute
aws_lambda_builders.actions.ActionFailedError: Make Failed: make: *** No rule to make target 'build-LibsLayer'. Stop.

Build Failed

Expected result:

['make', '--makefile', '/home/user/github/LambdAtom/layerlibs/Makefile', 'build-LibsLayer']

Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

  1. OS: WSL2 Debian
  2. If using SAM CLI, sam --version: SAM CLI, version 1.100.0
  3. AWS region: Local environment and eu-west-3

Add --debug flag to any SAM CLI commands you are running

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/buildblocked/more-info-neededMore info is needed from the requester. If no response in 14 days, it will become stale.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions