<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;
      charset=windows-1252">
  </head>
  <body>
    <p>One bit of warning, build trees tend to have relative paths baked
      in.  From experience, trying to copy an llvm build tree from one
      location to another tends to not work well.</p>
    <p>The best workaround I've seen for this type of thing is to use
      docker (or your container format of choice) to construct a "build
      image" with the full source and build trees, then update the
      source and trigger an (incremental) build.</p>
    <p>After that's out of the way, you run into two major problems
      quickly.</p>
    <p>1) Such build images tend to be gigantic.  (50+gb)  Bandwidth
      costs, storage costs, and download times add up *quickly*.  <br>
      2) Their value as incremental build sources tend to age very
      quickly.  If you look at the commits to llvm, core headers get
      changed shocking often.  As such, if you're trying to follow ToT
      you quickly end up doing what is effectively a clean build
      anyways.  The only workflow which "somewhat works" is to develop
      against some recent snapshot, then rebase only at the very last
      and pay the cost of a full build.</p>
    <p>I've played enough with ideas like this in the past to recommend
      you not go down this path.</p>
    <p>An alternate approach I recommend - and use personally - is to do
      all builds on an AWS instance.  With some basic scripting (<a
        moz-do-not-send="true"
        href="https://github.com/preames/llvm-aws-builder">here's mine</a>),
      you can do fast builds for a couple of dollars a day.  I've been
      working this was for about 6 months, and have found it
      dramatically easier than all the options I played with before.  <br>
    </p>
    <p>Philip<br>
    </p>
    <div class="moz-cite-prefix">On 4/14/21 1:53 PM, Alexandre Ganea via
      llvm-dev wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:DM6PR17MB38668E6DB0FB65E9E34E2B3AEB4E9@DM6PR17MB3866.namprd17.prod.outlook.com">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <style>@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;}@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}pre
        {mso-style-priority:99;
        mso-style-link:"Préformaté HTML Car";
        margin:0cm;
        font-size:10.0pt;
        font-family:"Courier New";
        mso-fareast-language:EN-GB;}p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}span.PrformatHTMLCar
        {mso-style-name:"Préformaté HTML Car";
        mso-style-priority:99;
        mso-style-link:"Préformaté HTML";
        font-family:Consolas;
        mso-fareast-language:EN-US;}span.EmailStyle26
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}div.WordSection1
        {page:WordSection1;}ol
        {margin-bottom:0cm;}ul
        {margin-bottom:0cm;}</style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal">That’s an interesting idea. There are
          several issues to consider:<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <ol style="margin-top:0cm" type="a" start="1">
          <li class="MsoListParagraph"
            style="margin-left:0cm;mso-list:l1 level1 lfo2">The build
            needs to be deterministic, if we want to share .OBJ files
            among LLVM developers. In essence, that means fully
            implementing [1]. I’m not sure how much of the LLVM codebase
            supports that.<br>
            Just the toolchain part is challenging to implement. We
            would need to ensure all users are using precisely the same
            compiler, the same linker, same cmake, same platform SDKs,
            etc. in order to expect good cache hits.<o:p></o:p></li>
          <li class="MsoListParagraph"
            style="margin-left:0cm;mso-list:l1 level1 lfo2">There’s the
            security consideration. If anyone is to pull on the cached
            .OBJ files, you need to “trust” these .OBJ files in the
            first place. That means maybe restraining the list of cache
            “publishers” to the LLVM github group, and signing the .OBJs
            with a private key or something along those lines.<o:p></o:p></li>
          <li class="MsoListParagraph"
            style="margin-left:0cm;mso-list:l1 level1 lfo2">There’s a
            file size consideration. My build folder for only { llvm,
            clang, lld } is about 40 GB. When using the ThinLTO cache,
            that goes over 100 GB. Still, build artefacts compress quite
            well (3:1 at least), and you’d probably pay the network
            price only once, then cache hits would be incremental.<o:p></o:p></li>
        </ol>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">I think the same idea could apply for
          distributing the compilation. It’d be interesting to have a
          public LLVM distributed compilation service. But how can we
          trust it? Even if we only compile on “trusted” machines,
          there’s still a risk of attack. That’s probably why these
          caching/remote compilation systems are only used inside an
          organization, which can guarantee trust (somehow). Since
          you’re at Sony, perhaps you have access to a internal SN-DBS
          pool? [2]<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">[1] <a
href="https://blog.llvm.org/2019/11/deterministic-builds-with-clang-and-lld.html"
            moz-do-not-send="true">
https://blog.llvm.org/2019/11/deterministic-builds-with-clang-and-lld.html</a><o:p></o:p></p>
        <p class="MsoNormal">[2] <span lang="FR-CA"><a
href="https://www.snsystems.com/tech-blog/2014/01/06/building-with-the-network/"
              moz-do-not-send="true"><span lang="EN-CA">https://www.snsystems.com/tech-blog/2014/01/06/building-with-the-network/</span></a></span><o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <div>
          <div style="border:none;border-top:solid #E1E1E1
            1.0pt;padding:3.0pt 0cm 0cm 0cm">
            <p class="MsoNormal"><b><span
                  style="mso-fareast-language:EN-CA" lang="FR">De :</span></b><span
                style="mso-fareast-language:EN-CA" lang="FR"> llvm-dev
                <a class="moz-txt-link-rfc2396E" href="mailto:llvm-dev-bounces@lists.llvm.org"><llvm-dev-bounces@lists.llvm.org></a>
                <b>De la part de</b> via llvm-dev<br>
                <b>Envoyé :</b> April 14, 2021 3:31 PM<br>
                <b>À :</b> <a class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
                <b>Objet :</b> Re: [llvm-dev] Consider making build
                directories of the buildbots available<o:p></o:p></span></p>
          </div>
        </div>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal"><span lang="EN-GB">Ah, apologies,  I think
            I wasn’t clear. I am talking about making object files
            available in this manner so that people can download them
            and compile just their changes without having to compile all
            of LLVM, thus reducing the barrier to entry. As far as I am
            aware, the releases on Github do not contain object files.<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span lang="EN-GB">Nabeel Omer<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
        <div>
          <div style="border:none;border-top:solid #E1E1E1
            1.0pt;padding:3.0pt 0cm 0cm 0cm">
            <p class="MsoNormal"><b><span
                  style="mso-fareast-language:EN-GB" lang="EN-US">From:</span></b><span
                style="mso-fareast-language:EN-GB" lang="EN-US">
                llvm-dev <<a
                  href="mailto:llvm-dev-bounces@lists.llvm.org"
                  moz-do-not-send="true">llvm-dev-bounces@lists.llvm.org</a>>
                <b>On Behalf Of </b>Neil Nelson via llvm-dev<br>
                <b>Sent:</b> 14 April 2021 20:05<br>
                <b>To:</b> <a href="mailto:llvm-dev@lists.llvm.org"
                  moz-do-not-send="true">llvm-dev@lists.llvm.org</a><br>
                <b>Subject:</b> Re: [llvm-dev] Consider making build
                directories of the buildbots available<o:p></o:p></span></p>
          </div>
        </div>
        <p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
        <p><span style="font-size:10.0pt" lang="EN-GB">Perhaps these
            pages may help.</span><span
            style="mso-fareast-language:EN-GB" lang="EN-GB"><o:p></o:p></span></p>
        <p><span style="font-size:10.0pt" lang="EN-GB"><a
              href="https://github.com/llvm/llvm-project/releases"
              moz-do-not-send="true">https://github.com/llvm/llvm-project/releases</a></span><span
            lang="EN-GB"><o:p></o:p></span></p>
        <p><span style="font-size:10.0pt" lang="EN-GB"><a
href="https://github.com/llvm/llvm-project/releases/tag/llvmorg-12.0.0-rc5"
              moz-do-not-send="true">https://github.com/llvm/llvm-project/releases/tag/llvmorg-12.0.0-rc5</a></span><span
            lang="EN-GB"><o:p></o:p></span></p>
        <p><span style="font-size:10.0pt" lang="EN-GB">Neil Nelson</span><span
            lang="EN-GB"><o:p></o:p></span></p>
        <div>
          <p class="MsoNormal"><span style="font-size:10.0pt"
              lang="EN-GB">On 4/14/21 12:53 PM, via llvm-dev wrote:</span><span
              lang="EN-GB"><o:p></o:p></span></p>
        </div>
        <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
          <p class="MsoNormal"><span lang="EN-GB">Hi LLVM devs,<o:p></o:p></span></p>
          <p class="MsoNormal"><span lang="EN-GB"> <o:p></o:p></span></p>
          <p class="MsoNormal"><span lang="EN-GB">As you are already
              aware, performing a clean build of LLVM requires
              considerable computing resources. This presents a barrier
              to entry for people who do not have access to large
              computers. Since the
            </span><span lang="EN-US">buildbots already regularly
              compile the LLVM codebase, making tarballs of their build
              directories available on a public facing server will
              dramatically reduce the barrier to entry. Is this
              something that the community is willing to consider?</span><span
              lang="EN-GB"><o:p></o:p></span></p>
          <p class="MsoNormal"><span lang="EN-US"> </span><span
              lang="EN-GB"><o:p></o:p></span></p>
          <p class="MsoNormal"><span lang="EN-US">Thanks,</span><span
              lang="EN-GB"><o:p></o:p></span></p>
          <p class="MsoNormal"><span lang="EN-US">Nabeel Omer</span><span
              lang="EN-GB"><o:p></o:p></span></p>
          <p class="MsoNormal" style="margin-bottom:12.0pt"><span
              style="mso-fareast-language:EN-GB" lang="EN-GB"><o:p> </o:p></span></p>
          <pre><span lang="EN-GB">_______________________________________________<o:p></o:p></span></pre>
          <pre><span lang="EN-GB">LLVM Developers mailing list<o:p></o:p></span></pre>
          <pre><span lang="EN-GB"><a href="mailto:llvm-dev@lists.llvm.org" moz-do-not-send="true">llvm-dev@lists.llvm.org</a><o:p></o:p></span></pre>
          <pre><span lang="EN-GB"><a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" moz-do-not-send="true">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><o:p></o:p></span></pre>
        </blockquote>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre>
    </blockquote>
  </body>
</html>