Browse Source

Fix dnx random failures (#20284)

* Try to fix dnx random failure

* Use full paths for WebAppDir everywhere

* Call dnx explicitly on CI

---------

Co-authored-by: Max Katz <maxkatz6@outlook.com>
pull/19486/merge
Julien Lebosquain 1 day ago
committed by GitHub
parent
commit
37526dc904
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 1
      .nuke/build.schema.json
  2. 22
      nukebuild/Build.cs
  3. 2
      src/Avalonia.DesignerSupport/Avalonia.DesignerSupport.csproj
  4. 2
      src/Browser/Avalonia.Browser/Avalonia.Browser.csproj
  5. 2
      tests/Avalonia.DesignerSupport.Tests/Avalonia.DesignerSupport.Tests.csproj

1
.nuke/build.schema.json

@ -35,6 +35,7 @@
"CreateNugetPackages",
"DownloadApiBaselinePackages",
"GenerateCppHeaders",
"InitDnx",
"OutputApiDiff",
"OutputVersion",
"Package",

22
nukebuild/Build.cs

@ -36,13 +36,13 @@ partial class Build : NukeBuild
[NuGetPackage("Microsoft.DotNet.ApiCompat.Tool", "Microsoft.DotNet.ApiCompat.Tool.dll", Framework = "net8.0")]
Tool ApiCompatTool;
[NuGetPackage("Microsoft.DotNet.ApiDiff.Tool", "Microsoft.DotNet.ApiDiff.Tool.dll", Framework = "net8.0")]
Tool ApiDiffTool;
[NuGetPackage("dotnet-ilrepack", "ILRepackTool.dll", Framework = "net8.0")]
Tool IlRepackTool;
protected override void OnBuildInitialized()
{
Parameters = new BuildParameters(this, ScheduledTargets.Contains(BuildToNuGetCache));
@ -57,6 +57,7 @@ partial class Build : NukeBuild
Information("Repository Name: " + Parameters.RepositoryName);
Information("Repository Branch: " + Parameters.RepositoryBranch);
}
Information("Configuration: " + Parameters.Configuration);
Information("IsLocalBuild: " + Parameters.IsLocalBuild);
Information("IsRunningOnUnix: " + Parameters.IsRunningOnUnix);
@ -73,8 +74,9 @@ partial class Build : NukeBuild
void ExecWait(string preamble, string command, string args)
{
Console.WriteLine(preamble);
Process.Start(new ProcessStartInfo(command, args) {UseShellExecute = false}).WaitForExit();
Process.Start(new ProcessStartInfo(command, args) { UseShellExecute = false }).WaitForExit();
}
ExecWait("dotnet version:", "dotnet", "--info");
ExecWait("dotnet workloads:", "dotnet", "workload list");
Information("Processor count: " + Environment.ProcessorCount);
@ -99,6 +101,7 @@ partial class Build : NukeBuild
.AddProperty("SkipBuildingTests", "True");
return c;
}
DotNetBuildSettings ApplySetting(DotNetBuildSettings c, Configure<DotNetBuildSettings> configurator = null) =>
ApplySettingCore(c).Build.Apply(configurator);
@ -129,6 +132,17 @@ partial class Build : NukeBuild
}
});
// Ensure that Bun.Official.Tool is downloaded at least once on CI to work around https://github.com/dotnet/sdk/issues/51831
Target InitDnx => _ => _
.Executes(() =>
{
var process = ProcessTasks.StartProcess(
"dnx",
"Bun.Unofficial.Tool --yes -- install",
$"{RootDirectory}/src/Browser/Avalonia.Browser/webapp");
process.AssertZeroExitCode();
});
Target CompileNative => _ => _
.DependsOn(Clean)
.DependsOn(GenerateCppHeaders)
@ -141,7 +155,7 @@ partial class Build : NukeBuild
});
Target Compile => _ => _
.DependsOn(Clean, CompileNative)
.DependsOn(Clean, CompileNative, InitDnx)
.Executes(() =>
{
DotNetBuild(c => ApplySetting(c)

2
src/Avalonia.DesignerSupport/Avalonia.DesignerSupport.csproj

@ -10,7 +10,7 @@
<NoWarn>$(NoWarn);CS1591</NoWarn>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<NugetPackageName>Avalonia</NugetPackageName>
<WebAppDir>Remote\HtmlTransport\webapp</WebAppDir>
<WebAppDir>$(MSBuildThisFileDirectory)Remote/HtmlTransport/webapp</WebAppDir>
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="Remote\HtmlTransport\webapp\build\**\*.gz" />

2
src/Browser/Avalonia.Browser/Avalonia.Browser.csproj

@ -3,7 +3,7 @@
<TargetFrameworks>$(AvsCurrentTargetFramework);$(AvsCurrentBrowserTargetFramework)</TargetFrameworks>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<WebAppDir>webapp</WebAppDir>
<WebAppDir>$(MSBuildThisFileDirectory)webapp</WebAppDir>
</PropertyGroup>
<ItemGroup>

2
tests/Avalonia.DesignerSupport.Tests/Avalonia.DesignerSupport.Tests.csproj

@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFramework>$(AvsCurrentTargetFramework)</TargetFramework>
<OutputType>Library</OutputType>
<WebAppDir>Remote\HtmlTransport\webapp</WebAppDir>
<WebAppDir>$(MSBuildThisFileDirectory)Remote/HtmlTransport/webapp</WebAppDir>
</PropertyGroup>
<Import Project="..\..\build\UnitTests.NetCore.targets" />
<Import Project="..\..\build\Moq.props" />

Loading…
Cancel
Save