Update to python 3.9.2 on Windows as well. Mark old Python and Node packages. (#758)
This commit is contained in:
Родитель
9c65611d96
Коммит
0fe3d48f22
|
@ -56,7 +56,8 @@ https://emscripten.org/docs/building_from_source/toolchain_what_is_needed.html.
|
|||
|
||||
### Mac OS X
|
||||
|
||||
- `python`: Version 2.7.0 or above.
|
||||
- For Intel-based Macs, macOS 10.13 or newer. For ARM64 M1 based Macs, macOS
|
||||
11.0 or newer.
|
||||
- `java`: For running closure compiler (optional). After installing emscripten
|
||||
via emsdk, typing 'emcc --help' should pop up a OS X dialog "Java is not
|
||||
installed. To open java, you need a Java SE 6 runtime. Would you like to
|
||||
|
|
|
@ -7,6 +7,13 @@ setlocal
|
|||
:: When using our bundled python we never want the users
|
||||
:: PYTHONHOME or PYTHONPATH
|
||||
:: https://github.com/emscripten-core/emsdk/issues/598
|
||||
if exist "%~dp0python\3.9.2-1_64bit\python.exe" (
|
||||
set EMSDK_PY="%~dp0python\3.9.2-1_64bit\python.exe"
|
||||
set PYTHONHOME=
|
||||
set PYTHONPATH=
|
||||
goto end
|
||||
)
|
||||
|
||||
if exist "%~dp0python\3.7.4-pywin32_64bit\python.exe" (
|
||||
set EMSDK_PY="%~dp0python\3.7.4-pywin32_64bit\python.exe"
|
||||
set PYTHONHOME=
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
$ScriptDirectory = Split-Path -parent $PSCommandPath
|
||||
|
||||
$PythonLocations = $(
|
||||
"python\3.9.2-1_64bit\python.exe",
|
||||
"python\3.7.4-pywin32_64bit\python.exe",
|
||||
"python\3.7.4_64bit\python.exe",
|
||||
"python\2.7.13.1_64bit\python-2.7.13.amd64\python.exe",
|
||||
|
|
|
@ -150,7 +150,8 @@
|
|||
"linux_url": "node-v8.9.1-linux-x86.tar.xz",
|
||||
"activated_path": "%installation_dir%/bin",
|
||||
"activated_cfg": "NODE_JS='%installation_dir%/bin/node%.exe%'",
|
||||
"activated_env": "EMSDK_NODE=%installation_dir%/bin/node%.exe%"
|
||||
"activated_env": "EMSDK_NODE=%installation_dir%/bin/node%.exe%",
|
||||
"is_old": true
|
||||
},
|
||||
{
|
||||
"id": "node",
|
||||
|
@ -160,7 +161,8 @@
|
|||
"linux_url": "https://nodejs.org/dist/v8.9.1/node-v8.9.1-linux-armv7l.tar.xz",
|
||||
"activated_path": "%installation_dir%/bin",
|
||||
"activated_cfg": "NODE_JS='%installation_dir%/bin/node%.exe%'",
|
||||
"activated_env": "EMSDK_NODE=%installation_dir%/bin/node%.exe%"
|
||||
"activated_env": "EMSDK_NODE=%installation_dir%/bin/node%.exe%",
|
||||
"is_old": true
|
||||
},
|
||||
{
|
||||
"id": "node",
|
||||
|
@ -172,7 +174,8 @@
|
|||
"linux_url": "node-v8.9.1-linux-x64.tar.xz",
|
||||
"activated_path": "%installation_dir%/bin",
|
||||
"activated_cfg": "NODE_JS='%installation_dir%/bin/node%.exe%'",
|
||||
"activated_env": "EMSDK_NODE=%installation_dir%/bin/node%.exe%"
|
||||
"activated_env": "EMSDK_NODE=%installation_dir%/bin/node%.exe%",
|
||||
"is_old": true
|
||||
},
|
||||
{
|
||||
"id": "node",
|
||||
|
@ -182,7 +185,8 @@
|
|||
"linux_url": "node-v8.9.1-linux-arm64.tar.xz",
|
||||
"activated_path": "%installation_dir%/bin",
|
||||
"activated_cfg": "NODE_JS='%installation_dir%/bin/node%.exe%'",
|
||||
"activated_env": "EMSDK_NODE=%installation_dir%/bin/node%.exe%"
|
||||
"activated_env": "EMSDK_NODE=%installation_dir%/bin/node%.exe%",
|
||||
"is_old": true
|
||||
},
|
||||
{
|
||||
"id": "node",
|
||||
|
@ -234,7 +238,8 @@
|
|||
"arch": "x86",
|
||||
"windows_url": "WinPython-32bit-2.7.13.1Zero.zip",
|
||||
"activated_cfg": "PYTHON='%installation_dir%/python-2.7.13/python%.exe%'",
|
||||
"activated_env": "EMSDK_PYTHON=%installation_dir%/python-2.7.13/python%.exe%"
|
||||
"activated_env": "EMSDK_PYTHON=%installation_dir%/python-2.7.13/python%.exe%",
|
||||
"is_old": true
|
||||
},
|
||||
{
|
||||
"id": "python",
|
||||
|
@ -243,7 +248,8 @@
|
|||
"arch": "x86_64",
|
||||
"windows_url": "WinPython-64bit-2.7.13.1Zero.zip",
|
||||
"activated_cfg": "PYTHON='%installation_dir%/python-2.7.13.amd64/python%.exe%'",
|
||||
"activated_env": "EMSDK_PYTHON=%installation_dir%/python-2.7.13.amd64/python%.exe%"
|
||||
"activated_env": "EMSDK_PYTHON=%installation_dir%/python-2.7.13.amd64/python%.exe%",
|
||||
"is_old": true
|
||||
},
|
||||
{
|
||||
"id": "python",
|
||||
|
@ -252,7 +258,8 @@
|
|||
"arch": "x86",
|
||||
"windows_url": "python-3.7.4-embed-win32-patched.zip",
|
||||
"activated_cfg": "PYTHON='%installation_dir%/python.exe'",
|
||||
"activated_env": "EMSDK_PYTHON=%installation_dir%/python.exe"
|
||||
"activated_env": "EMSDK_PYTHON=%installation_dir%/python.exe",
|
||||
"is_old": true
|
||||
},
|
||||
{
|
||||
"id": "python",
|
||||
|
@ -261,7 +268,8 @@
|
|||
"arch": "x86_64",
|
||||
"windows_url": "python-3.7.4-embed-amd64-patched.zip",
|
||||
"activated_cfg": "PYTHON='%installation_dir%/python.exe'",
|
||||
"activated_env": "EMSDK_PYTHON=%installation_dir%/python.exe"
|
||||
"activated_env": "EMSDK_PYTHON=%installation_dir%/python.exe",
|
||||
"is_old": true
|
||||
},
|
||||
{
|
||||
"id": "python",
|
||||
|
@ -270,7 +278,8 @@
|
|||
"arch": "x86",
|
||||
"windows_url": "python-3.7.4-embed-win32+pywin32.zip",
|
||||
"activated_cfg": "PYTHON='%installation_dir%/python.exe'",
|
||||
"activated_env": "EMSDK_PYTHON=%installation_dir%/python.exe"
|
||||
"activated_env": "EMSDK_PYTHON=%installation_dir%/python.exe",
|
||||
"is_old": true
|
||||
},
|
||||
{
|
||||
"id": "python",
|
||||
|
@ -279,7 +288,8 @@
|
|||
"arch": "x86_64",
|
||||
"windows_url": "python-3.7.4-embed-amd64+pywin32.zip",
|
||||
"activated_cfg": "PYTHON='%installation_dir%/python.exe'",
|
||||
"activated_env": "EMSDK_PYTHON=%installation_dir%/python.exe"
|
||||
"activated_env": "EMSDK_PYTHON=%installation_dir%/python.exe",
|
||||
"is_old": true
|
||||
},
|
||||
{
|
||||
"id": "python",
|
||||
|
@ -288,7 +298,17 @@
|
|||
"arch": "x86_64",
|
||||
"macos_url": "python-3.7.4-2-macos.tar.gz",
|
||||
"activated_cfg": "PYTHON='%installation_dir%/bin/python3'",
|
||||
"activated_env": "EMSDK_PYTHON=%installation_dir%/bin/python3;SSL_CERT_FILE=%installation_dir%/lib/python3.7/site-packages/certifi/cacert.pem"
|
||||
"activated_env": "EMSDK_PYTHON=%installation_dir%/bin/python3;SSL_CERT_FILE=%installation_dir%/lib/python3.7/site-packages/certifi/cacert.pem",
|
||||
"is_old": true
|
||||
},
|
||||
{
|
||||
"id": "python",
|
||||
"version": "3.9.2-1",
|
||||
"bitness": 64,
|
||||
"arch": "x86_64",
|
||||
"windows_url": "python-3.9.2-1-embed-amd64+pywin32.zip",
|
||||
"activated_cfg": "PYTHON='%installation_dir%/python.exe'",
|
||||
"activated_env": "EMSDK_PYTHON=%installation_dir%/python.exe"
|
||||
},
|
||||
{
|
||||
"id": "python",
|
||||
|
@ -506,7 +526,7 @@
|
|||
{
|
||||
"version": "upstream-main",
|
||||
"bitness": 64,
|
||||
"uses": ["python-3.7.4-pywin32-64bit", "llvm-git-main-64bit", "node-14.15.5-64bit", "emscripten-main-64bit", "binaryen-main-64bit"],
|
||||
"uses": ["python-3.9.2-1-64bit", "llvm-git-main-64bit", "node-14.15.5-64bit", "emscripten-main-64bit", "binaryen-main-64bit"],
|
||||
"os": "win"
|
||||
},
|
||||
{
|
||||
|
@ -573,7 +593,7 @@
|
|||
{
|
||||
"version": "releases-upstream-%releases-tag%",
|
||||
"bitness": 64,
|
||||
"uses": ["node-14.15.5-64bit", "python-3.7.4-2-64bit", "releases-upstream-%releases-tag%-64bit"],
|
||||
"uses": ["node-14.15.5-64bit", "python-3.9.2-1-64bit", "releases-upstream-%releases-tag%-64bit"],
|
||||
"os": "macos",
|
||||
"arch": "x86_64",
|
||||
"custom_install_script": "emscripten_npm_install"
|
||||
|
@ -581,7 +601,7 @@
|
|||
{
|
||||
"version": "releases-upstream-%releases-tag%",
|
||||
"bitness": 64,
|
||||
"uses": ["node-14.15.5-64bit", "python-3.7.4-pywin32-64bit", "java-8.152-64bit", "releases-upstream-%releases-tag%-64bit"],
|
||||
"uses": ["node-14.15.5-64bit", "python-3.9.2-1-64bit", "java-8.152-64bit", "releases-upstream-%releases-tag%-64bit"],
|
||||
"os": "win",
|
||||
"custom_install_script": "emscripten_npm_install"
|
||||
},
|
||||
|
|
|
@ -42,13 +42,31 @@ pywin32_base = 'https://github.com/mhammond/pywin32/releases/download/b%s/' % py
|
|||
upload_base = 'gs://webassembly/emscripten-releases-builds/deps/'
|
||||
|
||||
|
||||
def unzip_cmd():
|
||||
# Use 7-Zip if available (https://www.7-zip.org/)
|
||||
sevenzip = os.path.join(os.getenv('ProgramFiles'), '7-Zip', '7z.exe')
|
||||
if os.path.isfile(sevenzip):
|
||||
return [sevenzip, 'x']
|
||||
# Fall back to 'unzip' tool
|
||||
return ['unzip', '-q']
|
||||
|
||||
|
||||
def zip_cmd():
|
||||
# Use 7-Zip if available (https://www.7-zip.org/)
|
||||
sevenzip = os.path.join(os.getenv('ProgramFiles'), '7-Zip', '7z.exe')
|
||||
if os.path.isfile(sevenzip):
|
||||
return [sevenzip, 'a', '-mx9']
|
||||
# Fall back to 'zip' tool
|
||||
return ['zip', '-rq']
|
||||
|
||||
|
||||
def make_python_patch(arch):
|
||||
if arch == 'amd64':
|
||||
pywin32_filename = 'pywin32-%s.win-%s-py%s.exe' % (pywin32_version, arch, major_minor_version)
|
||||
else:
|
||||
pywin32_filename = 'pywin32-%s.%s-py%s.exe' % (pywin32_version, arch, major_minor_version)
|
||||
filename = 'python-%s-embed-%s.zip' % (version, arch)
|
||||
out_filename = 'python-%s-embed-%s+pywin32.zip' % (version, arch)
|
||||
out_filename = 'python-%s-%s-embed-%s+pywin32.zip' % (version, revision, arch)
|
||||
if not os.path.exists(pywin32_filename):
|
||||
download_url = pywin32_base + pywin32_filename
|
||||
print('Downloading pywin32: ' + download_url)
|
||||
|
@ -60,17 +78,21 @@ def make_python_patch(arch):
|
|||
urllib.request.urlretrieve(download_url, filename)
|
||||
|
||||
os.mkdir('python-embed')
|
||||
check_call(['unzip', '-q', os.path.abspath(filename)], cwd='python-embed')
|
||||
os.remove(os.path.join('python-embed', 'python37._pth'))
|
||||
check_call(unzip_cmd() + [os.path.abspath(filename)], cwd='python-embed')
|
||||
os.remove(os.path.join('python-embed', 'python%s._pth' % major_minor_version.replace('.', '')))
|
||||
|
||||
os.mkdir('pywin32')
|
||||
rtn = subprocess.call(['unzip', '-q', os.path.abspath(pywin32_filename)], cwd='pywin32')
|
||||
rtn = subprocess.call(unzip_cmd() + [os.path.abspath(pywin32_filename)], cwd='pywin32')
|
||||
assert rtn in [0, 1]
|
||||
|
||||
os.mkdir(os.path.join('python-embed', 'lib'))
|
||||
shutil.move(os.path.join('pywin32', 'PLATLIB'), os.path.join('python-embed', 'lib', 'site-packages'))
|
||||
|
||||
check_call(['zip', '-rq', os.path.join('..', out_filename), '.'], cwd='python-embed')
|
||||
check_call(zip_cmd() + [os.path.join('..', out_filename), '.'], cwd='python-embed')
|
||||
|
||||
# cleanup if everything went fine
|
||||
shutil.rmtree('python-embed')
|
||||
shutil.rmtree('pywin32')
|
||||
|
||||
upload_url = upload_base + out_filename
|
||||
print('Uploading: ' + upload_url)
|
||||
|
@ -78,10 +100,6 @@ def make_python_patch(arch):
|
|||
print(' '.join(cmd))
|
||||
check_call(cmd)
|
||||
|
||||
# cleanup if everything went fine
|
||||
shutil.rmtree('python-embed')
|
||||
shutil.rmtree('pywin32')
|
||||
|
||||
|
||||
def build_python():
|
||||
if sys.platform.startswith('darwin'):
|
||||
|
|
Загрузка…
Ссылка в новой задаче