-
Notifications
You must be signed in to change notification settings - Fork 485
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
Add Amazon.Lambda.RuntimeSupport dll to the output nuget package #1897
Conversation
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Include="$(OutputPath)Amazon.Lambda.RuntimeSupport.dll" Pack="true" PackagePath="content" Visible="false" /> |
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.
wasnt sure if this needed to be content
or lib
folder. was seeing this warning when doing pack command
The assembly 'content\Amazon.Lambda.RuntimeSupport.dll' is not inside the 'lib' folder and hence it won't be added as a reference when the package is installed into a project. Move it into the 'lib' folder if it needs to be referenced.
but in our case in we are referencing the dll as part of a command line argument in the aspire proof of concept , so not sure if it really matters
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.
I'm assuming this is only adding the current target framework (net8.0) version of RuntimeSupport. I believe we need to add all targets of Runtimesupport. @normj is my assumption correct?
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.
i remember he mentioned when he updated the test tool v2 something about to not worry about the other versions. but ill let him confirm
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.
We will need to distribute each target framework for Lambda RuntimeSupport. That is how things work in Lambda. I think what you are thinking about is I meant with test tool v2 we only need to ship one version of the test tool NuGet package unlike the current v1 version were we ship separate versions of the package for each target framework. In the end we will have a single V2 test tool NuGet package with one .NET tool which is the Lambda emulator and then separate content folders for each version of RuntimeSupport with RuntimeSupport's dependencies.
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.
Ahh ok let me make that change. thanks for the detailed explanation
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.
ive updated it now, where each runtime support target version has its own folder with a dll in the content folder of the test tool
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.
ive also updated the screenshot in the description
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.
I've updated the latest logic to now use dotnet publish and copy everything in the publish folder to the content folder. and i have updated the screenshot in the description
Tools/LambdaTestTool-v2/tests/Amazon.Lambda.TestTool.UnitTests/PackagingTests.cs
Show resolved
Hide resolved
Tools/LambdaTestTool-v2/src/Amazon.Lambda.TestTool/Amazon.Lambda.TestTool.csproj
Outdated
Show resolved
Hide resolved
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.
I'm assuming this is only adding the current target framework (net8.0) version of RuntimeSupport. I believe we need to add all targets of Runtimesupport. @normj is my assumption correct?
f8aafa1
to
13a74ae
Compare
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<RuntimeSupportFramework Include="net5.0;net6.0;net8.0;netstandard2.0" /> |
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.
we havent updated runtime support in this branch to add .net9.0 which is why i havent added it here
Tools/LambdaTestTool-v2/src/Amazon.Lambda.TestTool/Amazon.Lambda.TestTool.csproj
Outdated
Show resolved
Hide resolved
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.
Instead of adding the project reference and manually copying the dll I wonder if we should have a customer target that runs before the Pack
target and run some script that does a dotnet publish
for each supported target. And then copy the output publish folder to a content folder in the test package for each target framework. That would cover all of the dependencies and would be the same as who the Runtime assembly and its dependencies are copied into the image.
Plus having the project dependency even though we don't use it is annoying because it means we have to keep building RuntimeSupport and its dependencies as part of our dev loop.
i have updated the latest logic to do this |
16f879a
to
22180b8
Compare
<Message Importance="high" Text="Publishing Amazon.Lambda.RuntimeSupport project..." /> | ||
|
||
<ItemGroup> | ||
<TargetFrameworks Include="netstandard2.0;net5.0;net6.0;net8.0" /> |
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.
You should drop net5 and add net9
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 reason i didnt add net9 in this PR was that i saw in the main branch, adding net9 required a bunch of changes. so i was going to do those separately
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.
ive updated this in my local branch but waiting on https://github.com/aws/aws-lambda-dotnet/pull/1937/files to be merged first
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.
fixed
@@ -23,9 +22,25 @@ | |||
<PackageReference Include="BlazorMonaco" Version="3.2.0" /> | |||
</ItemGroup> | |||
|
|||
<Target Name="CopyRuntimeSupportFiles" BeforeTargets="_GetPackageFiles"> | |||
<Message Importance="high" Text="Publishing Amazon.Lambda.RuntimeSupport project..." /> |
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.
nit: message is a bit misleading or non descriptive
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.
yea i iwll remove the message
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.
fixed
{ | ||
private readonly ITestOutputHelper _output; | ||
private static readonly string[] ExpectedFrameworks = new[] | ||
{ |
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.
update frameworks here too
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.
done
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.
Would be great if instead of having this hardcoded list if you read the TargetFrameworks
from the Amazon.Lambda.RuntimeSupport project file. That way we don't have to update this every time we add a new supported version.
You can skip .NET Standard 2.0.
22180b8
to
616d6b2
Compare
@@ -1,14 +1,13 @@ | |||
<Project Sdk="Microsoft.NET.Sdk.Web"> | |||
|
|||
<Project Sdk="Microsoft.NET.Sdk.Web"> |
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.
Because of our unorthodox packaging of the assemblies I'm getting a lot of NU5100
warnings. Can you add <NoWarn>NU5100</NoWarn>
to the PropertyGroup
.
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.
done
<ItemGroup> | ||
<None Include="$(MSBuildThisFileDirectory)..\..\..\..\Libraries\src\Amazon.Lambda.RuntimeSupport\bin\$(Configuration)\%(TargetFrameworks.Identity)\publish\**\*.*"> | ||
<Pack>true</Pack> | ||
<PackagePath>content\%(TargetFrameworks.Identity)</PackagePath> |
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.
Can you change content\%(TargetFrameworks.Identity)
to content\Amazon.Lambda.RuntimeSupport\%(TargetFrameworks.Identity)
to give some name spacing to the content here.
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.
done
{ | ||
private readonly ITestOutputHelper _output; | ||
private static readonly string[] ExpectedFrameworks = new[] | ||
{ |
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.
Would be great if instead of having this hardcoded list if you read the TargetFrameworks
from the Amazon.Lambda.RuntimeSupport project file. That way we don't have to update this every time we add a new supported version.
You can skip .NET Standard 2.0.
<Exec Command="dotnet publish "$(MSBuildThisFileDirectory)..\..\..\..\Libraries\src\Amazon.Lambda.RuntimeSupport\Amazon.Lambda.RuntimeSupport.csproj" -c $(Configuration) -f %(TargetFrameworks.Identity) /p:ExecutableOutputType=true -v n" /> | ||
|
||
<ItemGroup> | ||
<None Include="$(MSBuildThisFileDirectory)..\..\..\..\Libraries\src\Amazon.Lambda.RuntimeSupport\bin\$(Configuration)\%(TargetFrameworks.Identity)\publish\**\*.*"> |
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.
It would be great if we could skip netstandard2.0
because it doesn't make any sense in this context. The netstandard2.0
target is for class libraries not executables.
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.
ive updated the logic in the csproj and the unit test to dynamically get the targetframeworks and also skip netstandard2.0
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.
Nice job. Some impressive MSBuild work here.
3187134
to
1366b57
Compare
Issue #, if available:
Description of changes:
Testing
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.