{"id":3275,"date":"2014-05-08T09:36:24","date_gmt":"2014-05-08T07:36:24","guid":{"rendered":"http:\/\/glandium.org\/blog\/?p=3275"},"modified":"2019-09-03T15:26:16","modified_gmt":"2019-09-03T06:26:16","slug":"faster-compilations-for-everyone","status":"publish","type":"post","link":"https:\/\/glandium.org\/blog\/?p=3275","title":{"rendered":"Faster compilations for everyone?"},"content":{"rendered":"<p>If you're following this blog, you may be aware of the recent work on <a href=\"\/blog\/?p=3054\">shared compilation cache<\/a>. This has been deployed with great results on Mozilla's try server for all platforms (except a few build types, like ASAN or valgrind), and is being tested for Linux\/Android builds on b2g-inbound (more on that in subsequent posts).<\/p>\n<p>A side effect of the work to make it run on all platforms is that it now works to build Firefox on Windows, although it requires a specific setup. And since recently, it's also possible to use it with local storage instead of S3. This means we now have a (basic) ccache for Windows that works to build Firefox.<\/p>\n<p>If you wish to try it, here is what you need to do:<\/p>\n<ul>\n<li>Clone the repository from github:<br \/>\n<blockquote><p><code>$ git clone <a href=\"https:\/\/github.com\/glandium\/sccache\">https:\/\/github.com\/glandium\/sccache<\/a><\/code><\/p><\/blockquote>\n<\/li>\n<li>Add the following to your <code>mozconfig<\/code>:<br \/>\n<blockquote><p><code>ac_add_options \"--with-compiler-wrapper=python2.7 <i>path\/to\/<\/i>sccache\/sccache.py\"<br \/>\nexport _DEPEND_CFLAGS='-deps$(MDDEPDIR)\/$(@F).pp'<br \/>\nmk_add_options \"export CC_WRAPPER=\"<br \/>\nmk_add_options \"export CXX_WRAPPER=\"<br \/>\nmk_add_options \"export COMPILE_PDB_FLAG=\"<br \/>\nmk_add_options \"export HOST_PDB_FLAG=\"<br \/>\nmk_add_options \"export MOZ_DEBUG_FLAGS=-Z7\"<br \/>\n<\/code><\/p><\/blockquote>\n<p><b>Update:<\/b> Currently, <code><i>path\/to\/<\/i>sccache\/sccache.py<\/code> needs to be a windows-like path (as opposed to msys\/cygwin path) with forward slashes.\n<\/li>\n<li>Then set the <code>SCCACHE_DIR<\/code> environment variable to some local directory.<\/li>\n<li>And build happily.<\/li>\n<\/ul>\n<p>A few things to note:<\/p>\n<ul>\n<li>As of writing, sccache doesn't support cleaning up the storage directory, so it will grow indefinitely (until you clean it up yourself).<\/li>\n<li>Because the MSVC preprocessor is not exactly fast, and because sccache doesn't have a direct mode like ccache, it doesn't make as much difference as ccache does.<\/li>\n<li>It also works on non-windows, but doesn't require all the <code>mozconfig<\/code> changes, except for the <code>--with-compiler-wrapper<\/code> line.<\/li>\n<\/ul>\n<p>Play with it and feel free to fork it on github, and improve it. Pull requests encouraged.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you&#8217;re following this blog, you may be aware of the recent work on shared compilation cache. This has been deployed with great results on Mozilla&#8217;s try server for all platforms (except a few build types, like ASAN or valgrind), and is being tested for Linux\/Android builds on b2g-inbound (more on that in subsequent posts). [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[23],"class_list":["post-3275","post","type-post","status-publish","format-standard","hentry","category-planet-mozilla","tag-en"],"_links":{"self":[{"href":"https:\/\/glandium.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3275","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/glandium.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/glandium.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/glandium.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/glandium.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3275"}],"version-history":[{"count":10,"href":"https:\/\/glandium.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3275\/revisions"}],"predecessor-version":[{"id":3285,"href":"https:\/\/glandium.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3275\/revisions\/3285"}],"wp:attachment":[{"href":"https:\/\/glandium.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3275"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/glandium.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3275"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/glandium.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3275"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}