servo: Merge #16338 - Disable bytecode generation in mach (from Wafflespeanut:byte); r=jdm
authorRavi Shankar <>
Mon, 10 Apr 2017 17:53:37 -0500
changeset 560247 88e9938ce64ca0281c4f6ed2dd8ca93a0bfe5100
parent 560246 92fb427b464c49134341747d146ddef6f43c87b4
child 560248 4e4bd12cc11cab7e9227bd240424311d4acf596a
push id53365
push dateTue, 11 Apr 2017 08:35:12 +0000
servo: Merge #16338 - Disable bytecode generation in mach (from Wafflespeanut:byte); r=jdm Recently, [@]froydnj had some trouble with `mach`, and after half an hour of struggle, a simple `git clean` and `git reset --hard` seemed to fix the issue. Apparently, sometimes (though I'm not sure when, and I don't even have a convincing argument), the changes to `mach` scripts don't really seem to reflect on the related bytecode files (when it absolutely should've!). Having bytecode files is just a matter of optimization (i.e., we don't have to compile the scripts again), but when it comes to our simple build system, "not having them" doesn't add a great overhead. So, we could just disable their creation to avoid such issues in the future. Existing users can do `find ./python -name '*.pyc' -delete` for a cleanup (and maybe remove the `python/_virtualenv` directory too, though not necessary) Source-Repo: Source-Revision: ca3cd64d6b1999292d634bfa237c2705e6d575c1
--- a/servo/mach
+++ b/servo/mach
@@ -20,16 +20,17 @@ def main(args):
     topdir = os.path.abspath(os.path.dirname(sys.argv[0]))
     sys.path.insert(0, os.path.join(topdir, "python"))
     import mach_bootstrap
     mach = mach_bootstrap.bootstrap(topdir)
 if __name__ == '__main__':
+    sys.dont_write_bytecode = True
     if sys.platform == 'win32':
         # This is a complete hack to work around the fact that Windows
         # multiprocessing needs to import the original module (ie: this
         # file), but only works if it has a .py extension.
         # We do this by a sort of two-level function interposing. The first
         # level interposes forking.get_command_line() with our version defined
         # in my_get_command_line(). Our version of get_command_line will