servo: Merge #10527 - Work around a Mako bug on Windows (from servo:cr); r=larsbergstrom
authorSimon Sapin <simon.sapin@exyr.org>
Tue, 12 Apr 2016 06:43:52 +0500
changeset 338483 2cfac39666687859db617ca4cf9e217de322f001
parent 338482 617f797316375095e9cfc79b7acb4722993a6e9c
child 338484 f9dd243afa2d1827045b562026df3c66ea680708
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)
reviewerslarsbergstrom
servo: Merge #10527 - Work around a Mako bug on Windows (from servo:cr); r=larsbergstrom http://logs.glob.uno/?c=mozilla%23servo#c403766 https://i.imgur.com/j5Zv4LX.png https://bitbucket.org/zzzeek/mako/issues/150/line-ending-handling-broken-on-win32 r? @larsbergstrom Source-Repo: https://github.com/servo/servo Source-Revision: 11927da1659baec54102fa4609001f073216d7b3
servo/components/style/build.rs
--- a/servo/components/style/build.rs
+++ b/servo/components/style/build.rs
@@ -45,18 +45,18 @@ fn main() {
         .env("PRODUCT", product)
         .arg("-c")
         .arg(r#"
 import os
 import sys
 from mako.template import Template
 from mako import exceptions
 try:
-    print(Template(filename=os.environ['TEMPLATE'], input_encoding='utf8').render(PRODUCT=os.environ['PRODUCT'])
-                                                                          .encode('utf8'))
+    template = Template(open(os.environ['TEMPLATE'], 'rb').read(), input_encoding='utf8')
+    print(template.render(PRODUCT=os.environ['PRODUCT']).encode('utf8'))
 except:
     sys.stderr.write(exceptions.text_error_template().render().encode('utf8'))
     sys.exit(1)
 "#)
         .stderr(Stdio::inherit())
         .output()
         .unwrap();
     if !result.status.success() {