servo: Merge #14346 - Use MSVC toolchain if PLATFORM is defined (from mati865:master); r=UK992,larsberg
authormati865 <mati865@gmail.com>
Wed, 28 Dec 2016 07:37:45 -0800
changeset 340436 e084e535672be236f45471143ccfceac54d969ec
parent 340435 83bb24b47d8a4ba9951601c2c0be17d0f229ed67
child 340437 81ac49a1c7726d97905660ab43a74114c48d9a3c
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)
reviewersUK992, larsberg
servo: Merge #14346 - Use MSVC toolchain if PLATFORM is defined (from mati865:master); r=UK992,larsberg <!-- Please describe your changes on the following line: --> `VSInstallDir` exists only when Visual Studio is installed. `VS140COMNTOOLS` is defined by installing either Visual Studio or [Visual C++ Build Tools](http://landinghub.visualstudio.com/visual-cpp-build-tools) It will allow to build MSVC based Servo without having to install whole Visual Studio (few GiB). EDIT: Another (maybe cleaner) solution would be reverting https://github.com/servo/servo/commit/63ec96a57d4772a961bea63111c927ccd7c85a91 --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [ ] `./mach build -d` does not report any errors - [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 `VS140COMNTOOLS` variable is already used in [mach.bat](https://github.com/servo/servo/blob/master/mach.bat) <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: 7f2da7483b2d0c71a227fb8707eea00b0602d977
servo/appveyor.yml
servo/python/servo/command_base.py
--- a/servo/appveyor.yml
+++ b/servo/appveyor.yml
@@ -30,19 +30,16 @@ environment:
   matrix:
   - TARGET: nightly-x86_64-pc-windows-msvc
   - TARGET: nightly-x86_64-pc-windows-gnu
 
 branches:
   only:
     - master
 
-platform:
-  - x64
-
 cache:
   - .servo -> rust-nightly-date, cargo-commit-hash
   - .cargo -> rust-nightly-date, cargo-commit-hash
 
 install:
   - if %TARGET:*-msvc=msvc%==msvc set BUILD_ENV=msvc
   - if %TARGET:*-gnu=gnu%==gnu set BUILD_ENV=gnu
   - if %BUILD_ENV%==gnu  set PATH=C:\msys64\mingw64\bin;C:\msys64\usr\bin\;%PATH%
--- a/servo/python/servo/command_base.py
+++ b/servo/python/servo/command_base.py
@@ -105,20 +105,22 @@ def host_triple():
     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":
         # If we are in a Visual Studio environment, use msvc
-        if os.getenv("VSInstallDir") is not None:
+        if os.getenv("PLATFORM") is not None:
             os_type = "pc-windows-msvc"
+        elif os.getenv("MSYSTEM") is not None:
+            os_type = "pc-windows-gnu"
         else:
-            os_type = "pc-windows-gnu"
+            os_type = "unknown"
     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()