Skip to content

Commit 02bd489

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

File tree

3 files changed

+43
-14
lines changed

3 files changed

+43
-14
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: 42 additions & 7 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,49 @@
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>
25+
<ItemGroup Condition="'$(TargetOS)' != 'AnyOS'">
26+
<Content Include="$(NuGetPackageRoot)microsoft.onecollect.recordtrace/$(MicrosoftOneCollectRecordTraceVersion)/runtimes/$(TargetOS)-$(TargetArchitecture)/native/record-trace">
2627
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
27-
</None>
28+
<TargetPath>record-trace</TargetPath>
29+
</Content>
2830
</ItemGroup>
31+
32+
<!-- CI Build Include all record-trace variants in building the managed test components -->
33+
<!-- Afterwards, when copying the native project binaries, try to copy the specific one when we have a TargetOS -->
34+
<ItemGroup Condition="'$(TargetOS)' == 'AnyOS'">
35+
<Content Include="$(NuGetPackageRoot)microsoft.onecollect.recordtrace/$(MicrosoftOneCollectRecordTraceVersion)/runtimes/linux-x64/native/record-trace">
36+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
37+
<TargetPath>linux-x64/record-trace</TargetPath>
38+
</Content>
39+
<Content Include="$(NuGetPackageRoot)microsoft.onecollect.recordtrace/$(MicrosoftOneCollectRecordTraceVersion)/runtimes/linux-arm64/native/record-trace">
40+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
41+
<TargetPath>linux-arm64/record-trace</TargetPath>
42+
</Content>
43+
</ItemGroup>
44+
45+
<Target Name="CopyRidSpecificRecordTrace" AfterTargets="CopyAllNativeTestProjectBinaries">
46+
<PropertyGroup>
47+
<RecordTraceRidSubdir Condition="'$(TargetArchitecture)' == 'x64'">linux-x64</RecordTraceRidSubdir>
48+
<RecordTraceRidSubdir Condition="'$(TargetArchitecture)' == 'arm64'">linux-arm64</RecordTraceRidSubdir>
49+
<RecordTraceSource>$(OutputPath)$(RecordTraceRidSubdir)/record-trace</RecordTraceSource>
50+
<RecordTraceDest>$(OutputPath)record-trace</RecordTraceDest>
51+
</PropertyGroup>
52+
53+
<Copy
54+
SourceFiles="$(RecordTraceSource)"
55+
DestinationFiles="$(RecordTraceDest)"
56+
Condition="Exists('$(RecordTraceSource)')"
57+
SkipUnchangedFiles="true" />
58+
59+
<Exec Command="chmod +x '$(RecordTraceDest)'" Condition="Exists('$(RecordTraceDest)')" />
60+
61+
<Message Text="Copied RID-specific record-trace from $(RecordTraceSource) to $(RecordTraceDest)" Importance="High" Condition="Exists('$(RecordTraceSource)')" />
62+
<Warning Text="record-trace not found at $(RecordTraceSource) for RID $(RecordTraceRidSubdir)" Condition="!Exists('$(RecordTraceSource)')" />
63+
</Target>
2964
</Project>

0 commit comments

Comments
 (0)