aganea added a subscriber: dexonsmith.
aganea added a comment.

In D80833#3052551 <https://reviews.llvm.org/D80833#3052551>, @dexonsmith wrote:

> In D80833#2069411 <https://reviews.llvm.org/D80833#2069411>, @aganea wrote:
>
>> In D80833#2069246 <https://reviews.llvm.org/D80833#2069246>, @amccarth wrote:
>>
>>> Does embedding full paths affect distributed builds or build 
>>> reproducibility?
>>
>> It does affect reproducibility for distributed builds, the contents of 
>> `LF_BUILDINFO` for a remotely-compiled .OBJ will be different in the final 
>> .PDB.
>
> I don't think the path to the compiler is the only concern regarding 
> reproducible builds. Including the full command-line means that artifacts 
> change when options that have no (other) effect on the output are added. 
> E.g., adding `-Wall` will create a different object file than `-Wmost`. I 
> worry this is the wrong direction for default clang behaviour.

In my sense, the fact that an option doesn't change the output is orthogonal to 
producing a deterministic output. I think most caching systems treat the 
compiler as a black box, by simply hashing the command-line and assuming the 
same .OBJ will be generated from that command-line. The build system could 
filter out options that are known to have effect on the output, to address your 
concern. But I feel this outside of the scope of this patch?

> Should this new instability be restricted to when users explicitly request it?

The goal of this patch (and D43002 <https://reviews.llvm.org/D43002>) is simply 
to be on-par with what MSVC generates by default. It seems a bit 
counter-intuitive to provide `-grecord-command-line` to clang-cl only to match 
the MSVC behavior, but if that's the general consensus, I'm fine as long as 
`LF_BUILDINFO` is supported in LLVM.

In D80833#3052741 <https://reviews.llvm.org/D80833#3052741>, @dexonsmith wrote:

> If you do go with "off-by-default", the natural driver option to use would be 
> the existing `-grecord-command-line`. You could use the same plumbing through 
> `-cc1` that it does.

You mean using the `llvm.commandline` metadata? That's an interesting idea 
which should be explored.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80833/new/

https://reviews.llvm.org/D80833

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D80833: [C... Duncan P. N. Exon Smith via Phabricator via cfe-commits
    • [PATCH] D8083... Duncan P. N. Exon Smith via Phabricator via cfe-commits
    • [PATCH] D8083... Alexandre Ganea via Phabricator via cfe-commits

Reply via email to