{"id":282,"date":"2019-02-04T19:50:41","date_gmt":"2019-02-04T17:50:41","guid":{"rendered":"https:\/\/www.gijsk.com\/blog\/?p=282"},"modified":"2019-02-04T20:30:01","modified_gmt":"2019-02-04T18:30:01","slug":"getting-firefox-artifact-builds-working-on-an-arm64-aarch64-windows-device","status":"publish","type":"post","link":"https:\/\/www.gijsk.com\/blog\/2019\/02\/getting-firefox-artifact-builds-working-on-an-arm64-aarch64-windows-device\/","title":{"rendered":"Getting Firefox artifact builds working on an arm64\/aarch64 windows device"},"content":{"rendered":"\n<p>If, like me, you&#8217;re debugging a frontend issue and you think &#8220;I can just create some artifact builds on this device&#8221; &#8212; you might run in to a few issues. In the main, they&#8217;re caused by various bits of the build system attempting to use 64-bit x86 binaries. arm64 can run 32-bit x86 code under emulation, but not 64-bit. Here are the issues I encountered, chronologically.<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>The latest mozilla-build doesn&#8217;t work, because it only supplies 64-bit tools. Using <a href=\"https:\/\/ftp.mozilla.org\/pub\/mozilla\/libraries\/win32\/\">an older version (2.2)<\/a> does work.<ol><li><strong>Note: <\/strong>Obviously this comes with older software. <strong>You should update<\/strong> pip and mercurial (using pip). I&#8217;d recommend not using the old software to connect to anything you don&#8217;t trust, no warranty, etc. etc.<\/li><\/ol><\/li><li>You can now <code>hg clone mozilla-central<\/code>. It&#8217;ll take a while. You can also use pip to install\/run other useful things, like mozregression (which seems to work but chokes when trying to kill off and delete Firefox processes when done; unsure why).<\/li><li>Running <code>.\/mach bootstrap<\/code> mostly works if you pick artifact builds, but: <ol><li>It tries to <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=1525041\">install 64-bit x86 rustup<\/a>, which doesn&#8217;t work (this bug should be fixed soon). Commenting out <a href=\"https:\/\/searchfox.org\/mozilla-central\/rev\/152993fa346c8fd9296e4cd6622234a664f53341\/python\/mozboot\/mozboot\/bootstrap.py#444\">this line<\/a> makes things work.<\/li><li>It <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=1525069\">installs a 64-bit version of NodeJS<\/a>, which also won&#8217;t work. You&#8217;ll want to remove <code>~\/.mozbuild\/node<\/code>, download the 32-bit windows .zip from <a href=\"https:\/\/nodejs.org\/en\/download\/\">the NodeJS website<\/a> and extract the contents at <code>~\/.mozbuild\/node<\/code> to placate it.<\/li><\/ol><\/li><li>If you now try to build, configure will choke on the lack of python3. This isn&#8217;t part of the old mozillabuild package, and so you want to download the latest python3 version as an &#8220;embeddable zip file&#8221; version off <a href=\"https:\/\/www.python.org\/downloads\/windows\/\">the python website<\/a> , and extract it to <code>path\/to\/mozilla-build\/python3<\/code> . Then you will also want to make a copy of <code>python.exe<\/code> in that directory available as <code>python3.exe<\/code>, <a href=\"https:\/\/searchfox.org\/mozilla-central\/rev\/152993fa346c8fd9296e4cd6622234a664f53341\/build\/moz.configure\/init.configure#406\">because that&#8217;s the path mozilla-build expects<\/a>.<\/li><li>Next, configure will choke on the 64-bit version of <code>watchman.exe<\/code> that mozilla-build has helpfully provided. Rename the watchman directory inside mozilla-build (or delete it if you&#8217;re feeling vengeful) to deal with this.<\/li><\/ol>\n\n\n\n<p>That&#8217;s it! Now artifact builds should work &#8211; or at least, they did for me. Some of the issues are caused by bootstrap, and thus fixable, but obviously we can&#8217;t retrospectively change an old copy of mozilla-build. I&#8217;ve filed a bug to <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=1525066\">provide mozilla-build for aarch64<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If, like me, you&#8217;re debugging a frontend issue and you think &#8220;I can just create some artifact builds on this device&#8221; &#8212; you might run in to a few issues. In the main, they&#8217;re caused by various bits of the &hellip; <a href=\"https:\/\/www.gijsk.com\/blog\/2019\/02\/getting-firefox-artifact-builds-working-on-an-arm64-aarch64-windows-device\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-282","post","type-post","status-publish","format-standard","hentry","category-mozilla"],"_links":{"self":[{"href":"https:\/\/www.gijsk.com\/blog\/wp-json\/wp\/v2\/posts\/282"}],"collection":[{"href":"https:\/\/www.gijsk.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gijsk.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gijsk.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gijsk.com\/blog\/wp-json\/wp\/v2\/comments?post=282"}],"version-history":[{"count":3,"href":"https:\/\/www.gijsk.com\/blog\/wp-json\/wp\/v2\/posts\/282\/revisions"}],"predecessor-version":[{"id":285,"href":"https:\/\/www.gijsk.com\/blog\/wp-json\/wp\/v2\/posts\/282\/revisions\/285"}],"wp:attachment":[{"href":"https:\/\/www.gijsk.com\/blog\/wp-json\/wp\/v2\/media?parent=282"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gijsk.com\/blog\/wp-json\/wp\/v2\/categories?post=282"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gijsk.com\/blog\/wp-json\/wp\/v2\/tags?post=282"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}