[zorg] r345415 - Revert "[buildbot, windows] Update the way the visual studio environment is set"

Stella Stamenova via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 26 11:17:50 PDT 2018


Author: stella.stamenova
Date: Fri Oct 26 11:17:50 2018
New Revision: 345415

URL: http://llvm.org/viewvc/llvm-project?rev=345415&view=rev
Log:
Revert "[buildbot, windows] Update the way the visual studio environment is set"

This reverts commit 61f2e26b7a4483c31547960691cb1c6b22266407.

Modified:
    zorg/trunk/buildbot/osuosl/master/config/builders.py
    zorg/trunk/zorg/buildbot/builders/ClangBuilder.py
    zorg/trunk/zorg/buildbot/builders/LLDBBuilder.py
    zorg/trunk/zorg/buildbot/builders/LLDBuilder.py
    zorg/trunk/zorg/buildbot/builders/SanitizerBuilderWindows.py
    zorg/trunk/zorg/buildbot/builders/UnifiedTreeBuilder.py
    zorg/trunk/zorg/buildbot/builders/Util.py

Modified: zorg/trunk/buildbot/osuosl/master/config/builders.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/buildbot/osuosl/master/config/builders.py?rev=345415&r1=345414&r2=345415&view=diff
==============================================================================
--- zorg/trunk/buildbot/osuosl/master/config/builders.py (original)
+++ zorg/trunk/buildbot/osuosl/master/config/builders.py Fri Oct 26 11:17:50 2018
@@ -994,7 +994,6 @@ def _get_lldb_builders():
          'factory': LLDBBuilder.getLLDBWindowsCMakeBuildFactory(
                     clean=True,
                     python_source_dir=r'"C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64"',
-                    autodetectVS=True,
                     target_arch='x64',
                     test=True,
                     extra_cmake_args=['-DLLVM_ENABLE_ASSERTIONS=OFF'])}

Modified: zorg/trunk/zorg/buildbot/builders/ClangBuilder.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/builders/ClangBuilder.py?rev=345415&r1=345414&r2=345415&view=diff
==============================================================================
--- zorg/trunk/zorg/buildbot/builders/ClangBuilder.py (original)
+++ zorg/trunk/zorg/buildbot/builders/ClangBuilder.py Fri Oct 26 11:17:50 2018
@@ -461,7 +461,6 @@ def getClangCMakeGCSBuildFactory(
             # %VS120COMNTOOLS% selects the 2013 toolchain.
             vs=None,
             vs_target_arch='x86',
-            autodetectVS=False,
 
             # Multi-stage compilation
             useTwoStage=False,
@@ -497,9 +496,8 @@ def getClangCMakeGCSBuildFactory(
             # Triggers
             trigger_after_stage1=[]):
     return _getClangCMakeBuildFactory(
-               clean=clean, test=test, cmake=cmake, jobs=jobs,
-               vs=vs, vs_target_arch=vs_target_arch, autodetectVS=autodetectVS,
-               useTwoStage=useTwoStage,
+               clean=clean, test=test, cmake=cmake, jobs=jobs, vs=vs,
+               vs_target_arch=vs_target_arch, useTwoStage=useTwoStage,
                testStage1=testStage1, stage1_config=stage1_config,
                stage2_config=stage2_config, runTestSuite=runTestSuite,
                nt_flags=nt_flags, testsuite_flags=testsuite_flags,
@@ -524,7 +522,6 @@ def getClangCMakeBuildFactory(
             # %VS120COMNTOOLS% selects the 2013 toolchain.
             vs=None,
             vs_target_arch='x86',
-            autodetectVS=False,
 
             # Multi-stage compilation
             useTwoStage=False,
@@ -550,9 +547,8 @@ def getClangCMakeBuildFactory(
             checkout_libcxx=False,
             checkout_test_suite=False):
     return _getClangCMakeBuildFactory(
-               clean=clean, test=test, cmake=cmake, jobs=jobs,
-               vs=vs, vs_target_arch=vs_target_arch, autodetectVS=autodetectVS,
-               useTwoStage=useTwoStage,
+               clean=clean, test=test, cmake=cmake, jobs=jobs, vs=vs,
+               vs_target_arch=vs_target_arch, useTwoStage=useTwoStage,
                testStage1=testStage1, stage1_config=stage1_config,
                stage2_config=stage2_config, runTestSuite=runTestSuite,
                nt_flags=nt_flags, testsuite_flags=testsuite_flags,
@@ -574,7 +570,6 @@ def _getClangCMakeBuildFactory(
             # %VS120COMNTOOLS% selects the 2013 toolchain.
             vs=None,
             vs_target_arch='x86',
-            autodetectVS=False,
 
             # Multi-stage compilation
             useTwoStage=False,
@@ -642,9 +637,9 @@ def _getClangCMakeBuildFactory(
     stage2_install = 'stage2.install'
 
     # Set up VS environment, if appropriate.
-    if vs or autodetectVS:
+    if vs:
         f.addStep(SetProperty(
-            command=builders_util.getVisualStudioEnvironment(vs, vs_target_arch, autodetectVS),
+            command=builders_util.getVisualStudioEnvironment(vs, vs_target_arch),
             extract_fn=builders_util.extractSlaveEnvironment))
         assert not env, "Can't have custom builder env vars with VS"
         env = Property('slave_env')

Modified: zorg/trunk/zorg/buildbot/builders/LLDBBuilder.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/builders/LLDBBuilder.py?rev=345415&r1=345414&r2=345415&view=diff
==============================================================================
--- zorg/trunk/zorg/buildbot/builders/LLDBBuilder.py (original)
+++ zorg/trunk/zorg/buildbot/builders/LLDBBuilder.py Fri Oct 26 11:17:50 2018
@@ -58,7 +58,6 @@ def getLLDBWindowsCMakeBuildFactory(
             vs=r"""%VS140COMNTOOLS%""",
             config='Release',
             target_arch='x86',
-            autodetectVS=False,
 
             extra_cmake_args=None,
             test=False,
@@ -69,7 +68,7 @@ def getLLDBWindowsCMakeBuildFactory(
 
     # Determine Slave Environment and Set MSVC environment.
     f.addStep(SetProperty(
-        command=getVisualStudioEnvironment(vs, target_arch, autodetectVS),
+        command=getVisualStudioEnvironment(vs, target_arch),
         extract_fn=extractSlaveEnvironment))
 
     f = getLLDBSource(f,'llvm')

Modified: zorg/trunk/zorg/buildbot/builders/LLDBuilder.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/builders/LLDBuilder.py?rev=345415&r1=345414&r2=345415&view=diff
==============================================================================
--- zorg/trunk/zorg/buildbot/builders/LLDBuilder.py (original)
+++ zorg/trunk/zorg/buildbot/builders/LLDBuilder.py Fri Oct 26 11:17:50 2018
@@ -87,9 +87,8 @@ def getLLDWinBuildFactory(
            clean = True,
 
            # Default values for VS devenv and build configuration
-           vs = None,            # What to run to configure Visual Studio utils.
-           autodetectVS = False, # Don't try to auto detect a VS installation.
-           target_arch = None,   # Native.
+           vs = None,          # What to run to configure Visual Studio utils.
+           target_arch = None, # Native.
 
            extra_configure_args = None,
            env   = None):
@@ -120,9 +119,9 @@ def getLLDWinBuildFactory(
               ))
 
     # If set up environment step is requested, do this now.
-    if vs or autodetectVS:
+    if vs:
         f.addStep(SetProperty(
-            command=getVisualStudioEnvironment(vs, target_arch, autodetectVS),
+            command=getVisualStudioEnvironment(vs, target_arch),
             extract_fn=extractSlaveEnvironment))
         assert not env, "Can't have custom builder env vars with VS"
         env = Property('slave_env')

Modified: zorg/trunk/zorg/buildbot/builders/SanitizerBuilderWindows.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/builders/SanitizerBuilderWindows.py?rev=345415&r1=345414&r2=345415&view=diff
==============================================================================
--- zorg/trunk/zorg/buildbot/builders/SanitizerBuilderWindows.py (original)
+++ zorg/trunk/zorg/buildbot/builders/SanitizerBuilderWindows.py Fri Oct 26 11:17:50 2018
@@ -41,7 +41,6 @@ def getSanitizerWindowsBuildFactory(
             vs=r"""%VS120COMNTOOLS%""",
             config='Release',
             target_arch='x86',
-            autodetectVS=False,
 
             extra_cmake_args=[]):
 
@@ -60,7 +59,7 @@ def getSanitizerWindowsBuildFactory(
 
     # Determine Slave Environment and Set MSVC environment.
     f.addStep(SetProperty(
-        command=getVisualStudioEnvironment(vs, target_arch, autodetectVS),
+        command=getVisualStudioEnvironment(vs, target_arch),
         extract_fn=extractSlaveEnvironment))
 
     f = getSource(f,'llvm')

Modified: zorg/trunk/zorg/buildbot/builders/UnifiedTreeBuilder.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/builders/UnifiedTreeBuilder.py?rev=345415&r1=345414&r2=345415&view=diff
==============================================================================
--- zorg/trunk/zorg/buildbot/builders/UnifiedTreeBuilder.py (original)
+++ zorg/trunk/zorg/buildbot/builders/UnifiedTreeBuilder.py Fri Oct 26 11:17:50 2018
@@ -273,7 +273,6 @@ def getCmakeWithNinjaWithMSVCBuildFactor
            # %VS140COMNTOOLS% selects the 2015 toolchain.
            vs=None,
            target_arch=None,
-           autodetectVS=False,
            env = None,
            **kwargs):
 
@@ -301,7 +300,7 @@ def getCmakeWithNinjaWithMSVCBuildFactor
             **kwargs) # Pass through all the extra arguments.
 
     f.addStep(SetProperty(
-        command=builders_util.getVisualStudioEnvironment(vs, target_arch, autodetectVS),
+        command=builders_util.getVisualStudioEnvironment(vs, target_arch),
         extract_fn=builders_util.extractSlaveEnvironment))
     env = Property('slave_env')
 

Modified: zorg/trunk/zorg/buildbot/builders/Util.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/builders/Util.py?rev=345415&r1=345414&r2=345415&view=diff
==============================================================================
--- zorg/trunk/zorg/buildbot/builders/Util.py (original)
+++ zorg/trunk/zorg/buildbot/builders/Util.py Fri Oct 26 11:17:50 2018
@@ -1,33 +1,11 @@
 import buildbot.status.results
-import os
 import re
-import subprocess
 
-from os.path import join as pjoin
-
-VSWHERE_PATH = "C:/Program Files (x86)/Microsoft Visual Studio/Installer/vswhere.exe"
-
-def getVisualStudioEnvironment(vs=r"""%VS120COMNTOOLS%""", target_arch=None, autodetectVS=False):
+def getVisualStudioEnvironment(vs=r"""%VS120COMNTOOLS%""", target_arch=None):
     # x86 builds should use the 64 bit -> x86 cross compilation toolchain to avoid
     # out of memory linker errors
     arch_arg = {'x86': 'amd64_x86', 'x64': 'amd64', 'amd64': 'amd64'}.get(target_arch, '%PROCESSOR_ARCHITECTURE%')
-
-    """Get the VC tools environment using vswhere.exe from VS 2017 if it exists and was requested.
-    Otherwise, use the vs argument to construct a path to the expected location of vcvarsall.bat
-
-    This code is following the guidelines from strategy 1 in this blog post:
-        https://blogs.msdn.microsoft.com/vcblog/2017/03/06/finding-the-visual-c-compiler-tools-in-visual-studio-2017/
-
-    It doesn't work when VS is not installed at the default location.
-    """
-    # Use vswhere.exe if it exists.
-    if autodetectVS and os.path.exists(VSWHERE_PATH):
-        cmd = [VSWHERE_PATH, "-latest", "-property", "installationPath"]
-        vs_path = subprocess.check_output(cmd).strip()
-        vcvars_command = pjoin(vs_path, 'VC', 'Auxiliary', 'Build', 'vcvarsall.bat')
-    else:
-        vcvars_command = "\"" + "\\".join((vs, '..','..','VC', 'vcvarsall.bat')) + "\""
-
+    vcvars_command = "\"" + "\\".join((vs, '..','..','VC', 'vcvarsall.bat')) + "\""
     vcvars_command = "%s %s && set" % (vcvars_command, arch_arg)
     return vcvars_command
 




More information about the llvm-commits mailing list