提交 dba1feeb 编写于 作者: J Jared Parsons

Option for removing PDB path information in PE

上级 9927226d
......@@ -1776,6 +1776,18 @@ private static EmitResult ToEmitResultAndFree(DiagnosticBag diagnostics, bool su
bool emitPortablePdb = moduleBeingBuilt.EmitOptions.DebugInformationFormat == DebugInformationFormat.PortablePdb;
string pdbPath = (pdbStreamProvider != null) ? (moduleBeingBuilt.EmitOptions.PdbFilePath ?? FileNameUtilities.ChangeExtension(SourceModule.Name, "pdb")) : null;
// The PDB path is emitted in it's entirety into the PE. This makes it impossible to have deterministic
// builds that occur in different source directories. To enable this we shave all path information from
// the PDB when specified by the user.
//
// This is a temporary work around to allow us to make progress with determinism. The following issue
// tracks getting an official solution here.
//
// https://github.com/dotnet/roslyn/issues/9813
string pePdbPath = Feature("pdb-path-determinism") != null && !string.IsNullOrEmpty(pdbPath)
? Path.GetFileName(pdbPath)
: pdbPath;
try
{
metadataDiagnostics = DiagnosticBag.GetInstance();
......@@ -1872,7 +1884,7 @@ private static EmitResult ToEmitResultAndFree(DiagnosticBag diagnostics, bool su
getPeStream,
getPortablePdbStream,
nativePdbWriter,
pdbPath,
pePdbPath,
metadataOnly,
deterministic,
cancellationToken))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册