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

Add config for VS2022 #46

Merged
merged 20 commits into from
Oct 24, 2022
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
8 changes: 6 additions & 2 deletions .azure-pipelines/azure-pipelines-win.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions .ci_support/README

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
channel_sources:
- conda-forge
channel_targets:
- conda-forge main
cl_version:
- 19.33.31629
runtime_version:
- 14.32.31332
sha256:
- CE6593A1520591E7DEA2B93FD03116E3FC3B3821A0525322B0A430FAA6B3C0B4
target_platform:
- win-64
update_version:
- '2'
uuid:
- 7331f052-6c2d-4890-8041-8058fee5fb0f
vc:
- '14'
vcver:
- '14.3'
vsver:
- '17'
vsyear:
- '2022'
zip_keys:
- - vcver
- vsyear
- vsver
- runtime_version
- update_version
- cl_version
- uuid
- sha256
34 changes: 21 additions & 13 deletions README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 32 additions & 10 deletions recipe/activate.bat
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,25 @@ for /f "usebackq tokens=*" %%i in (`vswhere.exe -nologo -products * -version ^[@
:: There is no trailing back-slash from the vswhere, and may make vcvars64.bat fail, so force add it
set "VSINSTALLDIR=%%i\"
)

if not exist "%VSINSTALLDIR%" (
:: VS2022+ install but with vs2017/vs2019 compiler stuff installed
for /f "usebackq tokens=*" %%i in (`vswhere.exe -nologo -products * -requires Microsoft.VisualStudio.ComponentGroup.VC.Tools.@{vcver_nodots}.x86.x64 -property installationPath`) do (
:: There is no trailing back-slash from the vswhere, and may make vcvars64.bat fail, so force add it
set "VSINSTALLDIR=%%i\"
set "NEWER_VS_WITH_OLDER_VC=1"
)
)

if not exist "%VSINSTALLDIR%" (
:: VS2019 install but with vs2017 compiler stuff installed
for /f "usebackq tokens=*" %%i in (`vswhere.exe -nologo -products * -requires Microsoft.VisualStudio.Component.VC.v@{vcver_nodots}.x86.x64 -property installationPath`) do (
:: There is no trailing back-slash from the vswhere, and may make vcvars64.bat fail, so force add it
set "VSINSTALLDIR=%%i\"
set "NEWER_VS_WITH_OLDER_VC=1"
)
:: VS2019 install but with vs2017 compiler stuff installed
for /f "usebackq tokens=*" %%i in (`vswhere.exe -nologo -products * -requires Microsoft.VisualStudio.Component.VC.v@{vcver_nodots}.x86.x64 -property installationPath`) do (
:: There is no trailing back-slash from the vswhere, and may make vcvars64.bat fail, so force add it
set "VSINSTALLDIR=%%i\"
set "NEWER_VS_WITH_OLDER_VC=1"
)
)

if not exist "%VSINSTALLDIR%" (
set "VSINSTALLDIR=%ProgramFiles(x86)%\Microsoft Visual Studio\@{year}\Professional\"
)
Expand Down Expand Up @@ -90,16 +101,27 @@ IF @{year} GEQ 2019 (

echo "NEWER_VS_WITH_OLDER_VC=%NEWER_VS_WITH_OLDER_VC%"

IF "%NEWER_VS_WITH_OLDER_VC%" == "1" (
if "%NEWER_VS_WITH_OLDER_VC%" == "1" (
set /p NEWER_VS=<"%VSINSTALLDIR%\VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt"
)
type "%VSINSTALLDIR%\VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt"
dir "%VSINSTALLDIR%\VC\Redist\MSVC\"

if "%NEWER_VS_WITH_OLDER_VC%" == "1" (
echo "%NEWER_VS%"
if "%NEWER_VS:~0,4%" == "14.2" (
set "CMAKE_GEN=Visual Studio 16 2019"
set "USE_NEW_CMAKE_GEN_SYNTAX=1"
) else (
set "CMAKE_GEN=Visual Studio 17 2022"
)
set "USE_NEW_CMAKE_GEN_SYNTAX=1"
)

IF "%CMAKE_GENERATOR%" == "" SET "CMAKE_GENERATOR=%CMAKE_GEN%"
:: see https://cmake.org/cmake/help/latest/envvar/CMAKE_GENERATOR_PLATFORM.html
IF "%USE_NEW_CMAKE_GEN_SYNTAX%" == "1" (
IF "%CMAKE_GENERATOR_PLATFORM%" == "" SET "CMAKE_GENERATOR_PLATFORM=%CMAKE_PLAT%"
IF "%CMAKE_GENERATOR_TOOLSET%" == "" SET "CMAKE_GENERATOR_TOOLSET=v@{vcver_nodots}"
IF "%CMAKE_GENERATOR_PLATFORM%" == "" SET "CMAKE_GENERATOR_PLATFORM=%CMAKE_PLAT%"
IF "%CMAKE_GENERATOR_TOOLSET%" == "" SET "CMAKE_GENERATOR_TOOLSET=v@{vcver_nodots}"
)

pushd %VSINSTALLDIR%
Expand Down
8 changes: 8 additions & 0 deletions recipe/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -1,41 +1,49 @@
vcver:
- 14.3
- 14.2
- 14.2
- 14.1
vsyear:
- 2022
- 2019
- 2019
- 2017
vsver:
- 17
- 16
- 16
- 15
runtime_version:
# the minor version here can show up in the toolset directory path
# used by vcvars.bat (see #36), hence we need multiple builds even
# though they're from the same vsver-line.
- 14.32.31332
- 14.29.30139
- 14.28.29325
- 14.16.27033
# the VS update version. This is the middle digit in the version
# reported in the VS help->about UI. It is perhaps a more readily
# referenceable number.
update_version:
- 2
- 11
- 8
- 9
# This is the version number reported by cl.exe
cl_version:
- 19.33.31629
- 19.29.30139
- 19.28.29325
- 19.16.27033
# This is the uuid in the URL; redirect can be resolved e.g. as follows
# curl -ILSs https://aka.ms/vs/16/release/vc_redist.x64.exe | grep "Location:"
uuid:
- 7331f052-6c2d-4890-8041-8058fee5fb0f
- b929b7fe-5c89-4553-9abe-6324631dcc3a
- 89a3b9df-4a09-492e-8474-8f92c115c51d
- 4100b84d-1b4d-487d-9f89-1354a7138c8f
sha256:
- CE6593A1520591E7DEA2B93FD03116E3FC3B3821A0525322B0A430FAA6B3C0B4
- 296F96CD102250636BCD23AB6E6CF70935337B1BBB3507FE8521D8D9CFAA932F
- B1A32C71A6B7D5978904FB223763263EA5A7EB23B2C44A0D60E90D234AD99178
- 5B0CBB977F2F5253B1EBE5C9D30EDBDA35DBD68FB70DE7AF5FAAC6423DB575B5
Expand Down
3 changes: 3 additions & 0 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ outputs:
script_interpreter: >-
python -m vc_repack --activate --arch {{ target_platform }} --version {{ runtime_version }}
--activate-year {{ vsyear }} --activate-major {{ vsver }} --activate-vcver {{ vcver }}
--activate-vcvars-ver {{ cl_version.split(".")[0]|int - 5 }}.{{ cl_version.split(".")[1] }}
build:
track_features:
- vc{{ vcver.split(".")[0] }}
Expand All @@ -168,6 +169,7 @@ outputs:
# package is named vs2015_runtime, but the version differs)
- vc >={{ vcver }},<{{ vcver.split('.')[0] | int + 1 }}
- vs{{ runtime_year }}_runtime >={{ runtime_version }}
- ucrt >=10.0.20348.0 # [vsver >=17 or (vsver == 16 and update_version >= 10)]
requirements:
run:
# Used to set up the path in the activate script
Expand All @@ -192,6 +194,7 @@ about:
license_family: Proprietary

extra:
feedstock-name: vc
recipe-maintainers:
- jakirkham
- 183amir
Expand Down
6 changes: 4 additions & 2 deletions recipe/vc_repack.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,9 @@ class AtTemplate(string.Template):

def subs(line, args):
t = AtTemplate(line)
vcvars_ver = ".".join(args.version.split(".")[:2])
return t.substitute(
year=args.activate_year, ver=args.activate_major, target=args.arch,
vcvars_ver=vcvars_ver, ver_plus_one=str(int(args.activate_major)+1),
vcvars_ver=args.activate_vcvars_ver, ver_plus_one=str(int(args.activate_major)+1),
vcver_nodots=args.activate_vcver.replace(".", ""))


Expand Down Expand Up @@ -243,6 +242,9 @@ def main():
parser.add_argument(
"--activate-vcver", help="VC Version", default=None,
)
parser.add_argument(
"--activate-vcvars-ver", help="VC Version", default=None,
)
parser.add_argument(
"--activate-major", help="VS Major Version", default=None,
)
Expand Down