-
Notifications
You must be signed in to change notification settings - Fork 441
Installer updates (Merge to SDK Changeset) #17959
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
Conversation
…ession bodied properties to solution.
…s. Set var suggestion to none.
…r the 4.7.2 build, so changed it to class.
…be necessary. Manual formatting cleanup for targets in the redist project.
…he target from LayoutTool.csproj directly into where it was used in BundledDotnetTools.targets. Added comments to DownloadPackage.csproj.
…der redist. Added more comments to DownloadPackage.csproj.
…an up formatting in SdkTests.csproj. Removed the empty <TargetPath></TargetPath> from SdkTests.csproj to allow loading in VS.
…teLocator.csproj projects. Added the projects back to the SLN so they build using the proper configuration (debug/release).
…jects only ever build with the default configuration (Debug) since it is irrelevant for packaging. Updated the paths used when creating the MSIs, which uses the output of these to create NuGet packages.
…ller-merge-update # Conflicts: # eng/Version.Details.xml # eng/Versions.props # global.json # src/redist/targets/Crossgen.targets # src/redist/targets/GenerateBundledVersions.targets # src/redist/targets/GenerateLayout.targets # src/redist/targets/GenerateMSIs.targets
…from SdkTests as it hasn't existed in years...?
…e item group properly).
<SdkStableFileIdForApphostTransform>$(MSBuildThisFileDirectory)packaging/windows/clisdk/stablefileidforapphosttransform.xslt</SdkStableFileIdForApphostTransform> | ||
<SdkGenerateBundlePowershellScript>$(MSBuildThisFileDirectory)packaging/windows/clisdk/generatebundle.ps1</SdkGenerateBundlePowershellScript> | ||
<GenerateNupkgPowershellScript>$(MSBuildThisFileDirectory)packaging/windows/clisdk/generatenupkg.ps1</GenerateNupkgPowershellScript> | ||
<SdkPkgSourcesRootDirectory>$(MSBuildThisFileDirectory)../packaging/windows</SdkPkgSourcesRootDirectory> |
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.
Added this to simply all of these path 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.
A few of the targets files had this problem where the content in the file was indented incorrectly. It makes it look like I changed a lot, but all I did was fix the tab alignment.
src/redist/targets/LayoutTool.csproj
Outdated
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.
Removed in favor of DownloadPackage.csproj instead.
string configuration = new DirectoryInfo(AppContext.BaseDirectory).Parent.Name; | ||
// https://stackoverflow.com/a/60545278/294804 | ||
var assemblyConfigurationAttribute = typeof(RepoDirectoriesProvider).Assembly.GetCustomAttribute<AssemblyConfigurationAttribute>(); | ||
string configuration = assemblyConfigurationAttribute?.Configuration; |
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.
Simplification as the parent directory's name is not the same between the Installer repo and SDK repo. The point of this is to simply get the build configuration. So, I directly get that information from the assembly information.
<Exec Command="$(ToolRunPrefix)$(InstallToolCommand)" | ||
WorkingDirectory="$(TestLocalToolFolder)" | ||
EnvironmentVariables="DOTNET_CLI_HOME=$(DOTNET_CLI_HOME)"/> | ||
|
||
<!--<Exec Command="$(ToolRunPrefix)dotnet tool restore" | ||
<Exec Command="$(ToolRunPrefix)$(InstallToolCommand)" | ||
WorkingDirectory="$(TestLocalToolFolder)" | ||
EnvironmentVariables="DOTNET_CLI_HOME=$(DOTNET_CLI_HOME)"/>--> | ||
EnvironmentVariables="DOTNET_CLI_HOME=$(DOTNET_CLI_HOME)" /> |
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 diffing here looks weird but all I did was remove commented code.
<PropertyGroup> | ||
<TargetPath></TargetPath> | ||
<!-- Prevent projects referencing this from trying to pass us to the compiler --> | ||
</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.
This makes the project inoperable in Visual Studio as the project system requires that TargetPath have a value.
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.
Should that be conditioned on the IsBuildingInVisualStudio
property or something?
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.
Should that be conditioned on the IsBuildingInVisualStudio property or something?
I'll respond to your question with a question, does <TargetPath></TargetPath>
have a purpose? The comment under it implies that SdkTests.csproj
is referenced by other projects, but it isn't. Nothing references this project.
@@ -267,12 +250,10 @@ | |||
<!-- Group always attempts resolve runtime, regardless of <CopyNuGetImplementations>--> | |||
<Target Name="GetReferenceAssemblyPaths" /> | |||
<!-- Don't go looking for framework reference assemblies--> | |||
<Target Name="GetFrameworkPaths" /> | |||
<!-- ^ --> |
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.
^^
@@ -37,7 +37,6 @@ | |||
<Method Name="Microsoft.NET.Publish.Tests.GivenThatWeWantToPublishASelfContainedApp.It_can_make_a_Windows_GUI_exe" /> | |||
<Class Name="Microsoft.NET.Publish.Tests.GivenThatWeWantToPublishASingleFileApp" /> | |||
<Class Name="Microsoft.NET.Publish.Tests.GivenThatWeWantToPublishAWebApp" /> | |||
<Class Name="Microsoft.NET.Publish.Tests.GivenThatWeWantToRunCrossgen" /> |
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.
This test doesn't exist anymore. I found it existing in 2019 but I didn't walk the entire file history to see when it was deleted.
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.
This sort of thing will hopefully become easier once everything is one repo
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.
Well, this file isn't being migrated since it was for running SDK tests in this repo. I went through and confirmed these tests being in the SDK repo already, so I don't need to do anything with the entire SdkTests project. This cleanup just came out of that review.
…ssary. Updated or removed TODO comments. Fixed some tabbing from merging. Fixed a compilation bug if this code is ever built against 4.5.1(????)
…et prior to calling the Arcade SDK, so the OutputPath properly includes the Architecture folder.
@@ -6,7 +6,6 @@ | |||
using Microsoft.Build.Utilities; | |||
using Microsoft.Build.Framework; | |||
using System.IO; |
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.
Since you're cleaning up some of the code, might as well sort the usings 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.
So, I didn't run the same formatters/analyzers like I did in the SDK repo on this code. Here, I likely just did "Remove unused usings". However, the point is kinda moot when you look at this file in the SDK PR:
https://github.com/dotnet/sdk/pull/38804/files#diff-ea4fa261d2db3cc7e1e241b5f6ac3a003ff19fdde37c09ddb089b7467277160dR4
There's only 1 using because all of these are in the global usings of that repo. So... 🙃
@@ -183,14 +179,11 @@ private string BuildCmdParameters(ConfigJson configJson, string package_version) | |||
|
|||
// Map all the payload directories as they need to install on the system | |||
if (configJson.Install_Root != null) |
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.
Time for me to rant. I think our general style guidelines have always been to have braces for if
statements, though if you really want to you may be able to use conditionals and discard statements. Not a big issue since this code has been around for a long time I think
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.
Oh definitely. But there's code in the SDK repo that doesn't follow ANY guidelines... that was written in 2006, originally from .NET Framework. I think there are more formatting guidelines I'd like to turn on in the SDK repo, but I don't have a complete list yet. I'll mention I didn't do "complete" cleanup to the code here. It was more like spot checks and some automatic tasks in VS. I did a lot of these in December when I was trying to understand the scope and projects in this repo for migration.
<CMakeDefines Include="Platform" Value="$(Platform)" /> | ||
<CMakeDefines Include="ArtifactsDir" Value="$(ArtifactsDirForCMake)" /> | ||
<!-- Include this item below to create a binlog for the native build. --> | ||
<!-- <CMakeNativeToolArguments Include="/bl:$(ArtifactsDirForCMake)native.binlog" /> --> |
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.
Any reason why this is commented out? Do we want it enabled by default or otherwise hide it behind a conditional property? Having binlogs for everything is useful when investigating build failures I think
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 was there in the file already (meaning, it was commented out in the file) and I figured that you put it there for yourself. Lol. I didn't look at the blame on it, though. I haven't actually tested with it being on, but I can do that and see if we just want to keep it on always.
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.
Whoops, this was supposed to be on the other PR, let me dismiss this... 😄
…Provider.dll again.
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.
Approving the src/SourceBuild change
…ller-merge-update # Conflicts: # .vsts-ci.yml # eng/Publishing.props # eng/Versions.props # eng/build.yml # global.json # src/redist/targets/BundledTemplates.targets # src/redist/targets/GenerateBundledVersions.targets # src/redist/targets/Versions.targets
# Conflicts: # eng/Version.Details.xml # eng/Versions.props # global.json
Sibling branch: https://github.com/dotnet/sdk/tree/feature/installer-merge
Summary
The work in this PR is in preparation for merging this repo into the SDK repo. The changes I've made here will be the general format that the files will be when moved to the SDK repo. You can take a look a the linked sibling branch to see these files and how they'll be in the SDK repo.
Because this endeavor is taking a phased approach, it will be easier to maintain updates to these files in the SDK repo if the files in the Installer repo match a similar format/form. Therefore, I believe it makes the most sense to merge this PR into the Installer repo, even though we plan on phasing out this repo (at a later date).
High-Level Changes
Microsoft.Build.NoTargets
for projects that don't require building assembliescore-sdk-tasks
code to use an explicit type instead of ValueTuplesfinalizer
build processsrc
(some projects/files combined into other project folders)LayoutTool.csproj
and usedDownloadPackage.csproj
with the added logic for tool acquisition inBundledDotnetTools.targets
Things of Note
Directory.Packages.props
, so versioning of packages is explicit within projectsglobal usings
, so there are many moreusing
statements in the source filesCurrently, there are manual dependency version changes. This is only done for the purposes of comparing the output between the repos. These changes will be reverted prior to merge.SomeTODO
s exist. These will be removed prior to merge.Finalizer Changes Details
The current process for building
finalizer
proceeds as such:eng/Build.props
buildseng/version.csproj
andeng/native.proj
eng/version.csproj
's only purpose is to call theGenerateSdkVersionFile
target. Additionally, this project is only used in thefinalizer
build process.eng/native.proj
's only purpose is to callNative.sln
and passPlatform
(set using the$(Architecture)
property) to the solution.Native.sln
only contains a single project,src/finalizer_shim/finalizer_shim.csproj
finalizer_shim.csproj
provides the data to the CMake SDK to build thesrc/finalizer/finalizer.proj
and runs the build of that project. Also, it copies WixSdk contents to use in the build.finalizer.proj
sets theCMakeLists.txt
file and defines thePlatform
variableCMakeLists.txt
contains the actual build logic for creatingfinalizer.exe
I've simplified the build process as such:
eng/Build.props
buildssrc\finalizer\finalizer-build.csproj
finalizer-build.csproj
contains theGenerateSdkVersionFile
target, provides the CMake SDK data, copies WixSdk contents, and buildsfinalizer.nativeproj
finalizer.nativeproj
usesTreatAsLocalProperty="Platform"
to set the property for its build, sets theCMakeLists.txt
file, and defines thePlatform
andArtifactsDir
variablesCMakeLists.txt
contains the actual build logic for creatingfinalizer.exe
Because of this, I was able to remove:
eng/version.csproj
eng/native.proj
Native.sln
Since the whole process only stems from one project,
finalizer-build.csproj
, this made it easier to work with in the SDK repo.Test Builds
https://dev.azure.com/dnceng-public/public/_build/results?buildId=561044https://dev.azure.com/dnceng-public/public/_build/results?buildId=566873https://dev.azure.com/dnceng-public/public/_build/results?buildId=583565https://dev.azure.com/dnceng-public/public/_build/results?buildId=586117https://dev.azure.com/dnceng-public/public/_build/results?buildId=588520https://dnceng.visualstudio.com/internal/_build/results?buildId=2374972https://dnceng.visualstudio.com/internal/_build/results?buildId=2379159https://dnceng.visualstudio.com/internal/_build/results?buildId=2379171https://dnceng.visualstudio.com/internal/_build/results?buildId=2390182https://dnceng.visualstudio.com/internal/_build/results?buildId=2391877https://dnceng.visualstudio.com/internal/_build/results?buildId=2393494https://dnceng.visualstudio.com/internal/_build/results?buildId=2420844