From 7184b6b7b0486638574f33f69f86ac4f6f058bf9 Mon Sep 17 00:00:00 2001 From: Heikki Halmet Date: Tue, 21 Sep 2021 11:56:16 +0300 Subject: Provisioning: Install emsdk using emsdk.git MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This will reduce the manual work when updating emsdk version This requires also python certificates to be installed Pick-to: 6.2 Change-Id: Id33d73f67f3312a27e9660522e7ca7ce17a89dbc Reviewed-by: Qt CI Bot Reviewed-by: Tony Sarajärvi --- coin/provisioning/common/macos/python3.sh | 4 +- coin/provisioning/common/unix/emsdk.sh | 59 +++------------- coin/provisioning/common/windows/emsdk.ps1 | 89 +++++------------------- coin/provisioning/common/windows/install-git.ps1 | 2 +- 4 files changed, 32 insertions(+), 122 deletions(-) diff --git a/coin/provisioning/common/macos/python3.sh b/coin/provisioning/common/macos/python3.sh index 7e3d820c..6ba61951 100755 --- a/coin/provisioning/common/macos/python3.sh +++ b/coin/provisioning/common/macos/python3.sh @@ -61,5 +61,7 @@ SetEnvVar "PIP3_PATH" "/Library/Frameworks/Python.framework/Versions/3.9/bin" /Library/Frameworks/Python.framework/Versions/3.9/bin/pip3 wheel --wheel-dir $HOME/python3-wheels -r ${BASH_SOURCE%/*}/../shared/requirements.txt SetEnvVar "PYTHON3_WHEEL_CACHE" "$HOME/python3-wheels" -echo "python3 = 3.9.6" >> ~/versions.txt +# Install Python certificates. Required at least for emsdk installation +open /Applications/Python\ 3.9/Install\ Certificates.command +echo "python3 = 3.9.6" >> ~/versions.txt diff --git a/coin/provisioning/common/unix/emsdk.sh b/coin/provisioning/common/unix/emsdk.sh index f75dfa70..ac99b319 100755 --- a/coin/provisioning/common/unix/emsdk.sh +++ b/coin/provisioning/common/unix/emsdk.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash ############################################################################# ## -## Copyright (C) 2019 The Qt Company Ltd. +## Copyright (C) 2021 The Qt Company Ltd. ## Contact: http://www.qt.io/licensing/ ## ## This file is part of the provisioning scripts of the Qt Toolkit. @@ -32,66 +32,29 @@ ## ############################################################################# -# shellcheck source=./InstallFromCompressedFileFromURL.sh -source "${BASH_SOURCE%/*}/InstallFromCompressedFileFromURL.sh" # shellcheck source=./SetEnvVar.sh source "${BASH_SOURCE%/*}/SetEnvVar.sh" -# shellcheck source=./DownloadURL.sh -source "${BASH_SOURCE%/*}/DownloadURL.sh" version="2.0.14" -versionTag="fc5562126762ab26c4757147a3b4c24e85a7289e" versionNode="v14.15.5" -urlCache="http://ci-files01-hki.intra.qt.io/input/emsdk" -targetFolder="/opt/emsdk" -# cross-platform emscripten SDK -urlEmscriptenExternal="https://github.com/emscripten-core/emscripten/archive/$version.tar.gz" -urlEmscriptenCache="$urlCache/emscripten.$version.tar.gz" -sha1Emscripten="5fbdca8ed238b90ab8c3656831fcc5eb1ce08c58" +mkdir -p /opt +cd /opt +sudo git clone https://github.com/emscripten-core/emsdk.git +cd emsdk +sudo ./emsdk install $version +sudo ./emsdk activate $version # platform-specific toolchain and node binaries. urls obtained from "emsdk install" if uname -a |grep -q Darwin; then - urlWasmBinariesExternal="https://storage.googleapis.com/webassembly/emscripten-releases-builds/mac/$versionTag/wasm-binaries.tbz2" - urlWasmBinariesCache="$urlCache/macos/wasm-binaries.$version.tbz2" - sha1WasmBinaries="86dc16b299543cf593abc6f0137f8d0d723baddb" - - urlNodeBinariesExternal="https://storage.googleapis.com/webassembly/emscripten-releases-builds/deps/node-$versionNode-darwin-x64.tar.gz" - urlNodeBinariesCache="$urlCache/mac/node-$versionNode-darwin-x64.tar.gz" - sha1NodeBinaries="6db16d024ea9e5f2ebdd0c1ef07ea67c2004ce93" pathNodeExecutable="node-$versionNode-darwin-x64/bin/node" else - urlWasmBinariesExternal="https://storage.googleapis.com/webassembly/emscripten-releases-builds/linux/$versionTag/wasm-binaries.tbz2" - urlWasmBinariesCache="$urlCache/linux/wasm-binaries.$version.tbz2" - sha1WasmBinaries="9724185c06c461edec3495e37e034066479b9ccf" - - urlNodeBinariesExternal="https://storage.googleapis.com/webassembly/emscripten-releases-builds/deps/node-$versionNode-linux-x64.tar.xz" - urlNodeBinariesCache="$urlCache/linux/node-$versionNode-linux-x64.tar.xz" - sha1NodeBinaries="ca7ce363ceaf71b65e85243a71252c20cfd97982" pathNodeExecutable="node-$versionNode-linux-x64/bin/node" fi -sudo mkdir "$targetFolder" - -InstallFromCompressedFileFromURL "$urlEmscriptenCache" "$urlEmscriptenExternal" "$sha1Emscripten" "$targetFolder" "" -InstallFromCompressedFileFromURL "$urlWasmBinariesCache" "$urlWasmBinariesExternal" "$sha1WasmBinaries" "$targetFolder" "" -InstallFromCompressedFileFromURL "$urlNodeBinariesCache" "$urlNodeBinariesExternal" "$sha1NodeBinaries" "$targetFolder" "" - -sudo chmod -R a+rwx "$targetFolder" - -echo "Writing $targetFolder/.emscripten" -cat <"$targetFolder/.emscripten" -emsdk_path = '$targetFolder' -EMSCRIPTEN_ROOT = emsdk_path + '/emscripten-$version' -LLVM_ROOT = emsdk_path + '/install/bin' -BINARYEN_ROOT = emsdk_path + '/install' -NODE_JS = emsdk_path + '/$pathNodeExecutable' -TEMP_DIR = '/tmp' -EOM - -SetEnvVar "PATH" "\"\$PATH:$targetFolder/emscripten-$version/\"" -SetEnvVar "EMSCRIPTEN" "$targetFolder/emscripten-$version" -SetEnvVar "EMSDK" "$targetFolder" -SetEnvVar "EMSDK_NODE" "$targetFolder/$pathNodeExecutable" +SetEnvVar "PATH" "\"\$PATH:/opt/emsdk/emscripten-$version/\"" +SetEnvVar "EMSCRIPTEN" "/opt/emsdk/emscripten-$version" +SetEnvVar "EMSDK" "/opt/emsdk" +SetEnvVar "EMSDK_NODE" "/opt/emsdk/$pathNodeExecutable" echo "Emsdk = $version" >> ~/versions.txt diff --git a/coin/provisioning/common/windows/emsdk.ps1 b/coin/provisioning/common/windows/emsdk.ps1 index 524edba1..70efb22f 100644 --- a/coin/provisioning/common/windows/emsdk.ps1 +++ b/coin/provisioning/common/windows/emsdk.ps1 @@ -1,6 +1,6 @@ ############################################################################ ## -## Copyright (C) 2019 The Qt Company Ltd. +## Copyright (C) 2021 The Qt Company Ltd. ## Contact: http://www.qt.io/licensing/ ## ## This file is part of the provisioning scripts of the Qt Toolkit. @@ -38,79 +38,25 @@ $version = "2.0.14" $versionTag="fc5562126762ab26c4757147a3b4c24e85a7289e" $versionNode = "14.15.5" -$versionWinPython = "3.7.4" -$versionJre = "8_update_152" +$versionWinPython = "3.9.2-1" +$versionJre = "8.152" -$urlEmscripten = "https://storage.googleapis.com/webassembly/emscripten-releases-builds" - -# cross-platform emscripten SDK -$urlEmscriptenExternal="https://github.com/emscripten-core/emscripten/archive/$version.zip" -$urlCache = "http://ci-files01-hki.intra.qt.io/input/emsdk" - -$urlEmscriptenCache="$urlCache/emscripten.$version.zip" - -$urlWasmBinariesExternal="$urlEmscripten/win/$versionTag/wasm-binaries.zip" -$urlWasmBinariesCache="$urlCache/windows/wasm-binaries.$version.zip" -$sha1WasmBinaries="a6f3f49df50fe7c8a0e61065b80fd885b8266bf3" - -$urlOfficialNode = "$urlEmscripten/deps/node-v$versionNode-win-x64.zip" -$urlCacheNode = "$urlCache/windows/node-v$versionNode-win-x64.zip" -$sha1Node = "7df0af8aa3c128cff43d77dd6f3a163d405d0469" - -$urlOfficialWinPython = "$urlEmscripten/deps/python-$versionWinPython-embed-amd64-patched.zip" -$urlCacheWinPython = "$urlCache/windows/python-$versionWinPython-embed-amd64-patched.zip" -$sha1WinPython = "27C5A465390167FC03F3DD9075E3FDAAD9FBE104" - -$urlOfficialProtableJre = "$urlEmscripten/deps/portable_jre_${versionJre}_64bit.zip" -$urlCacheProtableJre = "$urlCache/windows/portable_jre_${versionJre}_64bit.zip" -$sha1ProtableJre = "6830524ec8b16742f956897abb6b6f5ef890a1c2" +# Make sure python is in the path +Prepend-Path "C:\Python27" +cd "C:\\Utils" +C:\PROGRA~1\Git\bin\git clone https://github.com/emscripten-core/emsdk.git $installLocationEmsdk = "C:\\Utils\\emsdk" -$temp = "C:\\Windows\\Temp" - -function Install { - - Param ( - [string] $urlOfficial = $(BadParam("Official url path")), - [string] $urlCache = $(BadParam("Cached url path")), - [string] $sha1 = $(BadParam("SHA1 checksum of the file")), - [string] $location = $(BadParam("Download location")), - [string] $installLocation = $(BadParam("Install location")) - ) - - Download $urlOfficial $urlCache $location - Verify-Checksum $location $sha1 - Extract-7Zip $location $installLocation - -} - -New-Item -ItemType directory -Force -Path "$installLocationEmsdk" - -Install $urlWasmBinariesExternal $urlWasmBinariesCache $sha1WasmBinaries "$temp\wasm-binaries.$version.zip" "$installLocationEmsdk\emscripten-llvm-e$version" -Install $urlOfficialNode $urlCacheNode $sha1Node "$temp\node-v$versionNode-win-x64.zip" "$installLocationEmsdk" -Install $urlOfficialWinPython $urlCacheWinPython $sha1WinPython "$temp\python-$versionWinPython-embed-amd64-patched.zip" "$installLocationEmsdk\python-$versionWinPython-embed-amd64-patched" -Install $urlOfficialProtableJre $urlCacheProtableJre $sha1ProtableJre "$temp\portable_jre_$versionJre_64bit.zip" "$installLocationEmsdk" - -cd $installLocationEmsdk\emscripten-llvm-e$version\install\emscripten -"emsdk_path = '$installLocationEmsdk'"| Out-File '.emscripten' -Append -Encoding ascii -"LLVM_ROOT = emsdk_path + '/emscripten-llvm-e$version/install/bin'" | Out-File '.emscripten' -Append -Encoding ascii -"BINARYEN_ROOT = emsdk_path + '/emscripten-llvm-e$version/install'" | Out-File '.emscripten' -Append -Encoding ascii -"PYTHON = emsdk_path + '/python-$versionWinPython-embed-amd64-patched/python.exe'" | Out-File '.emscripten' -Append -Encoding ascii -"NODE_JS = emsdk_path + '/node-v$versionNode-win-x64/bin/node.exe'" | Out-File '.emscripten' -Append -Encoding ascii -"EMSCRIPTEN_ROOT = emsdk_path +'' " | Out-File '.emscripten' -Append -Encoding ascii -"JAVA = emsdk_path + '/Java64'" | Out-File '.emscripten' -Append -Encoding ascii -"TEMP_DIR = '/tmp'" | Out-File '.emscripten' -Append -Encoding ascii -"COMPILER_ENGINE = NODE_JS" | Out-File '.emscripten' -Append -Encoding ascii -"JS_ENGINES = [NODE_JS]" | Out-File '.emscripten' -Append -Encoding ascii - -Set-EnvironmentVariable "EMSDK" "$installLocationEmsdk\emscripten-llvm-e$version\install\emscripten" -Set-EnvironmentVariable "EM_CONFIG" "$installLocationEmsdk\emscripten-llvm-e$version\install\emscripten\.emscripten" -Set-EnvironmentVariable "EMSDK_CACHE" "$installLocationEmsdk\emscripten-llvm-e$version\install\emscripten\cache" -Set-EnvironmentVariable "EMSDK_NODE" "$installLocationEmsdk\node$versionNode-win-x64\bin\node.exe" -Set-EnvironmentVariable "EMSDK_PYTHON" "$installLocationEmsdk\python-$versionWinPython-embed-amd64-patched\python.exe" -Set-EnvironmentVariable "EMSDK_JAVA_HOME" "$installLocationEmsdk\java64" -Set-EnvironmentVariable "EMSDK_PATH" "$installLocationEmsdk\emscripten-llvm-e$version\install\emscripten;$installLocationEmsdk\node$versionNode-win-x64\bin;$installLocationEmsdk\emscripten-llvm-e$version\install\bin;$installLocationEmsdk\python-$versionWinPython-embed-amd64-patched;$installLocationEmsdk\java64\bin;$PATH" - +cd $installLocationEmsdk +.\emsdk install $version +.\emsdk activate $version + +Set-EnvironmentVariable "EMSDK" "$installLocationEmsdk" +Set-EnvironmentVariable "EM_CONFIG" "$installLocationEmsdk\.emscripten" +Set-EnvironmentVariable "EMSDK_NODE" "$installLocationEmsdk\node\${versionNode}_64bit\bin\node.exe" +Set-EnvironmentVariable "EMSDK_PYTHON" "$installLocationEmsdk\python\${versionWinPython}_64bit\python.exe" +Set-EnvironmentVariable "EMSDK_JAVA_HOME" "$installLocationEmsdk\java\${versionJre}_64bit" +Set-EnvironmentVariable "EMSDK_PATH" "$installLocationEmsdk;$installLocationEmsdk\node\${versionNode}_64bit\bin;$installLocationEmsdk\upstream\emscripten;$PATH" Add-Path "$env:EMSDK_PATH" # These can be removed when installing emsdk using emsdk.git @@ -119,7 +65,6 @@ Set-Content -Path C:\Utils\emsdk\emsdk_env.bat -Value ":: This file will have en Set-Content -Path C:\Utils\emsdk\emsdk_env.bat -Value "echo nothing to run at this point" -Encoding ASCII Write-Output "emsdk = $version" >> ~/versions.txt -Write-Output "emsdk llvm = $version" >> ~/versions.txt Write-Output "emsdk NodeJs = $versionNode" >> ~/versions.txt Write-Output "emsdk WinPython 64bit = $versionWinPython" >> ~/versions.txt Write-Output "emsdk portable jre = $versionJre" >> ~/versions.txt diff --git a/coin/provisioning/common/windows/install-git.ps1 b/coin/provisioning/common/windows/install-git.ps1 index cbdcb587..a5d666fe 100644 --- a/coin/provisioning/common/windows/install-git.ps1 +++ b/coin/provisioning/common/windows/install-git.ps1 @@ -1,6 +1,6 @@ ############################################################################# ## -## Copyright (C) 2018 The Qt Company Ltd. +## Copyright (C) 2021 The Qt Company Ltd. ## Contact: http://www.qt.io/licensing/ ## ## This file is part of the provisioning scripts of the Qt Toolkit. -- cgit v1.2.3