New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: sam build is warning about missing BuildArchitecture in a layer when I don't have one. #6444
Comments
Hi @mew1033, thanks for reporting the issue, marking this as a UX bug. |
Also getting this warning when using LambdaAdapterLayer |
Also note that the warning text is misleading. It refers to |
I am observing this same problem with sam versions 1.104 and 1.105. Version 1.103 works just fine |
The BuildArchitecture needs to be specified in the |
The confusion for myself and others is likely that the main documentation for LayerVersion does not explicitly show Metadata as a field for the AWS::Serverless::LayerVersion type. In addition this didn't used to be necessary. For sam 1.103 and earlier no errors were indicated. Everything worked previously by just specifying CompatibleArchitectures. The new requirements are confusing since I'm just using python anyway. Seems like I have to specify the platform twice because of the new rules. |
I need to follow up on my comment. In my layer I am using pure python code so it seems kind of ridiculous to specify a BuildArchitecture. I specify that my layer is compatible with x86_64 and arm64 since I don't want to have separate layers for each architecture. I try to use arm64 where possible but occasionally there are modules that don't seem to be compatible so I need to run my Lambda on x86_64. What am I supposed to specify for BuildArchitecture? Unlike CompatibleArchitectures there is no way to specify more than one architecture. I don't bundle the modules in the layer in order to maintain an architecture neutral layer (my requirements.txt file is empty). This seems poorly thought out to me. It also breaks a lot of code that had been working perfectly up to sam 1.103. For code that doesn't actually have an architecture this is a big problem. Is there someone to contact at AWS to make these points? |
Trying to work through this but now getting
which makes no damn sense. There are no unnamed layers in my code. I thought it might be that I need to specify BuildArchitecture for the Lambdas in my application but I'm getting this warning 6 times when I only have 4 Lambas in that application. I have no clue what this is complaining about. Sorry if it offends anyone but this is a disaster. Much pain for zero gain. It is truly worrisome. |
This also affects |
Patch is released in v1.107.0. Closing |
Description:
I have a template that defines a
AWS::Serverless::Function
resource. It has aLayers
section:When I
sam build
the template, it gives me the following warning 3 times:WARNING: No BuildArchitecture specifed in Layer
NoneMetadata. Defaulting to x86_64.
Removing the layers section makes the warning go away.
I don't think the warning causes any issues, but it doesn't seem like it should be there.
Steps to reproduce:
Observed result:
2023-12-13 15:26:27,691 | WARNING: No BuildArchitecture specifed in Layer
None
Metadata. Defaulting to x86_64.Expected result:
No warning
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
sam --version
: 1.105.0The text was updated successfully, but these errors were encountered: