-
Notifications
You must be signed in to change notification settings - Fork 442
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
Added methods to skip cleaning of output assemblies to ExtensionsMetadataGenerator. #6849
Conversation
Adding Fabio as well to take a look. To answer some questions:
|
@@ -21,8 +21,17 @@ public class RemoveRuntimeDependencies : Task | |||
[Required] | |||
public string OutputPath { get; set; } | |||
|
|||
[Required] | |||
public ITaskItem[] FilesToSkip { get; set; } |
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.
How about IgnoreFiles
?
@@ -21,11 +22,11 @@ | |||
AssemblyFile="$(_FunctionsExtensionsTaskAssemblyFullPath)"/> | |||
|
|||
<Target Name="_FunctionsBuildCleanOutput" AfterTargets="_GenerateFunctionsExtensionsMetadataPostBuild" Condition="$(_FunctionsSkipCleanOutput) != 'true'" > | |||
<RemoveRuntimeDependencies OutputPath="$(TargetDir)bin"/> | |||
<RemoveRuntimeDependencies OutputPath="$(TargetDir)bin" FilesToSkip="@(FunctionsSkipCleanOutputAssembly)"/> |
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.
FunctionsSkipCleanOutputAssembly
-> FunctionsPreservedDependencies
@@ -9,6 +9,7 @@ | |||
<_FunctionsExtensionsDir Condition="$(_IsFunctionsSdkBuild) == 'true'">$(_FunctionsExtensionsDir)bin</_FunctionsExtensionsDir> | |||
<_ExtensionsMetadataGeneratorTargetsImported>true</_ExtensionsMetadataGeneratorTargetsImported> | |||
<IsPackable>false</IsPackable> | |||
<_FunctionsSkipCleanOutput Condition="$(FunctionsSkipCleanOutput) == 'true' Or $(_FunctionsSkipCleanOutput) == 'true'">true</_FunctionsSkipCleanOutput> |
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.
After chatting with @gzuber , let's not expose this as a public property/option right now.
a91c1e5
to
8471a52
Compare
@gzuber let's coordinate a NuGet release for this. We should be able to do that at any point |
did this get released? |
@sonic1981 -- yes, see details here: https://github.com/Azure/azure-functions-host/releases/tag/emg-v1.2.1. At the moment, you'll need to explicitly add a package reference to this version of the package (it's usually brought in as a dependency). |
Great thanks. Is there a list of what the "assemblies that are shared with the functions runtime" are anywhere? |
I still don't really understand how I'm supposed to use this functionality. I'd argue the docs are not really very clear. Given the web of dependencies that get installed by Nuget and the lack of visibility in Azure of what dll's are available by default and what version they are,, etc it seems a big ask to somehow figure out which ones I want to clean and which I don't. I'm continuing to use the blunt hammer of |
Hi @sonic1981 sorry for the delayed response. That's a good point, the documentation isn't specific about the dlls functions is bringing in which can be frustrating. If it helps, we keep a list here that might help you (or at least give you a starting point to) determine which dlls you need to preserve for your project. I believe that in general, when a customer needs to use this feature it's because they have a very specific requirement e.g. needing to lock themselves to a specific version of a dll. Or they've ran into an exception because the version of a dll they need can't be found, so they're aware of the specific dll that's causing the issue and this feature allows them to fix it without losing much efficiency. |
Issue describing the changes in this PR
Resolves #5894
Pull request checklist
release_notes.md
Additional information
This adds a new property that users can specify in their csproj to define how ExtensionsMetadataGenerator handles output clean up.
They can add the following:
For every assembly/file in the build output they don't want deleted during the cleaning step.
Notes about the PR:
FunctionsPreserveOutputAssembly
might be better, but went with what I did to matchFunctionsSkipCleanOutput
. I keptFunctionsSkipCleanOutput
because I know some customers use and are familiar with_FunctionsSkipCleanOutput
but that might not be a strong enough reason to keep it if we could come up with a better one.Microsoft.NET.Sdk.Functions
. I could use some help with this.