Date: Thu, 1 Aug 2019 00:46:12 +0000
The trick here is to define “public surface”. This is one of the many areas where C++ Modules may differ from C# assemblies. How - precisely - would this new file differ from the CMI?
— Gaby
> On Jul 31, 2019, at 4:30 PM, Olga Arkhipova via SG15 <sg15_at_lists.isocpp.org> wrote:
>
> Yes, having more than one file for a built module is definitely an option.
> If we look at other languages - c#, for instance, produces a "regular" binary (containing definitions, implementations and whatever else) and a special "reference only" binary, containing only public declarations. The first one is updated every time it builds, the second one only if public surface is changing.
>
> For stale locations in warnings - I don't think this is a big problem because it can happen only for sources which import the module (not the module source itself, as it will always built when changed) and only when this source was successfully compiled before which means that the warnings were happily ignored. If they are important, people usually set "treat warnings as errors". And if there were errors, the source will be rebuilt anyway.
>
> In VS IDE (and msbuild in general) the ignored warnings are currently lost anyway in the subsequent incremental builds and I remember only one complain about that. The complains about "overbuild" is way more numerous and loud.
>
> Anyway, if we have an ability to rebuild dependencies only for public module changes we also can have an option to "always build" if this is important for somebody. Currently, we force everybody to pay the price for this correctness and I this does not look right to me.
>
> Thanks,
> Olga
>
> -----Original Message-----
> From: SG15 <sg15-bounces_at_[hidden]> On Behalf Of Matthew Woehlke via SG15
> Sent: Wednesday, July 31, 2019 2:45 PM
> To: sg15_at_[hidden]
> Cc: Matthew Woehlke <mwoehlke.floss_at_gmail.com>; Hernandez, Gerardo <Gerardo.Hernandez_at_grassvalley.com>; blopes_at_apple.com; Gor Nishanov <gorn_at_microsoft.com>; Cameron DaCamara <Cameron.DaCamara_at_microsoft.com>; nathan_at_acm.org
> Subject: Re: [SG15] Will any change in a module source or dependencies cause change in the public/reachable surface of the built module?
>
>> On 18/07/2019 17.22, David Blaikie via SG15 wrote:
>> On 18/07/2019 17.13, Olga Arkhipova via SG15 wrote:> Geraldo and I
>> assumed that compilers and build systems will be able
>>> to detect somehow that adding, say, a comment to a module source
>>> should not cause rebuild of all components which depend on this
>>> module.
>>>
>>> Nathan and Gaby pointed out that currently built modules contain
>>> locations (line/pos I assume) of the declarations in the source
>>> file(s), so pretty much any change in the module sources and
>>> dependencies (except maybe very trivial ones) will produce a
>>> different CMI.
>
> This sounds like the same problem as "don't rebuild libbar, which depends on libfoo, if libfoo did not change". In that case, if libfoo.so contains e.g. line number information, too bad. This in turn suggests a similar fix: keep line number information and symbolic code in separate files, with consumers not depending on the one the former.
>
> (IOW, more or less what Ben said...)
>
>> if a downstream entity has failed to build pre-change, it'd make sense
>> to rerun it so the error messages have the correct/up to date line
>> numbers in diagnostics, etc
>
> This is a non-issue. If the entity failed to build, its output does not exist and that edge is still "dirty", so will be rebuilt anyway.
>
>> (you should not show a user any cached diagnostics from the old build)
>> - so the file can't be identical... which is going to be super tricky
>> for the build system)
>
> That only sounds like a problem for e.g. ccache, and it's not really hard to address; ccache will have to consider the file with line numbers as part of its caching.
>
> I don't see what's "super tricky"?
>
> --
> Matthew
> _______________________________________________
> SG15 mailing list
> SG15_at_[hidden]pp.org
> https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.isocpp.org%2Fmailman%2Flistinfo.cgi%2Fsg15&data=02%7C01%7Cgdr%40microsoft.com%7C56de8cc58a2441771f8108d7160f0519%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637002126180599835&sdata=2nsEYuPNk2aI9PNGekydiP1RQFsQSNhGJTWLTMiph1k%3D&reserved=0
> _______________________________________________
> SG15 mailing list
> SG15_at_[hidden]
> https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.isocpp.org%2Fmailman%2Flistinfo.cgi%2Fsg15&data=02%7C01%7Cgdr%40microsoft.com%7C56de8cc58a2441771f8108d7160f0519%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637002126180599835&sdata=2nsEYuPNk2aI9PNGekydiP1RQFsQSNhGJTWLTMiph1k%3D&reserved=0
— Gaby
> On Jul 31, 2019, at 4:30 PM, Olga Arkhipova via SG15 <sg15_at_lists.isocpp.org> wrote:
>
> Yes, having more than one file for a built module is definitely an option.
> If we look at other languages - c#, for instance, produces a "regular" binary (containing definitions, implementations and whatever else) and a special "reference only" binary, containing only public declarations. The first one is updated every time it builds, the second one only if public surface is changing.
>
> For stale locations in warnings - I don't think this is a big problem because it can happen only for sources which import the module (not the module source itself, as it will always built when changed) and only when this source was successfully compiled before which means that the warnings were happily ignored. If they are important, people usually set "treat warnings as errors". And if there were errors, the source will be rebuilt anyway.
>
> In VS IDE (and msbuild in general) the ignored warnings are currently lost anyway in the subsequent incremental builds and I remember only one complain about that. The complains about "overbuild" is way more numerous and loud.
>
> Anyway, if we have an ability to rebuild dependencies only for public module changes we also can have an option to "always build" if this is important for somebody. Currently, we force everybody to pay the price for this correctness and I this does not look right to me.
>
> Thanks,
> Olga
>
> -----Original Message-----
> From: SG15 <sg15-bounces_at_[hidden]> On Behalf Of Matthew Woehlke via SG15
> Sent: Wednesday, July 31, 2019 2:45 PM
> To: sg15_at_[hidden]
> Cc: Matthew Woehlke <mwoehlke.floss_at_gmail.com>; Hernandez, Gerardo <Gerardo.Hernandez_at_grassvalley.com>; blopes_at_apple.com; Gor Nishanov <gorn_at_microsoft.com>; Cameron DaCamara <Cameron.DaCamara_at_microsoft.com>; nathan_at_acm.org
> Subject: Re: [SG15] Will any change in a module source or dependencies cause change in the public/reachable surface of the built module?
>
>> On 18/07/2019 17.22, David Blaikie via SG15 wrote:
>> On 18/07/2019 17.13, Olga Arkhipova via SG15 wrote:> Geraldo and I
>> assumed that compilers and build systems will be able
>>> to detect somehow that adding, say, a comment to a module source
>>> should not cause rebuild of all components which depend on this
>>> module.
>>>
>>> Nathan and Gaby pointed out that currently built modules contain
>>> locations (line/pos I assume) of the declarations in the source
>>> file(s), so pretty much any change in the module sources and
>>> dependencies (except maybe very trivial ones) will produce a
>>> different CMI.
>
> This sounds like the same problem as "don't rebuild libbar, which depends on libfoo, if libfoo did not change". In that case, if libfoo.so contains e.g. line number information, too bad. This in turn suggests a similar fix: keep line number information and symbolic code in separate files, with consumers not depending on the one the former.
>
> (IOW, more or less what Ben said...)
>
>> if a downstream entity has failed to build pre-change, it'd make sense
>> to rerun it so the error messages have the correct/up to date line
>> numbers in diagnostics, etc
>
> This is a non-issue. If the entity failed to build, its output does not exist and that edge is still "dirty", so will be rebuilt anyway.
>
>> (you should not show a user any cached diagnostics from the old build)
>> - so the file can't be identical... which is going to be super tricky
>> for the build system)
>
> That only sounds like a problem for e.g. ccache, and it's not really hard to address; ccache will have to consider the file with line numbers as part of its caching.
>
> I don't see what's "super tricky"?
>
> --
> Matthew
> _______________________________________________
> SG15 mailing list
> SG15_at_[hidden]pp.org
> https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.isocpp.org%2Fmailman%2Flistinfo.cgi%2Fsg15&data=02%7C01%7Cgdr%40microsoft.com%7C56de8cc58a2441771f8108d7160f0519%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637002126180599835&sdata=2nsEYuPNk2aI9PNGekydiP1RQFsQSNhGJTWLTMiph1k%3D&reserved=0
> _______________________________________________
> SG15 mailing list
> SG15_at_[hidden]
> https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.isocpp.org%2Fmailman%2Flistinfo.cgi%2Fsg15&data=02%7C01%7Cgdr%40microsoft.com%7C56de8cc58a2441771f8108d7160f0519%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637002126180599835&sdata=2nsEYuPNk2aI9PNGekydiP1RQFsQSNhGJTWLTMiph1k%3D&reserved=0
Received on 2019-07-31 19:48:11