<div dir="ltr">On Tue, Jul 11, 2017 at 9:48 AM, Xidorn Quan <span dir="ltr"><<a href="mailto:me@upsuper.org" target="_blank">me@upsuper.org</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">




<div><span class="gmail-m_3512046881253100921gmail-"></span>Tooling around debug info in Rust code still isn't great.<br>
</div></blockquote><div><br></div><div>The good news is that tooling issues are generally among the easier ones to solve. Even the existing Rust code that is present in Firefox will require at least some of these things to be fixed.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>
<div>The first thing comes to my mind is crash reports. It currently 
doesn't always include useful panic message from Rust, see for example 
[1] and [2]. </div></div></blockquote><div><br></div><div>I filed <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1379857">https://bugzilla.mozilla.org/show_bug.cgi?id=1379857</a> for this. It's blocking <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1348896">https://bugzilla.mozilla.org/show_bug.cgi?id=1348896</a>, which is the Rust crash tracking bug.<br></div><div><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>

<div>For that, I just did an experiment. In my local repo, when I remove
 all linking-related files from objdir/toolkit/library (to do a fresh 
linking), it takes ~1.7min for linking.<br></div>
<div><br></div>
<div>When I touch one cpp file (in my experiment, 
layout/style/nsCSSAnonBoxes.cp<wbr>p which is a reasonable small cpp file I 
happen to open), it takes 6s to link, and size of xul.ilk (Incremental 
Linker File) increases by 856KB.<br></div>
<div><br></div>
<div>When I touch one rs file (in my experiment, 
servo/components/gecko_binding<wbr>s/sugar/<a href="http://style_complex_color.rs" target="_blank">style_complex_color.rs</a> which is a 
reasonable small rs file I happen to be familiar with), it takes ~2min 
to link (even longer than the fresh linking!) in addition to the compile
 time, and size of xul.ilk increases by 27.44MB. And after that, when I 
touch that cpp file again, it takes ~2.1min to link and size of xul.ilk 
increases by 54.64MB this time.<br></div>
<div><br></div>
<div>I suspect the more times you touch rs files, the longer linking 
would take, and I guess this is because we link all Rust code into a 
single library, and then static link it into xul.dll, which makes the 
linker do lots of wasteful work. There could also be some linker bug 
involves, though.<br></div>
<div><br></div>
<div>To mitigate this, we can probably avoid incremental linking when 
Rust code is touched. I also wonder if it is possible to avoid linking 
the whole gkrust into xul.dll at all and see if that makes things 
better. It would also be good to see if Rust developers have any advice 
for this situation.<span class="gmail-m_3512046881253100921gmail-HOEnZb"><font color="#888888"><br></font></span></div><span class="gmail-m_3512046881253100921gmail-HOEnZb"><font color="#888888">



</font></span></div>

</blockquote></div></div><div class="gmail_extra"><br></div><div class="gmail_extra">Would you mind filing a bug report for this issue?<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">I've posted a link to this thread on the Rust Internals board: <a href="https://internals.rust-lang.org/t/dev-platform-discussion-on-getting-more-rust-code-into-firefox/5523" target="_blank">https://internals.rust-lang.<wbr>org/t/dev-platform-discussion-<wbr>on-getting-more-rust-code-<wbr>into-firefox/5523</a></div><div class="gmail_extra"><br></div><div class="gmail_extra">Nick<br></div></div>