@@ -199,10 +199,11 @@ setup_conda_pytorch_constraint() {
199199 export CONDA_CHANNEL_FLAGS=" -c pytorch-nightly"
200200 export PYTORCH_VERSION=" $( conda search --json ' pytorch[channel=pytorch-nightly]' | \
201201 python -c " import os, sys, json, re; cuver = os.environ.get('CU_VERSION'); \
202- cuver = (cuver[:-1] + '.' + cuver[-1]).replace('cu', 'cuda') if cuver != 'cpu' else cuver; \
202+ cuver_1 = cuver.replace('cu', 'cuda') if cuver != 'cpu' else cuver; \
203+ cuver_2 = (cuver[:-1] + '.' + cuver[-1]).replace('cu', 'cuda') if cuver != 'cpu' else cuver; \
203204 print(re.sub(r'\\ +.*$', '', \
204205 [x['version'] for x in json.load(sys.stdin)['pytorch'] \
205- if (x['platform'] == 'darwin' or cuver in x['fn']) \
206+ if (x['platform'] == 'darwin' or cuver_1 in x['fn'] or cuver_2 in x['fn']) \
206207 and 'py' + os.environ['PYTHON_VERSION'] in x['fn']][-1]))" ) "
207208 if [[ -z " $PYTORCH_VERSION " ]]; then
208209 echo " PyTorch version auto detection failed"
@@ -248,3 +249,13 @@ setup_conda_cudatoolkit_constraint() {
248249 esac
249250 fi
250251}
252+
253+ # Build the proper compiler package before building the final package
254+ setup_visual_studio_constraint () {
255+ if [[ " $OSTYPE " == " msys" ]]; then
256+ export VSTOOLCHAIN_PACKAGE=vs2019
257+ export VSDEVCMD_ARGS=' '
258+ conda build $CONDA_CHANNEL_FLAGS --no-anaconda-upload packaging/$VSTOOLCHAIN_PACKAGE
259+ cp packaging/$VSTOOLCHAIN_PACKAGE /conda_build_config.yaml packaging/torchvision/conda_build_config.yaml
260+ fi
261+ }
0 commit comments