Skip to content

Commit d81ac77

Browse files
committed
Attempt to copy userevents assets for CI
1 parent a0c37b6 commit d81ac77

File tree

3 files changed

+15
-16
lines changed

3 files changed

+15
-16
lines changed

src/tests/build.proj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@
3939
<RestoreProjects Include="Common\XHarnessRunnerLibrary\XHarnessRunnerLibrary.csproj" />
4040
<RestoreProjects Include="Common\external\external.csproj" />
4141
<RestoreProjects Include="Common\ilasm\ilasm.ilproj" />
42-
<RestoreProjects Include="tracing\eventpipe\userevents\userevents.csproj"
43-
Condition="'$(TargetOS)' == 'linux'"/>
42+
<RestoreProjects Include="tracing\eventpipe\userevents\userevents.csproj" />
4443
</ItemGroup>
4544

4645
<ItemGroup>

src/tests/tracing/eventpipe/userevents/userevents.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,6 @@ public static int TestEntryPoint()
6565
recordTraceProcess.BeginOutputReadLine();
6666
recordTraceProcess.ErrorDataReceived += (_, args) => Console.Error.WriteLine($"[record-trace] {args.Data}");
6767
recordTraceProcess.BeginErrorReadLine();
68-
if (recordTraceProcess.HasExited && recordTraceProcess.ExitCode != 0)
69-
{
70-
Console.Error.WriteLine($"record-trace exited prematurely with code {recordTraceProcess.ExitCode}");
71-
return -1;
72-
}
7368
Console.WriteLine($"record-trace started with PID: {recordTraceProcess.Id}");
7469

7570
ProcessStartInfo traceeStartInfo = new();

src/tests/tracing/eventpipe/userevents/userevents.csproj

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.OneCollect.RecordTrace" Version="$(MicrosoftOneCollectRecordTraceVersion)" PrivateAssets="All" Condition="'$(TargetOS)' == 'linux'" />
10+
<PackageReference Include="Microsoft.OneCollect.RecordTrace" Version="$(MicrosoftOneCollectRecordTraceVersion)" PrivateAssets="All" />
1111
</ItemGroup>
1212

1313
<ItemGroup>
@@ -16,14 +16,19 @@
1616
</ItemGroup>
1717

1818
<ItemGroup>
19-
<None Include="dotnet-common.script" CopyToOutputDirectory="PreserveNewest" />
19+
<Content Include="dotnet-common.script">
20+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
21+
<TargetPath>dotnet-common.script</TargetPath>
22+
</Content>
2023
</ItemGroup>
2124

22-
<ItemGroup Condition="'$(TargetOS)' == 'linux'">
23-
<None Include="$(NuGetPackageRoot)microsoft.onecollect.recordtrace/$(MicrosoftOneCollectRecordTraceVersion)/runtimes/$(TargetOS)-$(TargetArchitecture)/native/record-trace">
24-
<Link>record-trace</Link>
25-
<Visible>false</Visible>
26-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
27-
</None>
28-
</ItemGroup>
25+
<Target Name="CopyRecordTrace" BeforeTargets="Build;CopyAllNativeProjectReferenceBinaries" Condition="'$(TargetOS)' == 'linux' and ('$(TargetArchitecture)' == 'x64' or '$(TargetArchitecture)' == 'arm64')">
26+
<PropertyGroup>
27+
<_DestDir>$(TargetDir)</_DestDir>
28+
<_DestDir Condition="'$(_DestDir)' == ''">$(OutputPath)</_DestDir>
29+
<_RecordTraceSource>$(NuGetPackageRoot)microsoft.onecollect.recordtrace/$(MicrosoftOneCollectRecordTraceVersion)/runtimes/linux-$(TargetArchitecture)/native/record-trace</_RecordTraceSource>
30+
</PropertyGroup>
31+
32+
<Copy SourceFiles="$(_RecordTraceSource)" DestinationFiles="$(_DestDir)record-trace" SkipUnchangedFiles="true" />
33+
</Target>
2934
</Project>

0 commit comments

Comments
 (0)