Re: update dependency and signatures.dblite after biilding
Bill Deegan <[email protected]> Fri, 6 Jun 2025 11:14:00 -0700
| Newsgroups | gmane.comp.programming.tools.scons.user |
|---|---|
| Message-ID | <CAEyG4CGrXp77zp9hwCYOkL8j6TSeKWB3bXXeWArTCu+0ad8Oow@mail.gmail.com> |
--===============3579940940300684283== Content-Type: multipart/alternative; boundary="0000000000007143330636eb32b7" --0000000000007143330636eb32b7 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Of course a better scanner is slower.. as would generating the .d files from the compiler.. That said, the scanner I pointed you at may have room for improvement in terms of performance. Honestly.. IMHO using #define HEADER "xyz.h" and then #include HEADER is not great practice. For your code how many instances of a header file defined by a macro are there? Is it one, which is used all over the place? Or many, used many places? On Fri, Jun 6, 2025 at 10:20=E2=80=AFAM =E4=BA=8E <[email protected]> wrote: > > Well, this is why Bill advised trying the C Conditional Scanner, which > *does* know how to handle preprocessor instructions of this sort. It's > still a bit of a work in progress (there are some questions about > recursion, in particular), which is why it's not the default. Were you > able to try that out? > > I have try it, as Bill and Mats said, CConditionalScanner can resolve my > problem. > And I find that after set CConditionalScanner, the building time change > from 5min to 8min. > ---- Replied Message ---- > From Mats Wichmann<[email protected]> <undefined> > Date 6/6/2025 23:54 > To =E4=BA=8E<[email protected]> <[email protected]> > Cc SCons users mailing list<[email protected]> <[email protected]= > > Subject Re: [Scons-users] update dependency and signatures.dblite after > biilding > On 6/6/25 09:46, =E4=BA=8E wrote: > > > =E2=80=8D=E2=80=8DMy problem: > =E2=80=8D > > In my project, there are those code in some source files, > > #defineFOO_HEADER "foo.h" > #includeFOO_HEADER > > =E2=80=8D=E2=80=8D > > and the files are independent module, I can't modify them. > > the scons-user.pdf said, scons the built-in C scanner is unable to > extract the implicit dependency on a header file. > So I create .d file for every source file, and parse dependencies > from .d, and then add dependency by Depends function. > > =E2=80=8D=E2=80=8DAnd then, there is a new problem, when there are no .d,= (for > example the first building or dependencies are changed), I need to > build project with two times, and then I can push all the > dependencies into signature. > > > yes, this isn't ideal - if the dependencies can't be automatically > determined, you have both a first-run problem and no detection of changes= . > > > =E2=80=8D=E2=80=8D > So I consider that whether could I update all the dependencies into > signature with just one building. > that is my problem. > > Well, this is why Bill advised trying the C Conditional Scanner, which > *does* know how to handle preprocessor instructions of this sort. It's > still a bit of a work in progress (there are some questions about > recursion, in particular), which is why it's not the default. Were you > able to try that out? > > _______________________________________________ > Scons-users mailing list > [email protected] > https://pairlist4.pair.net/mailman/listinfo/scons-users > --0000000000007143330636eb32b7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div>Of course a better scanner is slower.. as would gener= ating the .d files from the compiler..</div><div><br></div><div>That said, = the scanner I pointed you at may have room for improvement in terms of perf= ormance.</div><div><br></div><div>Honestly.. IMHO using #define=C2=A0HEADER= =C2=A0"xyz.h" and then #include HEADER is not great practice.</di= v><div><br></div><div>For your code how many instances of a header file def= ined=C2=A0by a macro are there?</div><div>Is it one, which is used all over= the place?</div><div>Or many, used many places?</div></div><br><div class= =3D"gmail_quote gmail_quote_container"><div dir=3D"ltr" class=3D"gmail_attr= ">On Fri, Jun 6, 2025 at 10:20=E2=80=AFAM =E4=BA=8E <<a href=3D"mailto:y= [email protected]">[email protected]</a>> wrote:<br></div><blockquote class=3D"= gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(20= 4,204,204);padding-left:1ex"><div><div style=3D"font-family:=E5=BE=AE=E8=BD= =AF=E9=9B=85=E9=BB=91"><div><br></div><div>=C2=A0Well, this is why Bill adv= ised trying the C Conditional Scanner, which <br>*does* know how to handle = preprocessor instructions of this sort.=C2=A0 It's <br>still a bit of a= work in progress (there are some questions about <br>recursion, in particu= lar), which is why it's not the default.=C2=A0 Were you <br>able to try= that out?=C2=A0</div><div style=3D"text-indent:2em"><br></div><div style= =3D"text-indent:2em">I have try it, as Bill and Mats said, CConditionalScan= ner can resolve my problem.</div><div style=3D"text-indent:2em">And I find = that after set CConditionalScanner, the building time change from 5min to 8= min.</div><div id=3D"m_3080952570899099365ntes-pcmac-signature" style=3D"fo= nt-family:=E5=BE=AE=E8=BD=AF=E9=9B=85=E9=BB=91"><div style=3D"font-size:14p= x;padding:0px;margin:0px"></div></div></div><div style=3D"padding-top:1px;p= adding-bottom:1px;font-family:=E5=BE=AE=E8=BD=AF=E9=9B=85=E9=BB=91"><div st= yle=3D"margin:2em 0px 1em;font-size:14px;line-height:1.25;color:rgb(120,120= ,122)">---- Replied Message ----</div><div style=3D"margin-bottom:1em;font-= size:12px;line-height:1.25;color:rgb(35,35,36);padding:0.5em 0.25em;border-= radius:0.67em;background-color:rgb(240,240,240)"><table width=3D"100%" cell= padding=3D"0" cellspacing=3D"9" border=3D"0" id=3D"m_3080952570899099365nte= s_editor_table_10010"><tbody><tr><td valign=3D"top" style=3D"width:4.25em;f= ont-size:12px;line-height:1.25;color:rgb(120,120,122)">From</td><td valign= =3D"top" style=3D"font-size:12px;line-height:1.25;color:rgb(35,35,36);word-= break:break-all"><a style=3D"color:rgb(48,97,242);text-decoration:none" hre= f=3D"mailto:undefined" target=3D"_blank">Mats Wichmann<[email protected]&= gt;</a></td></tr><tr><td valign=3D"top" style=3D"width:4.25em;font-size:12p= x;line-height:1.25;color:rgb(120,120,122)">Date</td><td valign=3D"top" styl= e=3D"font-size:12px;line-height:1.25;color:rgb(35,35,36);word-break:break-a= ll">6/6/2025 23:54</td></tr><tr><td valign=3D"top" style=3D"width:4.25em;fo= nt-size:12px;line-height:1.25;color:rgb(120,120,122)">To</td><td valign=3D"= top" style=3D"font-size:12px;line-height:1.25;color:rgb(35,35,36);word-brea= k:break-all"><a style=3D"color:rgb(48,97,242);text-decoration:none" href=3D= "mailto:[email protected]" target=3D"_blank">=E4=BA=8E<[email protected]></= a></td></tr><tr><td valign=3D"top" style=3D"width:4.25em;font-size:12px;lin= e-height:1.25;color:rgb(120,120,122)">Cc</td><td valign=3D"top" style=3D"fo= nt-size:12px;line-height:1.25;color:rgb(35,35,36);word-break:break-all"><a = style=3D"color:rgb(48,97,242);text-decoration:none" href=3D"mailto:scons-us= [email protected]" target=3D"_blank">SCons users mailing list<scons-users@sc= ons.org></a></td></tr><tr><td valign=3D"top" style=3D"width:4.25em;font-= size:12px;line-height:1.25;color:rgb(120,120,122)">Subject</td><td valign= =3D"top" style=3D"font-size:12px;line-height:1.25;color:rgb(35,35,36);word-= break:break-all">Re: [Scons-users] update dependency and signatures.dblite = after biilding</td></tr></tbody></table></div>On 6/6/25 09:46, =E4=BA=8E wr= ote:<br><blockquote><br> =E2=80=8D=E2=80=8DMy problem:<br> =E2=80=8D<br> <b= r> In my project, there are those code in some source files,<br> <br> = #defineFOO_HEADER "foo.h"<br> #includeFOO_HEADER<br> <br> = =E2=80=8D=E2=80=8D<br> <br> and the files are independent module, I can= 't modify them.<br> <br> the scons-user.pdf said, scons the built-i= n C scanner is unable to<br> extract the implicit dependency on a heade= r file.<br> So I create .d file for every source file, and parse depend= encies<br> from .d, and then add dependency by Depends function.<br> <b= r> =E2=80=8D=E2=80=8DAnd then, there is a new problem, when there are n= o .d, (for<br> example the first building or dependencies are changed),= I need to<br> build project with two times, and then I can push all th= e<br> dependencies into signature.<br></blockquote><br>yes, this isn= 9;t ideal - if the dependencies can't be automatically <br>determined, = you have both a first-run problem and no detection of changes.<br><br><bloc= kquote><br> =E2=80=8D=E2=80=8D<br> So I consider that whether could= I update all the dependencies into<br> signature with just one buildin= g.<br> that is my problem.<br> <br></blockquote>Well, this is why Bill = advised trying the C Conditional Scanner, which <br>*does* know how to hand= le preprocessor instructions of this sort.=C2=A0 It's <br>still a bit o= f a work in progress (there are some questions about <br>recursion, in part= icular), which is why it's not the default.=C2=A0 Were you <br>able to = try that out?<br><br></div></div>__________________________________________= _____<br> Scons-users mailing list<br> <a href=3D"mailto:[email protected]" target=3D"_blank">Scons-users@scon= s.org</a><br> <a href=3D"https://pairlist4.pair.net/mailman/listinfo/scons-users" rel=3D"= noreferrer" target=3D"_blank">https://pairlist4.pair.net/mailman/listinfo/s= cons-users</a><br> </blockquote></div> --0000000000007143330636eb32b7-- --===============3579940940300684283== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Scons-users mailing list [email protected] https://pairlist4.pair.net/mailman/listinfo/scons-users --===============3579940940300684283==--