Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/installer/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,12 @@
The NuGet fallback folder can/will contain packages we are building in this repo, and we
want to ensure we use the correct packages. -->
<DisableImplicitNuGetFallbackFolder>true</DisableImplicitNuGetFallbackFolder>
<UseBootstrapLayout Condition="'$(UseBootstrap)' == 'true'">true</UseBootstrapLayout>
</PropertyGroup>

<!-- Bootstrap layout is used when we don't have an LKG apphost to rely on, like on freebsd. -->
<PropertyGroup Condition="'$(UseBootstrapLayout)' == 'true'">
<UseLocalAppHostPack Condition="'$(UseBootstrapLayout)' == 'true'">true</UseLocalAppHostPack>
<UseLocalTargetingRuntimePack Condition="'$(UseBootstrapLayout)' == 'true'">false</UseLocalTargetingRuntimePack>
</PropertyGroup>
</Project>
4 changes: 2 additions & 2 deletions src/installer/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<Project>

<Import Project="$(RepositoryEngineeringDir)targetingpacks.targets" Condition="'$(UseBootstrapLayout)' == 'true'" />

<PropertyGroup>
<InstallerName>$(InstallerName)</InstallerName>
</PropertyGroup>
Expand All @@ -23,8 +25,6 @@
-->
<Import Project="packaging.stubs.targets" Condition="'$(MSBuildProjectExtension)' != '.pkgproj'" />

<Import Project="..\..\Directory.Build.targets" />

<!-- Provide default targets which can be hooked onto or overridden as necessary -->
<Target Name="Pack" DependsOnTargets="Build" />
</Project>
1 change: 1 addition & 0 deletions src/installer/pkg/sfx/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project>
<PropertyGroup>
<EnsureRuntimeIdentifierSet>true</EnsureRuntimeIdentifierSet>
<UseLocalTargetingRuntimePack>true</UseLocalTargetingRuntimePack>
</PropertyGroup>

<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props, $(MSBuildThisFileDirectory)..))" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<_SymbolFilesToPackage Include="@(_HostSymbolFiles->Exists())" IsNative="true" />
</ItemGroup>

<Target Name="AddRuntimeFilesToPackage" DependsOnTargets="ResolveRuntimeFilesFromLocalBuild">

Check failure on line 37 in src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.props

View check run for this annotation

Azure Pipelines / runtime (Build wasi-wasm linux Release _BuildOnly)

src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.props#L37

src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.props(37,43): error MSB4057: (NETCORE_ENGINEERING_TELEMETRY=Build) The target "ResolveRuntimeFilesFromLocalBuild" does not exist in the project.
<ItemGroup>
<RuntimeFiles Condition="'%(RuntimeFiles.IsNative)' == 'true'">
<TargetPath>runtimes/$(RuntimeIdentifier)/native</TargetPath>
Expand Down Expand Up @@ -86,7 +86,6 @@
<Import Project="$(Crossgen2SdkOverridePropsPath)" Condition="'$(PublishReadyToRun)' == 'true' and '$(Crossgen2SdkOverridePropsPath)' != ''" />
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
<Import Project="Sdk.targets" Sdk="Microsoft.DotNet.SharedFramework.Sdk" />
<Import Project="$(RepositoryEngineeringDir)targetingpacks.targets" />
<Import Project="$(RepositoryEngineeringDir)codeOptimization.targets" />
<Import Project="$(Crossgen2SdkOverrideTargetsPath)" Condition="'$(PublishReadyToRun)' == 'true' and '$(Crossgen2SdkOverrideTargetsPath)' != ''" />
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@

<PropertyGroup>
<Description>Apphost Bundle Tests</Description>
<OutputType>Exe</OutputType>
<RuntimeIdentifier>$(TargetRid)</RuntimeIdentifier>
<TargetFramework>$(TestInfraTargetFramework)</TargetFramework>
<AssemblyName>AppHost.Bundle.Tests</AssemblyName>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<!-- Reduce the length of the test output dir to make it more reliable on Windows. -->
<TestsOutputName>ahb</TestsOutputName>
<!-- NuGet warns about a transitive P2P to System.Text.Json that can't be pruned.
This is a false positive: https://github.com/NuGet/Home/issues/14103 -->
<NoWarn>$(NoWarn);NU1511</NoWarn>
<NoWarn>$(NoWarn);NU1511;xUnit1004</NoWarn>
<TestRunnerName>XUnitV3</TestRunnerName>
</PropertyGroup>

<ItemGroup>
Expand Down
31 changes: 17 additions & 14 deletions src/installer/tests/AppHost.Bundle.Tests/AppLaunch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ private void RunTheApp(string path, bool selfContained)
Command.Create(path)
.CaptureStdErr()
.CaptureStdOut()
.DotNetRoot(selfContained ? null : TestContext.BuiltDotNet.BinPath)
.DotNetRoot(selfContained ? null : HostTestContext.BuiltDotNet.BinPath)
.Execute()
.Should().Pass()
.And.HaveStdOutContaining("Hello World!");
Expand Down Expand Up @@ -75,9 +75,9 @@ private void RunApp(bool selfContained)
if (OperatingSystem.IsWindows())
{
// StandaloneApp sets FileVersion to NETCoreApp version. On Windows, this should be copied to singlefilehost resources.
string expectedVersion = TestContext.MicrosoftNETCoreAppVersion.Contains('-')
? TestContext.MicrosoftNETCoreAppVersion[..TestContext.MicrosoftNETCoreAppVersion.IndexOf('-')]
: TestContext.MicrosoftNETCoreAppVersion;
string expectedVersion = HostTestContext.MicrosoftNETCoreAppVersion.Contains('-')
? HostTestContext.MicrosoftNETCoreAppVersion[..HostTestContext.MicrosoftNETCoreAppVersion.IndexOf('-')]
: HostTestContext.MicrosoftNETCoreAppVersion;
Assert.Equal(expectedVersion, System.Diagnostics.FileVersionInfo.GetVersionInfo(singleFile).FileVersion);
}
}
Expand All @@ -103,14 +103,17 @@ private void NonAsciiCharacterSelfContainedApp()
if (OperatingSystem.IsWindows())
{
// StandaloneApp sets FileVersion to NETCoreApp version. On Windows, this should be copied to singlefilehost resources.
string expectedVersion = TestContext.MicrosoftNETCoreAppVersion.Contains('-')
? TestContext.MicrosoftNETCoreAppVersion[..TestContext.MicrosoftNETCoreAppVersion.IndexOf('-')]
: TestContext.MicrosoftNETCoreAppVersion;
string expectedVersion = HostTestContext.MicrosoftNETCoreAppVersion.Contains('-')
? HostTestContext.MicrosoftNETCoreAppVersion[..HostTestContext.MicrosoftNETCoreAppVersion.IndexOf('-')]
: HostTestContext.MicrosoftNETCoreAppVersion;
Assert.Equal(expectedVersion, System.Diagnostics.FileVersionInfo.GetVersionInfo(singleFile).FileVersion);
}
}

[ConditionalTheory(typeof(Binaries.CetCompat), nameof(Binaries.CetCompat.IsSupported))]
[Theory(
SkipType = typeof(Binaries.CetCompat),
SkipUnless = nameof(Binaries.CetCompat.IsSupported),
Skip = "CET is not supported on this platform")]
[InlineData(true)]
[InlineData(false)]
public void DisableCetCompat(bool selfContained)
Expand All @@ -124,12 +127,12 @@ public void DisableCetCompat(bool selfContained)
Command.Create(singleFile)
.CaptureStdErr()
.CaptureStdOut()
.DotNetRoot(TestContext.BuiltDotNet.BinPath, TestContext.BuildArchitecture)
.DotNetRoot(HostTestContext.BuiltDotNet.BinPath, HostTestContext.BuildArchitecture)
.MultilevelLookup(false)
.Execute()
.Should().Pass()
.And.HaveStdOutContaining("Hello World")
.And.HaveStdOutContaining(TestContext.MicrosoftNETCoreAppVersion);
.And.HaveStdOutContaining(HostTestContext.MicrosoftNETCoreAppVersion);
}

[Theory]
Expand Down Expand Up @@ -158,7 +161,7 @@ public void FrameworkDependent_NoBundleEntryPoint()

using (var dotnetWithMockHostFxr = TestArtifact.Create("mockhostfxrFrameworkMissingFailure"))
{
var dotnet = new DotNetBuilder(dotnetWithMockHostFxr.Location, TestContext.BuiltDotNet.BinPath, null)
var dotnet = new DotNetBuilder(dotnetWithMockHostFxr.Location, HostTestContext.BuiltDotNet.BinPath, null)
.RemoveHostFxr()
.AddMockHostFxr(new Version(2, 2, 0))
.Build();
Expand All @@ -177,7 +180,7 @@ public void FrameworkDependent_NoBundleEntryPoint()
}

[Fact]
[PlatformSpecific(TestPlatforms.Windows)] // GUI app host is only supported on Windows.
[PlatformSpecific(TestPlatforms.Windows)]
public void FrameworkDependent_GUI_DownlevelHostFxr_ErrorDialog()
{
var singleFile = sharedTestState.FrameworkDependentApp.Bundle();
Expand All @@ -188,14 +191,14 @@ public void FrameworkDependent_GUI_DownlevelHostFxr_ErrorDialog()
{
string expectedErrorCode = Constants.ErrorCode.BundleExtractionFailure.ToString("x");

var dotnet = new DotNetBuilder(dotnetWithMockHostFxr.Location, TestContext.BuiltDotNet.BinPath, null)
var dotnet = new DotNetBuilder(dotnetWithMockHostFxr.Location, HostTestContext.BuiltDotNet.BinPath, null)
.RemoveHostFxr()
.AddMockHostFxr(new Version(5, 0, 0))
.Build();

Command command = Command.Create(singleFile)
.EnableTracingAndCaptureOutputs()
.DotNetRoot(dotnet.BinPath, TestContext.BuildArchitecture)
.DotNetRoot(dotnet.BinPath, HostTestContext.BuildArchitecture)
.Start();

WindowsUtils.WaitForPopupFromProcess(command.Process);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ private FluentAssertions.AndConstraint<CommandResultAssertions> RunTheApp(string
{
CommandResult result = Command.Create(path)
.EnableTracingAndCaptureOutputs()
.DotNetRoot(selfContained ? null : TestContext.BuiltDotNet.BinPath)
.DotNetRoot(selfContained ? null : HostTestContext.BuiltDotNet.BinPath)
.MultilevelLookup(false)
.Execute();
if (deleteApp)
Expand Down Expand Up @@ -142,8 +142,7 @@ public void FrameworkDependent_Targeting50(BundleOptions options)
}
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/54234")]
[Fact(Skip = "https://github.com/dotnet/runtime/issues/54234")]
// NOTE: when enabling this test take a look at commented code marked by "ACTIVE ISSUE:" in SharedTestState
public void SelfContained_R2R_Composite()
{
Expand Down
4 changes: 2 additions & 2 deletions src/installer/tests/AppHost.Bundle.Tests/NativeLibraries.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ private void PInvoke(bool selfContained, bool bundleNative)
Command.Create(app, "load_native_library_pinvoke")
.CaptureStdErr()
.CaptureStdOut()
.DotNetRoot(selfContained ? null : TestContext.BuiltDotNet.BinPath)
.DotNetRoot(selfContained ? null : HostTestContext.BuiltDotNet.BinPath)
// Specify an extraction root that will get cleaned up by the test app artifact
.EnvironmentVariable(Constants.BundleExtractBase.EnvironmentVariable, extractionRoot)
.Execute()
Expand Down Expand Up @@ -66,7 +66,7 @@ private void TryLoad(bool selfContained, bool bundleNative)
Command.Create(app, "load_native_library_api")
.CaptureStdErr()
.CaptureStdOut()
.DotNetRoot(selfContained ? null : TestContext.BuiltDotNet.BinPath)
.DotNetRoot(selfContained ? null : HostTestContext.BuiltDotNet.BinPath)
// Specify an extraction root that will get cleaned up by the test app artifact
.EnvironmentVariable(Constants.BundleExtractBase.EnvironmentVariable, extractionRoot)
.Execute()
Expand Down
2 changes: 0 additions & 2 deletions src/installer/tests/Assets/Projects/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<Project>
<Import Project="$(RepositoryEngineeringDir)targetingpacks.targets" />

<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets, $(MSBuildThisFileDirectory)..))" />

<PropertyGroup>
Expand Down
9 changes: 4 additions & 5 deletions src/installer/tests/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@
<PropertyGroup>
<TestArtifactsOutputRoot>$(ArtifactsDir)tests\host\$(TargetOS).$(TargetArchitecture).$(Configuration)\</TestArtifactsOutputRoot>
<TestInfraTargetFramework>$(NetCoreAppToolCurrent)</TestInfraTargetFramework>
<TestCaseFilter>category!=failing</TestCaseFilter>
<TestRunnerAdditionalArguments>--filter $(TestCaseFilter) -v detailed</TestRunnerAdditionalArguments>
<TestCaseFilter>/[category!=failing]</TestCaseFilter>
<TestRunnerAdditionalArguments>--filter-query $(TestCaseFilter)</TestRunnerAdditionalArguments>
<!-- Enable crash and hang dumps -->
<TestRunnerAdditionalArguments>$(TestRunnerAdditionalArguments) --blame-crash-dump-type full</TestRunnerAdditionalArguments>
<TestRunnerAdditionalArguments>$(TestRunnerAdditionalArguments) --blame-hang-timeout 5m --blame-hang-dump-type full</TestRunnerAdditionalArguments>
<UseVSTestRunner>true</UseVSTestRunner>
<TestRunnerAdditionalArguments>$(TestRunnerAdditionalArguments) --crashdump</TestRunnerAdditionalArguments>
<TestRunnerAdditionalArguments>$(TestRunnerAdditionalArguments) --hangdump --hangdump-timeout 5m --hangdump-type full</TestRunnerAdditionalArguments>
<RunAnalyzers>false</RunAnalyzers>
</PropertyGroup>

Expand Down
5 changes: 5 additions & 0 deletions src/installer/tests/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@
<RunSettingsTestCaseFilter>$(TestCaseFilter)</RunSettingsTestCaseFilter>
</PropertyGroup>

<ItemGroup Condition="'$(IsTestProject)' == 'true'">
<PackageReference Include="Microsoft.Testing.Extensions.CrashDump" Version="1.7.3" />
<PackageReference Include="Microsoft.Testing.Extensions.HangDump" Version="1.7.3" />
</ItemGroup>

<Import Project="$(RepositoryEngineeringDir)testing\runsettings.targets"
Condition="'$(IsTestProject)' == 'true'" />

Expand Down
4 changes: 2 additions & 2 deletions src/installer/tests/HostActivation.Tests/Breadcrumbs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public Breadcrumbs(SharedTestState fixture)
[Fact]
public void BreadcrumbThreadFinishes()
{
TestContext.BuiltDotNet.Exec(sharedTestState.App.AppDll)
HostTestContext.BuiltDotNet.Exec(sharedTestState.App.AppDll)
.EnvironmentVariable(Constants.Breadcrumbs.EnvironmentVariable, sharedTestState.BreadcrumbLocation)
.EnableTracingAndCaptureOutputs()
.Execute()
Expand All @@ -34,7 +34,7 @@ public void BreadcrumbThreadFinishes()
[Fact]
public void UnhandledException_BreadcrumbThreadDoesNotFinish()
{
TestContext.BuiltDotNet.Exec(sharedTestState.App.AppDll, "throw_exception")
HostTestContext.BuiltDotNet.Exec(sharedTestState.App.AppDll, "throw_exception")
.EnvironmentVariable(Constants.Breadcrumbs.EnvironmentVariable, sharedTestState.BreadcrumbLocation)
.EnableTracingAndCaptureOutputs()
.DisableDumps() // Expected to throw an exception
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,24 +111,24 @@ public class SharedTestState : SharedTestStateBase
public SharedTestState()
{
DotNetWithNetCoreApp = DotNet("WithNetCoreApp")
.AddMicrosoftNETCoreAppFrameworkMockCoreClr(TestContext.MicrosoftNETCoreAppVersion)
.AddMicrosoftNETCoreAppFrameworkMockCoreClr(HostTestContext.MicrosoftNETCoreAppVersion)
.Build();

string nativeDependencyRelPath = $"{TestContext.BuildRID}/{Binaries.GetSharedLibraryFileNameForCurrentPlatform("native")}";
FrameworkReferenceApp = CreateFrameworkReferenceApp(Constants.MicrosoftNETCoreApp, TestContext.MicrosoftNETCoreAppVersion, b => b
string nativeDependencyRelPath = $"{HostTestContext.BuildRID}/{Binaries.GetSharedLibraryFileNameForCurrentPlatform("native")}";
FrameworkReferenceApp = CreateFrameworkReferenceApp(Constants.MicrosoftNETCoreApp, HostTestContext.MicrosoftNETCoreAppVersion, b => b
.WithProject(DependencyName, DependencyVersion, p => p
.WithAssemblyGroup(null, g => g
.WithAsset($"{DependencyName}.dll", f => f.NotOnDisk()))
.WithNativeLibraryGroup(TestContext.BuildRID, g => g
.WithNativeLibraryGroup(HostTestContext.BuildRID, g => g
.WithAsset(nativeDependencyRelPath, f => f.NotOnDisk()))));
RuntimeConfig.FromFile(FrameworkReferenceApp.RuntimeConfigJson)
.WithTfm(TestContext.Tfm)
.WithTfm(HostTestContext.Tfm)
.Save();

AdditionalProbingPath = Path.Combine(Location, "probe");
(DependencyPath, NativeDependencyDirectory) = AddDependencies(AdditionalProbingPath);

AdditionalProbingPath_ArchTfm = Path.Combine(AdditionalProbingPath, TestContext.BuildArchitecture, TestContext.Tfm);
AdditionalProbingPath_ArchTfm = Path.Combine(AdditionalProbingPath, HostTestContext.BuildArchitecture, HostTestContext.Tfm);
(DependencyPath_ArchTfm, NativeDependencyDirectory_ArchTfm) = AddDependencies(AdditionalProbingPath_ArchTfm);

(string, string) AddDependencies(string probeDir)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ public class SharedTestState : SharedTestStateBase
public SharedTestState()
{
DotNetWithNetCoreApp = DotNet("WithNetCoreApp")
.AddMicrosoftNETCoreAppFrameworkMockCoreClr(TestContext.MicrosoftNETCoreAppVersion)
.AddMicrosoftNETCoreAppFrameworkMockCoreClr(HostTestContext.MicrosoftNETCoreAppVersion)
.Build();

FrameworkReferenceApp = CreateFrameworkReferenceApp(Constants.MicrosoftNETCoreApp, TestContext.MicrosoftNETCoreAppVersion, b => b
FrameworkReferenceApp = CreateFrameworkReferenceApp(Constants.MicrosoftNETCoreApp, HostTestContext.MicrosoftNETCoreAppVersion, b => b
.WithProject(DependencyName, "1.0.0", p => p
.WithAssemblyGroup(null, g => g.WithAsset($"{DependencyName}.dll"))));

Expand Down
Loading
Loading