Bug 1323901 - Hardcode rustc.exe and cargo.exe for detection on Windows. r?glandium draft
authorXidorn Quan <me@upsuper.org>
Thu, 22 Dec 2016 21:21:47 +1100
changeset 452817 76f62bc7460261803d6987710f2b8e47440f9878
parent 450886 c4b4ce977fa19c7cfd9811225ae459855ed5b6d1
child 540320 88c8447845ea6daf3089eb87b418fc0010ec594a
push id39509
push userxquan@mozilla.com
push dateThu, 22 Dec 2016 10:22:26 +0000
reviewersglandium
bugs1323901
milestone53.0a1
Bug 1323901 - Hardcode rustc.exe and cargo.exe for detection on Windows. r?glandium MozReview-Commit-ID: IfJ7lX4Nkt8
build/moz.configure/rust.configure
--- a/build/moz.configure/rust.configure
+++ b/build/moz.configure/rust.configure
@@ -2,23 +2,29 @@
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 option('--disable-rust', help='Don\'t include Rust language sources')
 
 @depends('--enable-rust')
+@imports('platform')
 def rust_compiler_names(value):
     if value:
+        if platform.system() == 'Windows':
+            return ['rustc.exe']
         return ['rustc']
 
 @depends('--enable-rust')
+@imports('platform')
 def cargo_binary_names(value):
     if value:
+        if platform.system() == 'Windows':
+            return ['cargo.exe']
         return ['cargo']
 
 rustc = check_prog('RUSTC', rust_compiler_names, allow_missing=True)
 cargo = check_prog('CARGO', cargo_binary_names, allow_missing=True)
 
 @depends_if(rustc)
 @checking('rustc version', lambda info: info.version)
 def rustc_info(rustc):