servo: Merge #12377 - Build geckolib with MozillaBuild on Windows (from upsuper:build-with-mozillabuild); r=metajack
authorXidorn Quan <me@upsuper.org>
Mon, 11 Jul 2016 10:37:16 -0700
changeset 339269 ea54ae986cb86c44fc02dbc58989b94e21d41500
parent 339268 17b8ffb25298fec85449c5433b29ca47952b24af
child 339270 f87b778a0ab81a8922ae097af97b679932698b6d
push id31307
push usergszorc@mozilla.com
push dateSat, 04 Feb 2017 00:59:06 +0000
treeherdermozilla-central@94079d43835f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmetajack
servo: Merge #12377 - Build geckolib with MozillaBuild on Windows (from upsuper:build-with-mozillabuild); r=metajack <!-- Please describe your changes on the following line: --> Given #12319 removes the direct dependency of geckolib to gcc, geckolib is now compilable without gcc, and thus builds within MozillaBuild. This changeset also changes the triple to use the MSVC backend rather than GNU for Windows . I'm not sure whether this change is necessary, but given we use MSVC to compile Gecko on Windows, I think we would eventually need this anyway. Triples for MinGW64 and Cygwin are unchanged, so that existing build targets should not be broken. Servo itself is still not buildable with MozillaBuild. To make that work, some changes to mozjs are necessary as well. It is probably worth some infra coverage to avoid regression. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors (on MinGW) - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [x] These changes do not require tests because it only changes build system <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> r? @bholley Source-Repo: https://github.com/servo/servo Source-Revision: 184b1ba91b5e73d4bbeacc9093f31f4c8570c0f4
servo/python/servo/build_commands.py
servo/python/servo/command_base.py
--- a/servo/python/servo/build_commands.py
+++ b/servo/python/servo/build_commands.py
@@ -327,17 +327,17 @@ class MachCommands(CommandBase):
         if jobs is not None:
             opts += ["-j", jobs]
         if verbose:
             opts += ["-v"]
         if release:
             opts += ["--release"]
 
         env = self.build_env()
-        env["CARGO_TARGET_DIR"] = path.join(self.context.topdir, "target", "geckolib")
+        env["CARGO_TARGET_DIR"] = path.join(self.context.topdir, "target", "geckolib").encode("UTF-8")
 
         build_start = time()
         with cd(path.join("ports", "geckolib")):
             ret = call(["cargo", "build"] + opts, env=env, verbose=verbose)
         elapsed = time() - build_start
 
         # Generate Desktop Notification if elapsed-time > some threshold value
         notify_build_done(elapsed)
--- a/servo/python/servo/command_base.py
+++ b/servo/python/servo/command_base.py
@@ -36,17 +36,19 @@ def cd(new_path):
 def host_triple():
     os_type = platform.system().lower()
     if os_type == "linux":
         os_type = "unknown-linux-gnu"
     elif os_type == "darwin":
         os_type = "apple-darwin"
     elif os_type == "android":
         os_type = "linux-androideabi"
-    elif os_type == "windows" or os_type.startswith("mingw64_nt-") or os_type.startswith("cygwin_nt-"):
+    elif os_type == "windows":
+        os_type = "pc-windows-msvc"
+    elif os_type.startswith("mingw64_nt-") or os_type.startswith("cygwin_nt-"):
         os_type = "pc-windows-gnu"
     elif os_type == "freebsd":
         os_type = "unknown-freebsd"
     else:
         os_type = "unknown"
 
     cpu_type = platform.machine().lower()
     if cpu_type in ["i386", "i486", "i686", "i768", "x86"]: