From: Olga Arkhipova <olgaark@microsoft.com>
To: Nathan Sidwell <nathan@acm.org>, "Hernandez, Gerardo"
	<gerardo.hernandez@grassvalley.com>, Gabriel Dos Reis <gdr@microsoft.com>,
	Cameron DaCamara <Cameron.DaCamara@microsoft.com>
Subject: Re: Feedback of P1788R0
Thread-Topic: Feedback of P1788R0
Thread-Index: AQHVOmxW/kl3KBLM3UqcT4i2eHjn6KbLcT4wgAR8z4CAABMp3A==
Date: Thu, 18 Jul 2019 09:21:19 +0000
Message-ID:  <DM5PR21MB07805B29D6A42B5C84F0DEF4BCC80@DM5PR21MB0780.namprd21.prod.outlook.com>
References: <1563123051369.48116@grassvalley.com>
 <DM5PR21MB0780409BF23428658BAB124DBCC90@DM5PR21MB0780.namprd21.prod.outlook.com>,<2e29ca35-c1a9-de27-e48b-e5f96658742e@acm.org>
In-Reply-To: <2e29ca35-c1a9-de27-e48b-e5f96658742e@acm.org>
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
X-MS-Exchange-Organization-RecordReviewCfmType: 0
x-ms-exchange-organization-originalclientipaddress: 62.153.214.124
x-ms-exchange-organization-originalserveripaddress: 2603:10b6:3:a5::7
x-ms-exchange-organization-submissionquotaskipped: False
msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=True;
 MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47;
 MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Owner=olgaark@microsoft.com;
 MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2019-07-18T09:21:13.5480636Z;
 MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=General;
 MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Application=Microsoft Azure
 Information Protection;
 MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=c44afc54-ab85-41e7-b929-7e7070e2dbd2;
 MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Extended_MSFT_Method=Automatic
Content-Type: multipart/alternative;
	boundary="_000_DM5PR21MB07805B29D6A42B5C84F0DEF4BCC80DM5PR21MB0780namp_"
MIME-Version: 1.0

--_000_DM5PR21MB07805B29D6A42B5C84F0DEF4BCC80DM5PR21MB0780namp_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hi Nathan,

My assumption came from the fact that MSVC does this for implibs and winmds=
, i.e. the outputs which are often used by other components are not updated=
 during build (i.e. they don't change their file timestamp) if their conten=
t is not changed.



To my knowledge, compiler always compiles the files (and updates OBJ) and l=
inker always does all the work, but then compares the new output with the e=
xisting file and if the same, does not override it. This way the dependent =
components don't "feel" they need to be rebuilt without build system storin=
g and checking file hashes, so even simple build system's incremental build=
 works without causing (often long) chain rebuild for the changes not affec=
ting public surface (at least most of them). If we cannot do the same for C=
MIs, especially if they actually change even if public surface does not (so=
 hashes will not help), we have a problem.



Can you give me an example of the "essential metadata" you are talking abou=
t?



Thanks,

Olga





  _____

From: Nathan Sidwell <nathanmsidwell@gmail.com> on behalf of Nathan Sidwell=
 <nathan@acm.org>
Sent: Thursday, July 18, 2019 08:24
To: Olga Arkhipova; Hernandez, Gerardo
Subject: Re: Feedback of P1788R0



hi Olga,

On 7/17/19 11:03 PM, Olga Arkhipova wrote:

> The assumption I had was that BMIs will not be overridden during an incre=
mental
> build (i.e. when outputs already exist from a previous build) if their co=
ntent
> is not changed, similarly to other outputs a compiler produces like, say,
> implibs for dlls. I also assumed that this is up to the compilers how the=
y do it
> as only the compiler can see that the public surface is not changed when =
sources
> are changed.

While this is theoretically possible, it's probably not worth the effort. T=
he
CMI will contain location information (so that diagnostics can be emitted b=
y
importer's erroreous use), and that of course will change on line insertion=
s and
deletions, at minimum. So, although the declarations might be quite stable,
essential metadata will not be. It's probably expensive to compute 'is-same=
',
without actually generating it.

We don't have the same request for sameness detection on object files (but
they're not inputs to another source compilation).

nathan
--
Nathan Sidwell


--_000_DM5PR21MB07805B29D6A42B5C84F0DEF4BCC80DM5PR21MB0780namp_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http:=
//www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
<meta name=3D"Generator" content=3D"Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:purple;
	text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
	{mso-style-name:msonormal;
	mso-margin-top-alt:auto;
	margin-right:0in;
	mso-margin-bottom-alt:auto;
	margin-left:0in;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif;}
span.EmailStyle18
	{mso-style-type:personal-compose;
	font-family:"Times New Roman",serif;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-size:10.0pt;}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=3D"EN-US" link=3D"blue" vlink=3D"purple">
<div class=3D"WordSection1">
<p class=3D"MsoNormal">Hi Nathan, <o:p></o:p></p>
<div>
<p class=3D"MsoNormal">My assumption came from the fact that MSVC does this=
 for implibs and winmds, i.e. the outputs which are often used by other com=
ponents are not updated during build (i.e. they don&#8217;t change their fi=
le timestamp) if their content is not changed.<o:p></o:p></p>
</div>
<div>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">To my knowledge, compiler always compiles the files =
(and updates OBJ) and linker always does all the work, but then compares th=
e new output with the existing file and if the same, does not override it. =
This way the dependent components
 don&#8217;t &#8220;feel&#8221; they need to be rebuilt without build syste=
m storing and checking file hashes, so even simple build system&#8217;s inc=
remental build works without causing (often long) chain rebuild for the cha=
nges not affecting public surface (at least most of them).
 If we cannot do the same for CMIs, especially if they actually change even=
 if public surface does not (so hashes will not help), we have a problem.<o=
:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">Can you give me an example of the &#8220;essential m=
etadata&#8221; you are talking about?<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">Thanks,<o:p></o:p></p>
<p class=3D"MsoNormal">Olga<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class=3D"MsoNormal">&nbsp;<o:p></o:p></p>
</div>
<div class=3D"MsoNormal" align=3D"center" style=3D"text-align:center">
<hr size=3D"2" width=3D"98%" align=3D"center">
</div>
<div id=3D"divRplyFwdMsg">
<p class=3D"MsoNormal"><b><span style=3D"color:black">From:</span></b><span=
 style=3D"color:black"> Nathan Sidwell &lt;nathanmsidwell@gmail.com&gt; on =
behalf of Nathan Sidwell &lt;nathan@acm.org&gt;<br>
<b>Sent:</b> Thursday, July 18, 2019 08:24<br>
<b>To:</b> Olga Arkhipova; Hernandez, Gerardo<br>
<b>Subject:</b> Re: Feedback of P1788R0 <o:p></o:p></span></p>
<div>
<p class=3D"MsoNormal"><span style=3D"color:black">&nbsp;<o:p></o:p></span>=
</p>
</div>
</div>
<p class=3D"MsoNormal">hi Olga, <br>
<br>
On 7/17/19 11:03 PM, Olga Arkhipova wrote: <br>
<br>
&gt; The assumption I had was that BMIs will not be overridden during an in=
cremental
<br>
&gt; build (i.e. when outputs already exist from a previous build) if their=
 content <br>
&gt; is not changed, similarly to other outputs a compiler produces like, s=
ay, <br>
&gt; implibs for dlls. I also assumed that this is up to the compilers how =
they do it
<br>
&gt; as only the compiler can see that the public surface is not changed wh=
en sources
<br>
&gt; are changed. <br>
<br>
While this is theoretically possible, it's probably not worth the effort. T=
he <br>
CMI will contain location information (so that diagnostics can be emitted b=
y <br>
importer's erroreous use), and that of course will change on line insertion=
s and <br>
deletions, at minimum. So, although the declarations might be quite stable,=
 <br>
essential metadata will not be. It's probably expensive to compute 'is-same=
', <br>
without actually generating it. <br>
<br>
We don't have the same request for sameness detection on object files (but =
<br>
they're not inputs to another source compilation). <br>
<br>
nathan <br>
-- <br>
Nathan Sidwell <o:p></o:p></p>
</div>
</body>
</html>

--_000_DM5PR21MB07805B29D6A42B5C84F0DEF4BCC80DM5PR21MB0780namp_--

