Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Put binlog directly into the VMR's #42984

Merged
merged 9 commits into from
Aug 27, 2024
Merged

Put binlog directly into the VMR's #42984

merged 9 commits into from
Aug 27, 2024

Conversation

Winniexu01
Copy link
Member

Fixes dotnet/source-build#4112

Repo logs are stored separately under their repositories, which makes it very inconvenient to check.
So we introduced a new property DotNetBuildArtifactsLogDir which point to artifacts\log\Release\<reponame>\, all repo binlogs and other logs will respect the property and write to that folder.

@Winniexu01 Winniexu01 requested review from a team as code owners August 23, 2024 13:37
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Infrastructure untriaged Request triage from a team member labels Aug 23, 2024
@ViktorHofer
Copy link
Member

Looks good. A few more changes are necessary. I couldn't directly commit to your branch. Please apply this patch:

diff --git a/eng/pipelines/templates/jobs/vmr-build.yml b/eng/pipelines/templates/jobs/vmr-build.yml
index 4490d6ba8c..742bdb494c 100644
--- a/eng/pipelines/templates/jobs/vmr-build.yml
+++ b/eng/pipelines/templates/jobs/vmr-build.yml
@@ -447,8 +447,6 @@ jobs:
         cd "$(sourcesPath)"
 
         CopyWithRelativeFolders "artifacts/log/"             $targetFolder "*"
-        CopyWithRelativeFolders "src/"                       $targetFolder "*.binlog"
-        CopyWithRelativeFolders "src/"                       $targetFolder "*.log"
 
         if (Test-Path "artifacts/scenario-tests/") {
             CopyWithRelativeFolders "artifacts/scenario-tests/" $targetFolder "*.binlog"
@@ -486,11 +484,14 @@ jobs:
         fi
 
         cd "$(sourcesPath)"
+
         find artifacts/log/ -exec rsync -R {} -t ${targetFolder} \;
+
         if [ -d "artifacts/scenario-tests/" ]; then
           find artifacts/scenario-tests/ -type f -name "*.binlog" -exec rsync -R {} -t ${targetFolder} \;
           echo "##vso[task.setvariable variable=hasScenarioTestResults]true"
         fi
+
         find artifacts/TestResults/ -type f -name "*.binlog" -exec rsync -R {} -t ${targetFolder} \;
         find artifacts/TestResults/ -type f -name "*.diff" -exec rsync -R {} -t ${targetFolder} \;
         find artifacts/TestResults/ -type f -name "Updated*.txt" -exec rsync -R {} -t ${targetFolder} \;
@@ -498,12 +499,8 @@ jobs:
 
         if [[ "${{ parameters.buildSourceOnly }}" == "True" ]]; then
           find artifacts/prebuilt-report/ -exec rsync -R {} -t ${targetFolder} \;
-          find artifacts/log/binary-report/ -exec rsync -R {} -t ${targetFolder} \;
         fi
 
-        find src/ -type f -name "*.binlog" -exec rsync -R {} -t ${targetFolder} \;
-        find src/ -type f -name "*.log" -exec rsync -R {} -t ${targetFolder} \;
-
         # check if we have assets to publish
         if [ -n "$(ls -A 'artifacts/assets/Release/')" ]; then
           echo "##vso[task.setvariable variable=hasAssets]true"
diff --git a/src/SourceBuild/content/repo-projects/Directory.Build.targets b/src/SourceBuild/content/repo-projects/Directory.Build.targets
index 7643084ca8..707578e3b7 100644
--- a/src/SourceBuild/content/repo-projects/Directory.Build.targets
+++ b/src/SourceBuild/content/repo-projects/Directory.Build.targets
@@ -513,22 +513,16 @@
 
   <Target Name="CopyDotNetBuildArtifactsLogs"
         Condition="'$(IsUtilityProject)' != 'true' and
-                    Exists('$(ProjectDirectory)artifacts')">    
-
+                    Exists('$(ProjectDirectory)artifacts')">
     <ItemGroup>
       <LogFilesToCopy Include="$(ProjectDirectory)artifacts/**/*.log" />
       <LogFilesToCopy Include="$(ProjectDirectory)artifacts/**/*.binlog" />
-    </ItemGroup>  
-    
+    </ItemGroup>
+
     <!-- Make a copy of the build logs -->
     <Copy SourceFiles="@(LogFilesToCopy)"
           DestinationFolder="$(DotNetBuildArtifactsLogDir)"
           Condition="'@(LogFilesToCopy)' != ''" />
-
-    <!-- Cleanup build logs -->
-    <Delete Files="@(LogFilesToCopy)" Condition="'@(LogFilesToCopy)' != ''" />
-    <Message Text="Files deleted: @(LogFilesToCopy)"/>
-  
   </Target>
 
   <Target Name="CleanupRepo"

@Winniexu01
Copy link
Member Author

Sure, I've updated the code with the patch.

@ViktorHofer ViktorHofer merged commit 7c8daf8 into dotnet:main Aug 27, 2024
37 checks passed
@ViktorHofer
Copy link
Member

This looks great. Thanks a lot.

@Winniexu01
Copy link
Member Author

/backport to release/9.0.1xx

Copy link
Contributor

Started backporting to release/9.0.1xx: https://github.com/dotnet/sdk/actions/runs/10806681930

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Infrastructure untriaged Request triage from a team member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Repo binlogs should be copied to artifacts/log in the product build
3 participants