<div dir="ltr">The `--pathmap` option just serves to normalize file paths that are emitted to the EXE / DLL or PDB by the C# compiler. There are a number of cases where file paths are emitted like the PDB document table, [CallerFileInfo] parameters, etc ... Using `--pathmap` allows these paths to be normalized when building in different directories. If you're using the .NET SDK in many cases you can just pass -p:DeterministicSourcePaths and this will be done for you (that option should really have been called ReproducibleSourcePaths).<div><br></div><div><div>The original question was more about MSVC though, believe they have a similar option but unsure what the name is. </div></div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Tue, Dec 3, 2024 at 3:05 AM Andrew Leonard <<a href="mailto:anleonar@redhat.com">anleonar@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>For reproducible Windows builds of OpenJDK, we found the build PATH "hash" was an issue,</div><div>i'm not totally sure if all those deterministic options can avoid it. We work around the issue</div><div>by always using "relative" build paths for compilation.</div><div>Have you tried also using the --pathmap: option to map source paths generated by the compiler?</div><div>Not sure but it may make the "hashes" deterministic maybe...<br></div><div>ref: <a href="https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/advanced" target="_blank">https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/advanced</a></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Dec 2, 2024 at 11:25 AM Chris Lamb <<a href="mailto:chris@reproducible-builds.org" target="_blank">chris@reproducible-builds.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Danilo wrote:<br>
<br>
> <a href="https://try.diffoscope.org/hxsyehbrkftf.html" rel="noreferrer" target="_blank">https://try.diffoscope.org/hxsyehbrkftf.html</a> (link valid for 30 days).<br>
> There are no paths embedded in the binary. To me, this looks like some<br>
> kind of optimization, but I don't know where it's coming from.<br>
<br>
I've come across more than one file format that _hashes_ the build<br>
path and then uses that value as a debug/interface/build identifier.<br>
Crucially, as the build path is hashed, it does not appear as a<br>
literal string in the binary, so not seeing the build path in<br>
diffoscope is not conclusive.<br>
<br>
Whilst I've seen this used as part of the Link-Time Optimisation<br>
puzzle, the switch to disable stuff like that might be in the linker<br>
or debug area of your compiler docs — not the optimisation part.<br>
<br>
That would be my guess anyway... Am throwing it over the wall given<br>
you seem to be working on this as we type. :) No doubt someone much<br>
more informed about this file format will chime in and correct me.<br>
<br>
<br>
Best wishes,<br>
<br>
-- <br>
o<br>
⬋ ⬊ Chris Lamb<br>
o o <a href="http://reproducible-builds.org" rel="noreferrer" target="_blank">reproducible-builds.org</a> 💠<br>
⬊ ⬋<br>
o<br>
<br>
</blockquote></div>
</blockquote></div><div><br clear="all"></div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Jared Parsons<br></div><div><a href="http://blog.paranoidcoding.com/" target="_blank">http://blog.paranoidcoding.com/</a><br><a href="http://twitter.com/jaredpar" target="_blank">http://twitter.com/jaredpar<br></a></div></div></div>