Generate environment restore script for Windows build jobs (#37319)

Summary:
for better debugging purposes
Pull Request resolved: https://github.com/pytorch/pytorch/pull/37319

Differential Revision: D21257011

Pulled By: ezyang

fbshipit-source-id: 41c7f1aa440f3ea626536b64392cca32f7c32dd3
This commit is contained in:
peterjc123 2020-04-27 08:28:56 -07:00 committed by Facebook GitHub Bot
parent 007163407c
commit 3a0ff3cd2f

View file

@ -99,6 +99,11 @@ if "%USE_CUDA%"=="1" (
set RANDOMTEMP_BASEDIR=%TMP_DIR_WIN%\bin
)
@echo off
echo @echo off >> %TMP_DIR_WIN%\bin\pytorch_env_restore.bat
for /f "usebackq tokens=*" %%i in (`set`) do echo set "%%i" >> %TMP_DIR_WIN%\bin\pytorch_env_restore.bat
@echo on
python setup.py install --cmake && sccache --show-stats && (
if "%BUILD_ENVIRONMENT%"=="" (
echo NOTE: To run `import torch`, please make sure to activate the conda environment by running `call %CONDA_PARENT_DIR%\Miniconda3\Scripts\activate.bat %CONDA_PARENT_DIR%\Miniconda3` in Command Prompt before running Git Bash.