-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
NativeAOT ignores PdbFile compiler option #78337
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas Issue DetailsHello, When compiling projects with We use the PdbFile option to strip some of the directory path from the PDB filename. The option is documented here: Duplicate PDBs (the first one is invalid): Adding true results in an incorrect filename in the PE debug directory: Removing Reproduction Steps
Expected behaviorValue from PdbFile field in .csproj is used instead of the actual filename. Actual behaviorReal filename is used instead of the PdbFile option. Regression?The PdbFile option works in all other versions of .NET except when using Known WorkaroundsNo response Configuration.NET 7.0 (x64) Other informationNo response
|
|
These options are meant to control properties of managed binaries produced by C# compiler. Controlling properties of the native binary produced by PublishAot is better done by passing extra arguments to the native linker, for example:
|
We've been some of these options for a few years. I couldn't find anything about compatibility with PublishAot and just assumed it uses the same properties.
The LinkerArg option is exactly what we needed... thank you🥳
LinkerArg really needs to be documented. I tried using the same linker command line from our native C/C++ projects and everything works except for BREPRO:
EDIT: I found an existing issue |
Reproducible builds are tracked in #73931 (comment). Assuming you also specified |
I'm not sure if it's the linker, IlCompiler or MSBuild messing up the deterministic build (or combination of all three). I've modified your ZeroSharp project and it's deterministic when compiled from the bat script. I'll update the other thread with the sample.
@jkotas The LinkerArg flags resolved this issue so I'll close it. Thanks for the help :) |
Hello,
When compiling projects with
<PublishAot>true</PublishAot>
and<PdbFile>abcd.pdb</PdbFile>
there are two invalid PDBs created in the directory and the wrong filename is added to the PE debug directory.We use the PdbFile option to strip some of the directory path from the PDB filename. The option is documented here:
https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/advanced#pdbfile
Duplicate PDBs (the first one is invalid):
Adding true results in an incorrect filename in the PE debug directory:
Removing
<PublishAot>true</PublishAot>
results in the correct path:Reproduction Steps
<PublishAot>true</PublishAot>
and<PdbFile>abcd.pdb</PdbFile>
Expected behavior
Value from PdbFile field in .csproj is used instead of the actual filename.
Actual behavior
Real filename is used instead of the PdbFile option.
Regression?
The PdbFile option works in all other versions of .NET except when using
<PublishAot>true</PublishAot>
Known Workarounds
No response
Configuration
.NET 7.0 (x64)
Other information
No response
The text was updated successfully, but these errors were encountered: