Provisioning: Refactor libclang installation

Libclang must use cached url (ci-files01-hki) to reduce the download time
Libclang release_60 versions were rebuild which requires sha1 changes

Task-number: QTQAINFRA-1966
Task-number: QTQAINFRA-2100
Change-Id: Iddf47a2a3a5bc38dbed684320120164bb40c028c
Reviewed-by: Simo Fält <simo.falt@qt.io>
This commit is contained in:
Heikki Halmet
2018-04-30 09:28:12 +03:00
committed by Liang Qi
parent 72d711356c
commit 4a7366f960
9 changed files with 63 additions and 87 deletions

View File

@@ -1 +0,0 @@
libclang_version="6.0"

View File

@@ -42,30 +42,37 @@ set -e
# shellcheck source=./check_and_set_proxy.sh
source "${BASH_SOURCE%/*}/check_and_set_proxy.sh"
# shellcheck source=./SetEnvVar.sh
source "${BASH_SOURCE%/*}/SetEnvVar.sh"
# shellcheck source=./DownloadURL.sh
source "${BASH_SOURCE%/*}/DownloadURL.sh"
BASEDIR=$(dirname "$0")
# shellcheck source=../shared/sw_versions.txt
. "$BASEDIR/../shared/sw_versions.txt"
url=$1
sha1=$2
version=$3
if [ $# -eq 0 ]
then
# The default values are for macOS package
echo "Using macOS defaults"
libclang_version=6.0
libclang_version_Rhel6=4.0
if uname -a |grep -q Darwin; then
version=$libclang_version
url="https://download.qt.io/development_releases/prebuilt/libclang/libclang-release_${version//\./}-mac.7z"
sha1="10e48167b61726b20517172f8aff80fa1d9a379b"
url="https://download.qt.io/development_releases/prebuilt/libclang/qt/libclang-release_${version//\./}-mac.7z"
url_cached="http://ci-files01-hki.intra.qt.io/input/libclang/qt/libclang-release_${version//\./}-mac.7z"
sha1="0af8ab8c1174faf4b721d079587190fc32ea8364"
elif uname -a |grep -q "el6"; then
version=$libclang_version_Rhel6
url="https://download.qt.io/development_releases/prebuilt/libclang/qt/libclang-release_${version//\./}-linux-Rhel6.6-gcc4.9-x86_64.7z"
url_cached="http://ci-files01-hki.intra.qt.io/input/libclang/qt/libclang-release_${version//\./}-linux-Rhel6.6-gcc4.9-x86_64.7z"
sha1="c7466109628418a6aa3db8b3f5825f847f1c4952"
else
version=$libclang_version
url="https://download.qt.io/development_releases/prebuilt/libclang/qt/libclang-release_${version//\./}-linux-Rhel7.2-gcc5.3-x86_64.7z"
url_cached="http://ci-files01-hki.intra.qt.io/input/libclang/qt/libclang-release_${version//\./}-linux-Rhel7.2-gcc5.3-x86_64.7z"
sha1="ef59b699f4fcce2e45108b3ff04cc7471c1c4abe"
fi
zip="libclang.7z"
zip="/tmp/libclang.7z"
destination="/usr/local/libclang-$version"
curl --fail -L --retry 5 --retry-delay 5 -o "$zip" "$url"
echo "$sha1 $zip" | sha1sum --check
7z x "$zip" -o/tmp/
rm -rf "$zip"
DownloadURL $url_cached $url $sha1 $zip
7z x $zip -o/tmp/
rm -rf $zip
sudo mv /tmp/libclang "$destination"

View File

@@ -5,79 +5,66 @@ param(
)
. "$PSScriptRoot\helpers.ps1"
$libclang_version="6.0"
# PySide versions following 5.6 use a C++ parser based on Clang (http://clang.org/).
# The Clang library (C-bindings), version 3.9 or higher is required for building.
# Starting from Qt 5.11 QDoc requires Clang to parse C++
Get-Content "$PSScriptRoot\..\shared\sw_versions.txt" | Foreach-Object {
$var = $_.Split('=')
New-Variable -Name $var[0] -Value $var[1] -Force
$libclang_version = $libclang_version -replace '["."]'
}
$zip = Get-DownloadLocation "libclang.7z"
$baseDestination = "C:\Utils\libclang-" + $libclang_version + "-" + $toolchain
function setURL() {
$script:url = "https://download.qt.io/development_releases/prebuilt/libclang/libclang-release_$libclang_version-windows-$toolchain`_$archVer.7z"
function install() {
param(
[string]$sha1=$1,
[string]$destination=$2
)
$zip = "c:\users\qt\downloads\libclang.7z"
$libclang_version = $libclang_version -replace '["."]'
$script:OfficialUrl = "https://download.qt.io/development_releases/prebuilt/libclang/qt/libclang-release_$libclang_version-windows-$toolchain`_$archVer.7z"
$script:CachedUrl = "http://ci-files01-hki.intra.qt.io/input/libclang/qt/libclang-release_$libclang_version-windows-$toolchain`_$archVer.7z"
Download $OfficialUrl $CachedUrl $zip
Verify-Checksum $zip $sha1
Extract-7Zip $zip C:\Utils\
Rename-Item C:\Utils\libclang $destination
Remove-Item -Force -Path $zip
}
$toolchainSuffix = ""
if ( $toolchain -eq "vs2015" ) {
if ( $archVer -eq 64 ) {
$sha1 = "37afa18d243a50c05bee5c6e16b409ed526ec17a"
$sha1 = "a399af949271e6d3bfc578ea2c17ff1d6c6318b9"
$destination = $baseDestination + "-64"
setURL
Download $url $url $zip
Verify-Checksum $zip $sha1
Extract-7Zip $zip C:\Utils\
Rename-Item C:\Utils\libclang $destination
Remove-Item -Force -Path $zip
install $sha1 $destination
}
$archVer=32
$sha1 = "812b6089c6da99ced9ebebbd42923bd96590519d"
$sha1 = "aa3f68f1cfa87780a4631a98ce883d3d9cb94330"
$destination = $baseDestination + "-32"
setURL
Download $url $url $zip
Verify-Checksum $zip $sha1
Extract-7Zip $zip C:\Utils\
Rename-Item C:\Utils\libclang $destination
Remove-Item -Force -Path $zip
install $sha1 $destination
$toolchainSuffix = "msvc"
}
if ( $toolchain -eq "mingw" ) {
if ( $archVer -eq 64 ) {
$sha1 = "1233e6c008b90d89483df0291a597a0bac426d29"
$sha1 = "b382502f82d1cfa7d3cc3016d909d37edc19c22c"
$destination = $baseDestination + "-64"
setURL
Download $url $url $zip
Verify-Checksum $zip $sha1
Extract-7Zip $zip C:\Utils\
Rename-Item C:\Utils\libclang $destination
Remove-Item -Force -Path $zip
install $sha1 $destination
}
$archVer=32
$sha1 = "2d6ceab0e1a05e2b19fe615c57b64d36977b4933"
$sha1 = "cbc68e0f93f4cb0ed7084a045b7c07a1980a2a44"
$destination = $baseDestination + "-32"
setURL
Download $url $url $zip
Verify-Checksum $zip $sha1
Extract-7Zip $zip C:\Utils\
Rename-Item C:\Utils\libclang $destination
Remove-Item -Force -Path $zip
install $sha1 $destination
$toolchainSuffix = "mingw"
}

View File

@@ -35,9 +35,5 @@
set -ex
BASEDIR=$(dirname "$0")
# With RHEL 6.6 we are using different lib clang than others
VERSION=4.0
URL="https://download.qt.io/development_releases/prebuilt/libclang/libclang-release_${VERSION//\./}-linux-Rhel6.6-gcc4.9-x86_64.7z"
SHA1="c7466109628418a6aa3db8b3f5825f847f1c4952"
# shellcheck source=../common/unix/libclang.sh
"$BASEDIR/../common/unix/libclang.sh" "$URL" "$SHA1" "$VERSION"

View File

@@ -2,10 +2,5 @@
set -ex
BASEDIR=$(dirname "$0")
# shellcheck source=../common/shared/sw_versions.txt
. "$BASEDIR/../common/shared/sw_versions.txt"
VERSION=$libclang_version
URL="https://download.qt.io/development_releases/prebuilt/libclang/libclang-release_${VERSION//\./}-linux-Rhel7.2-gcc5.3-x86_64.7z"
SHA1="71194c4d6065a62ac1a891123df79fd9da311bf0"
"$BASEDIR/../common/unix/libclang.sh" "$URL" "$SHA1" "$VERSION"
# shellcheck source=../common/unix/libclang.sh
"$BASEDIR/../common/unix/libclang.sh"

View File

@@ -1,9 +1,5 @@
#!/usr/bin/env bash
BASEDIR=$(dirname "$0")
. $BASEDIR/../common/shared/sw_versions.txt
VERSION=$libclang_version
URL="https://download.qt.io/development_releases/prebuilt/libclang/libclang-release_${VERSION//\./}-linux-Rhel7.2-gcc5.3-x86_64.7z"
SHA1="71194c4d6065a62ac1a891123df79fd9da311bf0"
$BASEDIR/../common/unix/libclang.sh "$URL" "$SHA1" "$VERSION"
# shellcheck source=../common/unix/libclang.sh
"$BASEDIR/../common/unix/libclang.sh"

View File

@@ -3,10 +3,5 @@
set -ex
BASEDIR=$(dirname "$0")
# shellcheck source=../common/shared/sw_versions.txt
. "$BASEDIR/../common/shared/sw_versions.txt"
VERSION=$libclang_version
URL="https://download.qt.io/development_releases/prebuilt/libclang/libclang-release_${VERSION//\./}-linux-Rhel7.2-gcc5.3-x86_64.7z"
SHA1="71194c4d6065a62ac1a891123df79fd9da311bf0"
"$BASEDIR/../common/unix/libclang.sh" "$URL" "$SHA1" "$VERSION"
# shellcheck source=../common/unix/libclang.sh
"$BASEDIR/../common/unix/libclang.sh"

View File

@@ -3,5 +3,5 @@
set -ex
BASEDIR=$(dirname "$0")
# There is only one mac package and common script uses it as a default
# There is only one mac package
$BASEDIR/../common/unix/libclang.sh

View File

@@ -3,5 +3,6 @@
set -ex
BASEDIR=$(dirname "$0")
# There is only one mac package and common script uses it as a default
$BASEDIR/../common/unix/libclang.sh
# There is only one mac package
# shellcheck source=../common/unix/libclang.sh
"$BASEDIR/../common/unix/libclang.sh"