-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Enable generate runtime config and deps.files #4063
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
Enable generate runtime config and deps.files #4063
Conversation
| <NETSdkError Condition="'$(Language)' == 'C++' and $(EnableComHosting) == 'true'" | ||
| ResourceName="NoSupportCppEnableComHosting" /> | ||
|
|
||
| <NETSdkError Condition="'$(Language)' == 'C++' and $(SelfContained) == 'true'" |
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.
Need discussion. Although Rainier suggested we could add a target in C++ or SDK to override SelfContained to false. So we can keep the existing behavior
| } | ||
| } | ||
| }"); | ||
| File.Exists(_runtimeConfigDevPath).Should().BeFalse("No nuget involved, so no extra probing path"); |
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.
need discussion, double check, No nuget involved, so no extra probing path, no runtimeConfigDev needed
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.
Sounds fine to me.
|
|
||
| <!-- To achieve incremental build with property change. When any property changes, WriteOnlyWhenDifferent will be triggered to write cache file. | ||
| And the cache file's timestamp will be later, and it then triggers the incremental build.--> | ||
| <Target Name="_GenerateRuntimeConfigurationFilesInputCache" DependsOnTargets="ResolveAssemblyReferences"> |
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.
need discussion. maybe over kill, but that should be the "right thing"
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.
Seems OK.
But why does this depend on ResolveAssemblyReferences? I don't see anything from what it does being used here.
runtimeconfig is so small, that I sort of wonder if it wound't be simpler, easier to maintain, or more efficient to just generate it and write the whole file only if different rather than any hashing that might need to be kept up to date with new properties.
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.
Good idea. The hash is probably bigger than the file. I reverted that commit and added 31cec9d instead.
a3340fe to
1068a06
Compare
src/Tasks/Microsoft.NET.Build.Tasks.UnitTests/GivenADependencyContextBuilder.cs
Outdated
Show resolved
Hide resolved
| } | ||
| } | ||
| }"); | ||
| File.Exists(_runtimeConfigDevPath).Should().BeFalse("No nuget involved, so no extra probing path"); |
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.
Sounds fine to me.
src/Tasks/Microsoft.NET.Build.Tasks.UnitTests/GivenAGenerateRuntimeConfigurationFiles.cs
Show resolved
Hide resolved
|
|
||
| <!-- To achieve incremental build with property change. When any property changes, WriteOnlyWhenDifferent will be triggered to write cache file. | ||
| And the cache file's timestamp will be later, and it then triggers the incremental build.--> | ||
| <Target Name="_GenerateRuntimeConfigurationFilesInputCache" DependsOnTargets="ResolveAssemblyReferences"> |
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.
Seems OK.
But why does this depend on ResolveAssemblyReferences? I don't see anything from what it does being used here.
runtimeconfig is so small, that I sort of wonder if it wound't be simpler, easier to maintain, or more efficient to just generate it and write the whole file only if different rather than any hashing that might need to be kept up to date with new properties.
b49bd9e to
75f522d
Compare
|
@nguerrera 31cec9d is the new commit for fix missing runtimeconfig. I resolved your comments so far. |
|
I decided to check on the perf here. It seems GenerateRuntimeConfigurationFiles is a noticeable part of incremental build when assets file has changed. You can compare I'm doing this on a vanilla I am surprised by this result, but it might invalidate my idea of doing it this way. |
|
What do you think about treating the perfect up-to-date-ness of runtime config as a separate change from this one? |
When asset file is missing. By adding correct incremental build with property hased
75f522d to
902463d
Compare
|
Use back incremental build fix instead. Log this for 5.0 #4136 |
- Rename to projectContextHasProjectReferences - Move DependsOnTargets=_DefaultMicrosoftNETPlatformLibrary - Revert unnecessary dependency
902463d to
f8b2c41
Compare
| ============================================================ | ||
| --> | ||
| <Target Name="_ComputeNETCoreBuildOutputFiles" | ||
| DependsOnTargets="_GetAppHostPaths;_GetComHostPaths;_GetIjwHostPaths;GenerateBuildRuntimeConfigurationFiles" |
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.
Reverted this
| --> | ||
|
|
||
| <Target Name="GenerateBuildRuntimeConfigurationFiles" | ||
| DependsOnTargets="_DefaultMicrosoftNETPlatformLibrary;_GenerateRuntimeConfigurationFilesInputCache" |
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.
Move dependency on _DefaultMicrosoftNETPlatformLibrary to _GenerateRuntimeConfigurationFilesInputCache. So _GenerateRuntimeConfigurationFilesInputCache can get the same property as before. Some property need to be set by a target before _GenerateRuntimeConfigurationFilesInputCache runs
Please review it commit by commit.
Fix #3889