Merge branch 'bugfix/windows_msys2_updates' into 'master'

Windows: Update MSYS2 environment, catch some MSYS2 Python quirks

See merge request idf/esp-idf!3417
This commit is contained in:
Angus Gratton 2018-10-05 08:06:47 +08:00
commit 445567d067
4 changed files with 29 additions and 8 deletions

View file

@ -14,7 +14,7 @@ Toolchain Setup
The quick setup is to download the Windows all-in-one toolchain & MSYS2 zip file from dl.espressif.com: The quick setup is to download the Windows all-in-one toolchain & MSYS2 zip file from dl.espressif.com:
https://dl.espressif.com/dl/esp32_win32_msys2_environment_and_toolchain-20180110.zip https://dl.espressif.com/dl/esp32_win32_msys2_environment_and_toolchain-20181001.zip
Unzip the zip file to ``C:\`` (or some other location, but this guide assumes ``C:\``) and it will create an ``msys32`` directory with a pre-prepared environment. Unzip the zip file to ``C:\`` (or some other location, but this guide assumes ``C:\``) and it will create an ``msys32`` directory with a pre-prepared environment.

View file

@ -15,7 +15,7 @@ Windows 没有内置的 "make" 环境,因此如果要安装工具链,你需
快速设置的方法是从 dl.espressif.com 下载集成在一起的工具链和 MSYS2 压缩文件: 快速设置的方法是从 dl.espressif.com 下载集成在一起的工具链和 MSYS2 压缩文件:
https://dl.espressif.com/dl/esp32_win32_msys2_environment_and_toolchain-20180110.zip https://dl.espressif.com/dl/esp32_win32_msys2_environment_and_toolchain-20181001.zip
将 zip 压缩文件解压到 ``C:\`` (或其它路径,这里假设是 ``C:\``),它会使用预先准备的环境创建一个 ``msys32`` 目录。 将 zip 压缩文件解压到 ``C:\`` (或其它路径,这里假设是 ``C:\``),它会使用预先准备的环境创建一个 ``msys32`` 目录。

View file

@ -34,6 +34,27 @@ if __name__ == "__main__":
default=idf_path + '/requirements.txt') default=idf_path + '/requirements.txt')
args = parser.parse_args() args = parser.parse_args()
# Special case for MINGW32 Python, needs some packages
# via MSYS2 not via pip or system breaks...
if sys.platform == "win32" and \
os.environ.get("MSYSTEM", None) == "MINGW32" and \
"/mingw32/bin/python" in sys.executable:
failed = False
try:
import cryptography
except ImportError:
print("Please run the following command to install MSYS2's MINGW Python cryptography package:")
print("pacman -S mingw-w64-i686-python%d-cryptography" % (sys.version_info[0],))
failed = True
try:
import setuptools
except ImportError:
print("Please run the following command to install MSYS2's MINGW Python setuptools package:")
print("pacman -S mingw-w64-i686-python%d-setuptools" % (sys.version_info[0],))
failed = True
if failed:
sys.exit(1)
not_satisfied = [] not_satisfied = []
with open(args.requirements) as f: with open(args.requirements) as f:
for line in f: for line in f:

View file

@ -33,13 +33,13 @@ set -e
pacman --noconfirm -Syu # This step may require the terminal to be closed and restarted pacman --noconfirm -Syu # This step may require the terminal to be closed and restarted
pacman --noconfirm -S --needed gettext-devel gcc git make ncurses-devel flex bison gperf vim mingw-w64-i686-python2-pip unzip winpty pacman --noconfirm -S --needed gettext-devel gcc git make ncurses-devel flex bison gperf vim \
mingw-w64-i686-python2-pip mingw-w64-i686-python2-cryptography unzip winpty
# Workaround for errors when running "git submodule" commands # if IDF_PATH is set, install requirements now as well
# See https://github.com/Alexpux/MSYS2-packages/issues/735 if [ -n $IDF_PATH ]; then
rm -f /mingw32/bin/envsubst.exe python -m pip install -r $IDF_PATH/requirements.txt
fi
python -m pip install --upgrade pip
# Automatically download precompiled toolchain, unpack at /opt/xtensa-esp32-elf/ # Automatically download precompiled toolchain, unpack at /opt/xtensa-esp32-elf/
TOOLCHAIN_ZIP=xtensa-esp32-elf-win32-1.22.0-80-g6c4433a-5.2.0.zip TOOLCHAIN_ZIP=xtensa-esp32-elf-win32-1.22.0-80-g6c4433a-5.2.0.zip