Skip to content

Conversation

@wli3
Copy link

@wli3 wli3 commented Dec 16, 2019

Please review it commit by commit.

Fix #3889

@wli3 wli3 requested a review from nguerrera December 16, 2019 18:25
@wli3 wli3 marked this pull request as ready for review December 16, 2019 18:25
<NETSdkError Condition="'$(Language)' == 'C++' and $(EnableComHosting) == 'true'"
ResourceName="NoSupportCppEnableComHosting" />

<NETSdkError Condition="'$(Language)' == 'C++' and $(SelfContained) == 'true'"
Copy link
Author

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");
Copy link
Author

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

Copy link
Contributor

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">
Copy link
Author

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"

Copy link
Contributor

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.

Copy link
Author

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.

@wli3 wli3 force-pushed the enable-runtimeconfig-cpp-use-related-files branch from a3340fe to 1068a06 Compare December 17, 2019 00:26
@livarcocc livarcocc added this to the 3.1.2xx milestone Jan 2, 2020
}
}
}");
File.Exists(_runtimeConfigDevPath).Should().BeFalse("No nuget involved, so no extra probing path");
Copy link
Contributor

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">
Copy link
Contributor

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.

@wli3 wli3 force-pushed the enable-runtimeconfig-cpp-use-related-files branch 2 times, most recently from b49bd9e to 75f522d Compare January 3, 2020 17:30
@wli3
Copy link
Author

wli3 commented Jan 6, 2020

@nguerrera 31cec9d is the new commit for fix missing runtimeconfig. I resolved your comments so far.

@nguerrera
Copy link
Contributor

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 dotnet build /clp:PerformanceSummary vs. touch obj\projects.assets.json && donet build /clp:PerformanceSummary

I'm doing this on a vanilla dotnet new console and seeing GenerateRutnimeConfigurationFiles move to near the most expensive.

      38 ms  GenerateDepsFile                           1 calls
       74 ms  GenerateRuntimeConfigurationFiles          1 calls
      100 ms  MsBuild                                    7 calls
      102 ms  RestoreTask                                1 calls

I am surprised by this result, but it might invalidate my idea of doing it this way.

@nguerrera
Copy link
Contributor

What do you think about treating the perfect up-to-date-ness of runtime config as a separate change from this one?

@wli3 wli3 force-pushed the enable-runtimeconfig-cpp-use-related-files branch from 75f522d to 902463d Compare January 7, 2020 01:38
@wli3
Copy link
Author

wli3 commented Jan 7, 2020

Use back incremental build fix instead. Log this for 5.0 #4136

- Rename to projectContextHasProjectReferences

- Move DependsOnTargets=_DefaultMicrosoftNETPlatformLibrary

- Revert unnecessary dependency
@wli3 wli3 force-pushed the enable-runtimeconfig-cpp-use-related-files branch from 902463d to f8b2c41 Compare January 7, 2020 02:13
============================================================
-->
<Target Name="_ComputeNETCoreBuildOutputFiles"
DependsOnTargets="_GetAppHostPaths;_GetComHostPaths;_GetIjwHostPaths;GenerateBuildRuntimeConfigurationFiles"
Copy link
Author

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"
Copy link
Author

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

@wli3 wli3 merged commit 831a360 into dotnet:release/3.1.2xx Jan 7, 2020
@wli3 wli3 deleted the enable-runtimeconfig-cpp-use-related-files branch January 7, 2020 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants