-
Notifications
You must be signed in to change notification settings - Fork 89
Fix: Use function architecture for layer artifact path #401
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
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| { | ||
| "Projects": [ | ||
| { | ||
| "Name": "Amazon.Lambda.Tools", | ||
| "Type": "Patch", | ||
| "ChangelogMessages": [ | ||
| "Fix: Use function architecture to determine artifact path instead of hardcoded \u0027x64\u0027." | ||
| ] | ||
| } | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -246,9 +246,9 @@ private async Task<CreateLayerZipFileResult> CreateRuntimePackageStoreLayerZipFi | |
| } | ||
| var architecture = this.GetStringValueOrDefault(this.Architecture, LambdaDefinedCommandOptions.ARGUMENT_FUNCTION_ARCHITECTURE, false); | ||
| var cliWrapper = new LambdaDotNetCLIWrapper(this.Logger, this.WorkingDirectory); | ||
| if(cliWrapper.Store(defaults: this.DefaultConfig, | ||
| if (cliWrapper.Store(defaults: this.DefaultConfig, | ||
| projectLocation: projectLocation, | ||
| outputLocation: storeOutputDirectory, | ||
| outputLocation: storeOutputDirectory, | ||
| targetFramework: targetFramework, | ||
| packageManifest: convertResult.PackageManifest, | ||
| architecture: architecture, | ||
|
|
@@ -265,7 +265,8 @@ private async Task<CreateLayerZipFileResult> CreateRuntimePackageStoreLayerZipFi | |
|
|
||
| // The artifact.xml file is generated by the "dotnet store" command that lists the packages that were added to the store. | ||
| // It is required during a "dotnet publish" so the NuGet packages in the store will be filtered out. | ||
| var artifactXmlPath = Path.Combine(storeOutputDirectory, "x64", targetFramework, "artifact.xml"); | ||
| var architectureDirectory = this.GetStringValueOrDefault(this.Architecture, LambdaDefinedCommandOptions.ARGUMENT_FUNCTION_ARCHITECTURE, false) ?? "x64"; | ||
|
||
| var artifactXmlPath = Path.Combine(storeOutputDirectory, architectureDirectory, targetFramework, "artifact.xml"); | ||
| if(!File.Exists(artifactXmlPath)) | ||
| { | ||
| throw new LambdaToolsException($"Failed to find artifact.xml file in created local store.", LambdaToolsException.LambdaErrorCode.FailedToFindArtifactZip); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The architecture value retrieved at line 247 should be reused at line 268 instead of calling
GetStringValueOrDefaultagain. This eliminates redundant method calls and ensures consistency. Consider storing the result in a variable with broader scope or moving the variable declaration outside the scope block.