From d5a183de3ba20d7baddf5e57e3c9605658524e32 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Wed, 19 May 2021 10:21:50 -0500 Subject: Try to make building Bal.wixext and IntegrationBurn faster. --- src/ext/Bal/test/examples/Wix.Build.props | 1 + src/test/burn/README.md | 31 ++++--------------- .../Bundles/CreateBurnManifestCommand.cs | 4 --- .../Bundles/ProcessMsiPackageCommand.cs | 2 -- .../Bundles/ProcessPayloadsCommand.cs | 36 +++++++++++++++------- .../BundleManifestFixture.cs | 2 +- 6 files changed, 33 insertions(+), 43 deletions(-) (limited to 'src') diff --git a/src/ext/Bal/test/examples/Wix.Build.props b/src/ext/Bal/test/examples/Wix.Build.props index aad94bb6..78ad462f 100644 --- a/src/ext/Bal/test/examples/Wix.Build.props +++ b/src/ext/Bal/test/examples/Wix.Build.props @@ -6,5 +6,6 @@ .exe -generate payloadgroup $(OutputPath)examples\ + None diff --git a/src/test/burn/README.md b/src/test/burn/README.md index 6c6e0dd9..1f2168cf 100644 --- a/src/test/burn/README.md +++ b/src/test/burn/README.md @@ -1,6 +1,6 @@ # integration -This repo is for building installers, and then executing xunit tests that run them and verify that they worked. +This layer is for building installers, and then executing xunit tests that run them and verify that they worked. ## Running tests @@ -9,42 +9,23 @@ Depending on who you talk to, these are integration or system-level or end-to-en They modify machine state so it's strongly recommended *not* to run these tests on your dev box. They should be run on a VM instead, where you can easily roll back. -1. Run appveyor.cmd to build everything (the tests will refuse to run). -1. Copy the build\Release\netcoreapp3.1 folder to your VM. -1. Open a command prompt and navigate to the netcoreapp3.1 folder. +1. Run build.cmd to build everything (the tests will not automatically run). +1. Copy the build\IntegrationBurn\Debug\netcoreapp3.1 folder to your VM. +1. Open an elevated command prompt and navigate to the netcoreapp3.1 folder. 1. Run the runtests.cmd file to run the tests. You can modify the runtests.cmd to run specific tests. For example, the following line runs only the specified test: -> dotnet test --filter WixToolsetTest.BurnE2E.BasicFunctionalityTests.CanInstallAndUninstallSimpleBundle WixToolsetTest.BurnE2E.dll +> dotnet test --filter WixToolsetTest.BurnE2E.BasicFunctionalityTests.CanInstallAndUninstallSimpleBundle_x86_wixstdba WixToolsetTest.BurnE2E.dll The VM must have: 1. x64 .NET Core SDK of 5.0 or later (for the test runner) 1. Any version of .NET Framework (for the .NET Framework TestBA) 1. x86 .NET Core Desktop Runtime of 5.0 or later (for the .NET Core TestBA) -## Updating dependencies - -Use the `updatepackage.ps1` script from https://github.com/wixtoolset/Home. -For example: - -* updatepackage.ps1 -TargetFolder path\to\repo -PackageName WixToolset.Bal.wixext -NewVersion 4.0.91 -* updatepackage.ps1 -TargetFolder path\to\repo -PackageName WixToolset.Data -NewVersion 4.0.199 -* updatepackage.ps1 -TargetFolder path\to\repo -PackageName WixToolset.Dependency.wixext -NewVersion 4.0.25 -* updatepackage.ps1 -TargetFolder path\to\repo -PackageName WixToolset.Mba.Core -NewVersion 4.0.52 -* updatepackage.ps1 -TargetFolder path\to\repo -PackageName WixToolset.NetFx.wixext -NewVersion 4.0.67 -* updatepackage.ps1 -TargetFolder path\to\repo -PackageName WixToolset.Util.wixext -NewVersion 4.0.82 -* updatepackage.ps1 -TargetFolder path\to\repo -PackageName WixToolset.Sdk -NewVersion 4.0.0-build-0204 - ## Building with local changes -The micro repo model makes this very difficult and painful. -The basic idea is to make your changes in each individual repo on the master branch (to get a stable version), commit, and then use appveyor.cmd to build the nuget package. -Put your custom nuget packages into a folder, and modify each repo's nuget.config with an entry to that folder. - -Alternatively, go into the NuGet package cache (%USERPROFILE%\.nuget\packages) and replace the official binaries with your locally built binaries. - -Both of those approaches will poison your NuGet package cache, so you probably will want to run the following command to clear it when you're done: +The current build process will poison your NuGet package cache, so you may have to run the following command to clear it: > nuget locals all -clear \ No newline at end of file diff --git a/src/wix/WixToolset.Core.Burn/Bundles/CreateBurnManifestCommand.cs b/src/wix/WixToolset.Core.Burn/Bundles/CreateBurnManifestCommand.cs index 77f20e5c..2e53a948 100644 --- a/src/wix/WixToolset.Core.Burn/Bundles/CreateBurnManifestCommand.cs +++ b/src/wix/WixToolset.Core.Burn/Bundles/CreateBurnManifestCommand.cs @@ -691,12 +691,8 @@ namespace WixToolset.Core.Burn.Bundles writer.WriteStartElement("Payload"); - // TODO: The engine should be updated to not require FileSize, Hash, or Packaging for UX payloads since the values are never used. writer.WriteAttributeString("Id", payload.Id.Id); writer.WriteAttributeString("FilePath", payload.Name); - writer.WriteAttributeString("FileSize", payload.FileSize.Value.ToString(CultureInfo.InvariantCulture)); - writer.WriteAttributeString("Hash", payload.Hash); - writer.WriteAttributeString("Packaging", "embedded"); writer.WriteAttributeString("SourcePath", payload.EmbeddedId); writer.WriteEndElement(); diff --git a/src/wix/WixToolset.Core.Burn/Bundles/ProcessMsiPackageCommand.cs b/src/wix/WixToolset.Core.Burn/Bundles/ProcessMsiPackageCommand.cs index 18c1ddf8..d42a591a 100644 --- a/src/wix/WixToolset.Core.Burn/Bundles/ProcessMsiPackageCommand.cs +++ b/src/wix/WixToolset.Core.Burn/Bundles/ProcessMsiPackageCommand.cs @@ -393,7 +393,6 @@ namespace WixToolset.Core.Burn.Bundles Compressed = packagePayload.Compressed, UnresolvedSourceFile = cabinetName, ContainerRef = packagePayload.ContainerRef, - ContentFile = true, DownloadUrl = packagePayload.DownloadUrl, Packaging = packagePayload.Packaging, ParentPackagePayloadRef = packagePayload.Id.Id, @@ -462,7 +461,6 @@ namespace WixToolset.Core.Burn.Bundles Compressed = packagePayload.Compressed, UnresolvedSourceFile = name, ContainerRef = packagePayload.ContainerRef, - ContentFile = true, DownloadUrl = packagePayload.DownloadUrl, Packaging = packagePayload.Packaging, ParentPackagePayloadRef = packagePayload.Id.Id, diff --git a/src/wix/WixToolset.Core.Burn/Bundles/ProcessPayloadsCommand.cs b/src/wix/WixToolset.Core.Burn/Bundles/ProcessPayloadsCommand.cs index fa70251a..92fe86f2 100644 --- a/src/wix/WixToolset.Core.Burn/Bundles/ProcessPayloadsCommand.cs +++ b/src/wix/WixToolset.Core.Burn/Bundles/ProcessPayloadsCommand.cs @@ -54,23 +54,37 @@ namespace WixToolset.Core.Burn.Bundles this.UpdatePayloadPackagingType(payload); - if (!this.PayloadHarvester.HarvestStandardInformation(payload)) + if (payload.ContainerRef == BurnConstants.BurnUXContainerName) { - // Remote payloads obviously cannot be embedded. - Debug.Assert(PackagingType.Embedded != payload.Packaging); + Debug.Assert(PackagingType.Embedded == payload.Packaging); + + // Nothing needs to be harvested because the engine only uses Id, Name (FilePath), and EmbeddedId (SourcePath). + + if (payload.ContentFile) + { + trackedFiles.Add(this.BackendHelper.TrackFile(sourceFile.Path, TrackedFileType.Input, payload.SourceLineNumbers)); + } } - else // not a remote payload so we have a lot more to update. + else { - // External payloads need to be transfered. - if (PackagingType.External == payload.Packaging) + if (!this.PayloadHarvester.HarvestStandardInformation(payload)) { - var transfer = this.BackendHelper.CreateFileTransfer(sourceFile.Path, Path.Combine(this.LayoutDirectory, payload.Name), false, payload.SourceLineNumbers); - fileTransfers.Add(transfer); + // Remote payloads obviously cannot be embedded. + Debug.Assert(PackagingType.Embedded != payload.Packaging); } - - if (payload.ContentFile) + else // not a remote payload so we have a lot more to update. { - trackedFiles.Add(this.BackendHelper.TrackFile(sourceFile.Path, TrackedFileType.Input, payload.SourceLineNumbers)); + // External payloads need to be transfered. + if (PackagingType.External == payload.Packaging) + { + var transfer = this.BackendHelper.CreateFileTransfer(sourceFile.Path, Path.Combine(this.LayoutDirectory, payload.Name), false, payload.SourceLineNumbers); + fileTransfers.Add(transfer); + } + + if (payload.ContentFile) + { + trackedFiles.Add(this.BackendHelper.TrackFile(sourceFile.Path, TrackedFileType.Input, payload.SourceLineNumbers)); + } } } } diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/BundleManifestFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/BundleManifestFixture.cs index 6d769bd6..19d0a2fc 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/BundleManifestFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/BundleManifestFixture.cs @@ -219,7 +219,7 @@ namespace WixToolsetTest.CoreIntegration { { "Payload", new List { "FileSize", "Hash", "SourcePath" } }, }; - Assert.Equal("", bundleExtensionPayloads[0].GetTestXml(ignored)); + Assert.Equal("", bundleExtensionPayloads[0].GetTestXml(ignored)); } } -- cgit v1.2.3-55-g6feb