Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[READY] Support MSVC 16 #1249

Merged
merged 3 commits into from
Jun 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 27 additions & 5 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,18 +100,15 @@ jobs:
variables:
MSVC: 14
MSBUILD_PATH: 'C:\Program Files (x86)\MSBuild\14.0\Bin'
COVERAGE: true
steps:
- checkout: self
submodules: recursive
- script: azure\windows\install_dependencies.bat
displayName: Install dependencies
- script: azure\windows\run_tests.bat
displayName: Run tests
condition: and(succeeded(), ne(variables['YCM_BENCHMARK'], 'true'))
- script: azure\windows\send_coverage.bat
displayName: Send coverage
condition: and(succeeded(), eq(variables['COVERAGE'], 'true'))
env:
CODECOV_TOKEN: $(CODECOV_TOKEN)
CODECOV_JOB_NAME: '$(Agent.JobName)'
Expand All @@ -121,6 +118,31 @@ jobs:
# List of available software on this image:
# https://github.com/Microsoft/azure-pipelines-image-generation/blob/master/images/win/Vs2017-Server2016-Readme.md
vmImage: 'vs2017-win2016'
strategy:
matrix:
'Python 3.7 64-bit':
YCM_PYTHON_INSTALLER_URL: 'https://www.python.org/ftp/python/3.7.3/python-3.7.3-amd64.exe'
variables:
MSVC: 15
MSBUILD_PATH: 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin'
steps:
- checkout: self
submodules: recursive
- script: azure\windows\install_dependencies.bat
displayName: Install dependencies
- script: azure\windows\run_tests.bat
displayName: Run tests
- script: azure\windows\send_coverage.bat
displayName: Send coverage
env:
CODECOV_TOKEN: $(CODECOV_TOKEN)
CODECOV_JOB_NAME: '$(Agent.JobName)'
- job: windows_msvc17
displayName: 'Windows Visual Studio 2019'
pool:
# List of available software on this image:
# https://github.com/Microsoft/azure-pipelines-image-generation/blob/master/images/win/Vs2019-Server2019-Readme.md
vmImage: 'windows-2019'
strategy:
matrix:
'Python 2.7 64-bit':
Expand All @@ -135,8 +157,8 @@ jobs:
COVERAGE: false
maxParallel: 4
variables:
MSVC: 15
MSBUILD_PATH: 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin'
MSVC: 16
MSBUILD_PATH: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin'
COVERAGE: true
steps:
- checkout: self
Expand Down
2 changes: 1 addition & 1 deletion azure/windows/install_dependencies.bat
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if "%python_installer_extension%" == "exe" (
msiexec /i C:\python-installer.msi TARGETDIR=C:\Python /qn
)

C:\Python\Scripts\pip install -r test_requirements.txt
C:\Python\Scripts\pip install -r test_requirements.txt --disable-pip-version-check --no-warn-script-location

:: Enable coverage for Python subprocesses. See:
:: http://coverage.readthedocs.io/en/latest/subprocess.html
Expand Down
4 changes: 2 additions & 2 deletions benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

def ParseArguments():
parser = argparse.ArgumentParser()
parser.add_argument( '--msvc', type = int, choices = [ 12, 14, 15 ],
default = 15, help = 'Choose the Microsoft Visual '
parser.add_argument( '--msvc', type = int, choices = [ 14, 15, 16 ],
default = 16, help = 'Choose the Microsoft Visual '
'Studio version (default: %(default)s).' )

return parser.parse_known_args()
Expand Down
15 changes: 13 additions & 2 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,10 @@ def GetGenerator( args ):
if args.ninja:
return 'Ninja'
if OnWindows():
# The architecture must be specified through the -A option for the Visual
# Studio 16 generator.
if args.msvc == 16:
return 'Visual Studio 16'
return 'Visual Studio {version}{arch}'.format(
version = args.msvc, arch = ' Win64' if IS_64BIT else '' )
return 'Unix Makefiles'
Expand Down Expand Up @@ -401,8 +405,8 @@ def ParseArguments():
parser.add_argument( '--system-libclang', action = 'store_true',
help = 'Use system libclang instead of downloading one '
'from llvm.org. NOT RECOMMENDED OR SUPPORTED!' )
parser.add_argument( '--msvc', type = int, choices = [ 14, 15 ],
default = 15, help = 'Choose the Microsoft Visual '
parser.add_argument( '--msvc', type = int, choices = [ 14, 15, 16 ],
default = 16, help = 'Choose the Microsoft Visual '
'Studio version (default: %(default)s).' )
parser.add_argument( '--ninja', action = 'store_true',
help = 'Use Ninja build system.' )
Expand Down Expand Up @@ -481,7 +485,14 @@ def FindCmake():

def GetCmakeCommonArgs( args ):
cmake_args = [ '-G', GetGenerator( args ) ]

# Set the architecture for the Visual Studio 16 generator.
if OnWindows() and args.msvc == 16:
arch = 'x64' if IS_64BIT else 'Win32'
cmake_args.extend( [ '-A', arch ] )

cmake_args.extend( CustomPythonCmakeArgs( args ) )

return cmake_args


Expand Down
4 changes: 2 additions & 2 deletions run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ def ParseArguments():
COMPLETERS.keys() ) )
parser.add_argument( '--skip-build', action = 'store_true',
help = 'Do not build ycmd before testing.' )
parser.add_argument( '--msvc', type = int, choices = [ 14, 15 ],
default = 15, help = 'Choose the Microsoft Visual '
parser.add_argument( '--msvc', type = int, choices = [ 14, 15, 16 ],
default = 16, help = 'Choose the Microsoft Visual '
'Studio version (default: %(default)s).' )
parser.add_argument( '--coverage', action = 'store_true',
help = 'Enable coverage report (requires coverage pkg)' )
Expand Down