Basic.CompilerLog.Util
0.7.1
See the version list below for details.
dotnet add package Basic.CompilerLog.Util --version 0.7.1
NuGet\Install-Package Basic.CompilerLog.Util -Version 0.7.1
<PackageReference Include="Basic.CompilerLog.Util" Version="0.7.1" />
paket add Basic.CompilerLog.Util --version 0.7.1
#r "nuget: Basic.CompilerLog.Util, 0.7.1"
// Install Basic.CompilerLog.Util as a Cake Addin #addin nuget:?package=Basic.CompilerLog.Util&version=0.7.1 // Install Basic.CompilerLog.Util as a Cake Tool #tool nuget:?package=Basic.CompilerLog.Util&version=0.7.1
Compiler Logs
This is the repository for creating and consuming compiler log files. These are files created from a MSBuild binary log that contain information necessary to recreate all of the Compilation instances from that build.
The compiler log files are self contained. They must be created on the same machine where the binary log was created but after creation they can be freely copied between machines. That enables a number of scenarios:
- GitHub pipelines can cleanly separate build and build analysis into different legs. The analysis can be done on a separate machine entirely independent of where the build happens.
- Allows for easier customer investigations by the C# / VB compiler teams. Instead of trying to re-create a customer build environment, customers can provide a compiler log file that developers can easily open with a call to the API.
complog
This global tool can be installed via
dotnet tool install --global complog
From there the following commands are available:
create
: create a complog file from an existing binary logreplay
: replay the builds from the complogexport
: export complete compilations to diskref
: export references for a compilation to diskrsp
: generate rsp files for compilation eventsprint
: print the summary of a complog on the command line
Info
⚠️ A compiler log will include potentially sensitive artifacts ⚠️
A compiler log file contains all of the information necessary to recreate a Compilation
. That includes all source, resources, references, strong name keys, etc .... That will be visible to anyone you provide a compiler log to.
Creating Compiler Logs
There are a number of ways to create a compiler log. The first step is to install the complog
global tool as that will be used to create the compiler log.
> dotnet tool install -g complog
The easiest is to create it off of a binary log file from a previous build.
> msbuild -bl MySolution.sln
> complog create msbuild.binlog
By default this will include every project in the binary log. If there are a lot of projects this can produce a large compiler log. You can use the -p
option to limit the compiler log to a specific set of projects.
> complog create msbuild.binlog -p MyProject.csproj
For solutions or projects that can be built with dotnet build
a compiler log can be created by just running create
against the solution or project file directly.
> complog create MyProject.csproj
When trying to get a compiler log from a build that occurs in a GitHub action you can use the complog-action
action to simplify creating and uploading the compiler log.
- name: Build .NET app
run: dotnet build -bl
- name: Create and upload the compiler log
uses: jaredpar/compilerlog-action@v1
with:
binlog: msbuild.binlog
Debugging Compiler Logs
Running locally
To re-run all of the compilations in a compiler log use the replay
command
> complog replay build.complog
Microsoft.VisualStudio.IntegrationTest.IntegrationService.csproj (net472) ...Success
Roslyn.Test.Performance.Utilities.csproj (net472) ...Success
Microsoft.CodeAnalysis.XunitHook.csproj (net472) ...Success
Passing the -export
argument will cause all failed compilations to be exported to the local disk for easy analysis.
Debugging in Visual Studio
To debug a compilation in Visual Studio first export it to disk:
> complog export build.complog
That will write out all the artifacts necessary to run a command line build to disk. Use the --project
option to limit the output to specific projects. For each project it will generate a build.rsp command that uses the exported arguments. It will also generate several build*.cmd
files. Those will execute dotnet exec csc.dll @build.rsp
on the build for every SDK installed on the machine.
The next step is to setup csc / vbc to use the build.rsp file for debugging. Open the debug settings for csc / vbc and set them to have the argument @build.rsp
and make the working directory the location of that file.
Then launch csc / vbc and it will debug that project.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 is compatible. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.7.2
- MessagePack (>= 2.5.129)
- Microsoft.CodeAnalysis (>= 4.8.0)
- Microsoft.CodeAnalysis.CSharp (>= 4.8.0)
- Microsoft.CodeAnalysis.VisualBasic (>= 4.8.0)
- Microsoft.Extensions.ObjectPool (>= 7.0.13)
- MSBuild.StructuredLogger (>= 2.2.169)
- System.IO.Compression (>= 4.3.0)
-
.NETStandard 2.0
- MessagePack (>= 2.5.129)
- Microsoft.CodeAnalysis (>= 4.8.0)
- Microsoft.CodeAnalysis.CSharp (>= 4.8.0)
- Microsoft.CodeAnalysis.VisualBasic (>= 4.8.0)
- Microsoft.Extensions.ObjectPool (>= 7.0.13)
- MSBuild.StructuredLogger (>= 2.2.169)
-
net7.0
- MessagePack (>= 2.5.129)
- Microsoft.CodeAnalysis (>= 4.8.0)
- Microsoft.CodeAnalysis.CSharp (>= 4.8.0)
- Microsoft.CodeAnalysis.VisualBasic (>= 4.8.0)
- Microsoft.Extensions.ObjectPool (>= 7.0.13)
- MSBuild.StructuredLogger (>= 2.2.169)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories (2)
Showing the top 2 popular GitHub repositories that depend on Basic.CompilerLog.Util:
Repository | Stars |
---|---|
dotnet/roslyn
The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
|
|
dotnet/dotnet
Home of .NET's Virtual Monolithic Repository which includes all the code needed to build the .NET SDK from source
|
Version | Downloads | Last updated |
---|---|---|
0.9.2 | 65 | 11/6/2024 |
0.9.1 | 78 | 10/23/2024 |
0.9.0 | 74 | 10/14/2024 |
0.8.4 | 77 | 10/11/2024 |
0.8.3 | 82 | 10/8/2024 |
0.8.2 | 67 | 9/20/2024 |
0.8.1 | 114 | 9/15/2024 |
0.8.0 | 106 | 9/9/2024 |
0.7.9 | 105 | 6/26/2024 |
0.7.8 | 46,901 | 6/10/2024 |
0.7.7 | 88 | 6/7/2024 |
0.7.6 | 96 | 5/28/2024 |
0.7.5 | 88 | 5/10/2024 |
0.7.4 | 100 | 5/7/2024 |
0.7.3 | 586 | 5/1/2024 |
0.7.2 | 111 | 4/29/2024 |
0.7.1 | 113 | 4/25/2024 |
0.7.0 | 113 | 4/25/2024 |
0.6.1 | 581 | 2/27/2024 |
0.6.0 | 108 | 2/21/2024 |
0.5.10 | 121 | 1/30/2024 |
0.5.9 | 99 | 1/29/2024 |
0.5.8 | 106 | 1/26/2024 |
0.5.7 | 153 | 12/26/2023 |
0.5.6 | 99 | 12/26/2023 |
0.5.5 | 145 | 12/21/2023 |
0.5.4 | 133 | 12/21/2023 |
0.5.3 | 143 | 12/12/2023 |
0.5.2 | 101 | 11/29/2023 |
0.5.1 | 72 | 11/28/2023 |
0.5.0 | 173 | 11/1/2023 |
0.4.1 | 148 | 9/26/2023 |
0.4.0 | 142 | 9/25/2023 |
0.3.8 | 142 | 9/25/2023 |
0.3.7 | 135 | 9/1/2023 |
0.3.6 | 157 | 8/16/2023 |
0.3.5 | 168 | 8/2/2023 |
0.3.4 | 214 | 6/29/2023 |
0.3.2 | 162 | 6/28/2023 |
0.3.1 | 157 | 6/28/2023 |
0.3.0 | 163 | 6/22/2023 |
0.2.9 | 164 | 5/31/2023 |
0.2.8 | 171 | 5/24/2023 |
0.2.7 | 173 | 5/11/2023 |
0.2.6 | 1,600 | 4/10/2023 |
0.2.5 | 213 | 3/16/2023 |