From f8e075a67932714c35764b098045c276c26c0c2e Mon Sep 17 00:00:00 2001 From: Konstantin Tokarev Date: Wed, 16 Nov 2016 16:32:17 +0300 Subject: Install conan from pip instead of exe This allows us to get it working on 32-bit Windows. Also renamed conan.ps1 and python.ps1 to get proper provisioning order. Change-Id: I2f21db7dd0edbacb4e44024d1c70b315fba55801 Reviewed-by: Simon Hausmann --- coin/provisioning/common/02-python.ps1 | 64 ++++++++++++++++++++++ coin/provisioning/common/03-conan.ps1 | 46 ++++++++++++++++ coin/provisioning/common/conan.ps1 | 50 ----------------- coin/provisioning/common/python.ps1 | 64 ---------------------- coin/provisioning/qtci-windows-10-x86/conan.ps1 | 2 +- coin/provisioning/qtci-windows-10-x86/python.ps1 | 2 +- coin/provisioning/qtci-windows-10-x86_64/conan.ps1 | 2 +- .../provisioning/qtci-windows-10-x86_64/python.ps1 | 2 +- coin/provisioning/qtci-windows-7-x86/conan.ps1 | 2 +- coin/provisioning/qtci-windows-7-x86/python.ps1 | 2 +- coin/provisioning/qtci-windows-8-x86/python.ps1 | 2 +- coin/provisioning/qtci-windows-8-x86_64/python.ps1 | 2 +- 12 files changed, 118 insertions(+), 122 deletions(-) create mode 100644 coin/provisioning/common/02-python.ps1 create mode 100644 coin/provisioning/common/03-conan.ps1 delete mode 100644 coin/provisioning/common/conan.ps1 delete mode 100644 coin/provisioning/common/python.ps1 diff --git a/coin/provisioning/common/02-python.ps1 b/coin/provisioning/common/02-python.ps1 new file mode 100644 index 00000000..39d8146d --- /dev/null +++ b/coin/provisioning/common/02-python.ps1 @@ -0,0 +1,64 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: http://www.qt.io/licensing/ +## +## This file is part of the test suite of the Qt Toolkit. +## +## $QT_BEGIN_LICENSE:LGPL21$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see http://www.qt.io/terms-conditions. For further +## information use the contact form at http://www.qt.io/contact-us. +## +## GNU Lesser General Public License Usage +## Alternatively, this file may be used under the terms of the GNU Lesser +## General Public License version 2.1 or version 3 as published by the Free +## Software Foundation and appearing in the file LICENSE.LGPLv21 and +## LICENSE.LGPLv3 included in the packaging of this file. Please review the +## following information to ensure the GNU Lesser General Public License +## requirements will be met: https://www.gnu.org/licenses/lgpl.html and +## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +## +## As a special exception, The Qt Company gives you certain additional +## rights. These rights are described in The Qt Company LGPL Exception +## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +## +## $QT_END_LICENSE$ +## +############################################################################# + +. "$PSScriptRoot\helpers.ps1" + +# This script installs Python $version. +# Python is required for building Qt 5 from source. + +$version = "2.7.10" +$package = "C:\Windows\temp\python-$version.msi" + +# check bit version +if ([System.Environment]::Is64BitProcess -eq $TRUE) { + $externalUrl = "https://www.python.org/ftp/python/$version/python-$version.amd64.msi" + $internalUrl = "http://ci-files01-hki.ci.local/input/windows/python-$version.amd64.msi" + $sha1 = "f3a474f6ab191f9b43034c0fb5c98301553775d4" +} +else { + $externalUrl = "https://www.python.org/ftp/python/$version/python-$version.msi" + $internalUrl = "http://ci-files01-hki.ci.local/input/windows/python-$version.msi" + $sha1 = "9e62f37407e6964ee0374b32869b7b4ab050d12a" +} + +echo "Fetching from URL..." +Download $externalUrl $internalUrl $package +Verify-Checksum $package $sha1 +echo "Installing $package..." +cmd /c "$package /q" +# We need to change allowZip64 from 'False' to 'True' to be able to create ZIP files that use the ZIP64 extensions when the zipfile is larger than 2 GB +echo "Chancing allowZip64 value to 'True'..." +(Get-Content C:\Python27\lib\zipfile.py) | ForEach-Object { $_ -replace "allowZip64=False", "allowZip64=True" } | Set-Content C:\Python27\lib\zipfile.py +echo "Remove $package..." +del $package +Add-Path $path diff --git a/coin/provisioning/common/03-conan.ps1 b/coin/provisioning/common/03-conan.ps1 new file mode 100644 index 00000000..3c1dbbcf --- /dev/null +++ b/coin/provisioning/common/03-conan.ps1 @@ -0,0 +1,46 @@ +. "$PSScriptRoot\helpers.ps1" + +& pip install --upgrade conan==0.15.0 + +[Environment]::SetEnvironmentVariable("CI_CONAN_BUILDINFO_DIR", "C:\Utils\conanbuildinfos", "Machine") + +function Start-Process-Logged +{ + Write-Host "Start-Process", $args + Start-Process @args +} + +function Run-Conan-Install +{ + Param ( + [string]$ConanfilesDir, + [string]$BuildinfoDir, + [string]$Arch, + [string]$Compiler, + [string]$CompilerVersion, + [string]$CompilerRuntime, + [string]$CompilerLibcxx + ) + + if ($CompilerRuntime) { + $extraArgs = "-s compiler.runtime=$($CompilerRuntime)" + } + + if ($CompilerLibcxx) { + $extraArgs = "-s compiler.libcxx=$($CompilerLibcxx)" + } + + Get-ChildItem -Path "$ConanfilesDir\*.txt" | + ForEach-Object { + $outpwd = "C:\Utils\conanbuildinfos\$($BuildinfoDir)\$($_.BaseName)" + $manifestsDir = "$($_.DirectoryName)\$($_.BaseName).manifests" + New-Item $outpwd -Type directory -Force + Start-Process-Logged ` + conan ` + -WorkingDirectory $outpwd ` + -ArgumentList "install -f $($_.FullName) --verify $($manifestsDir)", ` + '-s', ('compiler="' + $Compiler + '"'), ` + "-s os=Windows -s arch=$($Arch) -s compiler.version=$($CompilerVersion) $($extraArgs)" ` + -NoNewWindow -Wait -Verbose + } +} diff --git a/coin/provisioning/common/conan.ps1 b/coin/provisioning/common/conan.ps1 deleted file mode 100644 index 086af1ec..00000000 --- a/coin/provisioning/common/conan.ps1 +++ /dev/null @@ -1,50 +0,0 @@ -. "$PSScriptRoot\helpers.ps1" - -$installer = "c:\users\qt\downloads\conan-win_0_15_0.exe" - -Download https://github.com/conan-io/conan/releases/download/0.15.0/conan-win_0_15_0.exe http://ci-files01-hki.ci.local/input/windows/conan/conan-win_0_15_0.exe $installer -Verify-Checksum $installer "AE8DB31B34A9B88EA227F0FE283FC0F003D2BFDD" -& $installer /DIR=C:\Utils\Conan /VERYSILENT | Out-Null - -[Environment]::SetEnvironmentVariable("CI_CONAN_BUILDINFO_DIR", "C:\Utils\conanbuildinfos", "Machine") - -function Start-Process-Logged -{ - Write-Host "Start-Process", $args - Start-Process @args -} - -function Run-Conan-Install -{ - Param ( - [string]$ConanfilesDir, - [string]$BuildinfoDir, - [string]$Arch, - [string]$Compiler, - [string]$CompilerVersion, - [string]$CompilerRuntime, - [string]$CompilerLibcxx - ) - - if ($CompilerRuntime) { - $extraArgs = "-s compiler.runtime=$($CompilerRuntime)" - } - - if ($CompilerLibcxx) { - $extraArgs = "-s compiler.libcxx=$($CompilerLibcxx)" - } - - Get-ChildItem -Path "$ConanfilesDir\*.txt" | - ForEach-Object { - $outpwd = "C:\Utils\conanbuildinfos\$($BuildinfoDir)\$($_.BaseName)" - $manifestsDir = "$($_.DirectoryName)\$($_.BaseName).manifests" - New-Item $outpwd -Type directory -Force - Start-Process-Logged ` - "C:\Utils\Conan\conan\conan.exe" ` - -WorkingDirectory $outpwd ` - -ArgumentList "install -f $($_.FullName) --verify $($manifestsDir)", ` - '-s', ('compiler="' + $Compiler + '"'), ` - "-s os=Windows -s arch=$($Arch) -s compiler.version=$($CompilerVersion) $($extraArgs)" ` - -NoNewWindow -Wait -Verbose - } -} diff --git a/coin/provisioning/common/python.ps1 b/coin/provisioning/common/python.ps1 deleted file mode 100644 index 39d8146d..00000000 --- a/coin/provisioning/common/python.ps1 +++ /dev/null @@ -1,64 +0,0 @@ -############################################################################# -## -## Copyright (C) 2016 The Qt Company Ltd. -## Contact: http://www.qt.io/licensing/ -## -## This file is part of the test suite of the Qt Toolkit. -## -## $QT_BEGIN_LICENSE:LGPL21$ -## Commercial License Usage -## Licensees holding valid commercial Qt licenses may use this file in -## accordance with the commercial license agreement provided with the -## Software or, alternatively, in accordance with the terms contained in -## a written agreement between you and The Qt Company. For licensing terms -## and conditions see http://www.qt.io/terms-conditions. For further -## information use the contact form at http://www.qt.io/contact-us. -## -## GNU Lesser General Public License Usage -## Alternatively, this file may be used under the terms of the GNU Lesser -## General Public License version 2.1 or version 3 as published by the Free -## Software Foundation and appearing in the file LICENSE.LGPLv21 and -## LICENSE.LGPLv3 included in the packaging of this file. Please review the -## following information to ensure the GNU Lesser General Public License -## requirements will be met: https://www.gnu.org/licenses/lgpl.html and -## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -## -## As a special exception, The Qt Company gives you certain additional -## rights. These rights are described in The Qt Company LGPL Exception -## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -## -## $QT_END_LICENSE$ -## -############################################################################# - -. "$PSScriptRoot\helpers.ps1" - -# This script installs Python $version. -# Python is required for building Qt 5 from source. - -$version = "2.7.10" -$package = "C:\Windows\temp\python-$version.msi" - -# check bit version -if ([System.Environment]::Is64BitProcess -eq $TRUE) { - $externalUrl = "https://www.python.org/ftp/python/$version/python-$version.amd64.msi" - $internalUrl = "http://ci-files01-hki.ci.local/input/windows/python-$version.amd64.msi" - $sha1 = "f3a474f6ab191f9b43034c0fb5c98301553775d4" -} -else { - $externalUrl = "https://www.python.org/ftp/python/$version/python-$version.msi" - $internalUrl = "http://ci-files01-hki.ci.local/input/windows/python-$version.msi" - $sha1 = "9e62f37407e6964ee0374b32869b7b4ab050d12a" -} - -echo "Fetching from URL..." -Download $externalUrl $internalUrl $package -Verify-Checksum $package $sha1 -echo "Installing $package..." -cmd /c "$package /q" -# We need to change allowZip64 from 'False' to 'True' to be able to create ZIP files that use the ZIP64 extensions when the zipfile is larger than 2 GB -echo "Chancing allowZip64 value to 'True'..." -(Get-Content C:\Python27\lib\zipfile.py) | ForEach-Object { $_ -replace "allowZip64=False", "allowZip64=True" } | Set-Content C:\Python27\lib\zipfile.py -echo "Remove $package..." -del $package -Add-Path $path diff --git a/coin/provisioning/qtci-windows-10-x86/conan.ps1 b/coin/provisioning/qtci-windows-10-x86/conan.ps1 index d5f5f9e2..4ba6c70c 100644 --- a/coin/provisioning/qtci-windows-10-x86/conan.ps1 +++ b/coin/provisioning/qtci-windows-10-x86/conan.ps1 @@ -1,4 +1,4 @@ -. "$PSScriptRoot\..\common\conan.ps1" +. "$PSScriptRoot\..\common\03-conan.ps1" Run-Conan-Install ` -ConanfilesDir "$PSScriptRoot\conanfiles" ` diff --git a/coin/provisioning/qtci-windows-10-x86/python.ps1 b/coin/provisioning/qtci-windows-10-x86/python.ps1 index 5f8aa2f8..0e401c02 100644 --- a/coin/provisioning/qtci-windows-10-x86/python.ps1 +++ b/coin/provisioning/qtci-windows-10-x86/python.ps1 @@ -1 +1 @@ -. "$PSScriptRoot\..\common\python.ps1" +. "$PSScriptRoot\..\common\02-python.ps1" diff --git a/coin/provisioning/qtci-windows-10-x86_64/conan.ps1 b/coin/provisioning/qtci-windows-10-x86_64/conan.ps1 index 9cf4fbf1..78de7043 100644 --- a/coin/provisioning/qtci-windows-10-x86_64/conan.ps1 +++ b/coin/provisioning/qtci-windows-10-x86_64/conan.ps1 @@ -1,4 +1,4 @@ -. "$PSScriptRoot\..\common\conan.ps1" +. "$PSScriptRoot\..\common\03-conan.ps1" Run-Conan-Install ` -ConanfilesDir "$PSScriptRoot\conanfiles" ` diff --git a/coin/provisioning/qtci-windows-10-x86_64/python.ps1 b/coin/provisioning/qtci-windows-10-x86_64/python.ps1 index 5f8aa2f8..0e401c02 100644 --- a/coin/provisioning/qtci-windows-10-x86_64/python.ps1 +++ b/coin/provisioning/qtci-windows-10-x86_64/python.ps1 @@ -1 +1 @@ -. "$PSScriptRoot\..\common\python.ps1" +. "$PSScriptRoot\..\common\02-python.ps1" diff --git a/coin/provisioning/qtci-windows-7-x86/conan.ps1 b/coin/provisioning/qtci-windows-7-x86/conan.ps1 index 7421b2da..163739fa 100644 --- a/coin/provisioning/qtci-windows-7-x86/conan.ps1 +++ b/coin/provisioning/qtci-windows-7-x86/conan.ps1 @@ -1,4 +1,4 @@ -. "$PSScriptRoot\..\common\conan.ps1" +. "$PSScriptRoot\..\common\03-conan.ps1" Run-Conan-Install ` -ConanfilesDir "$PSScriptRoot\conanfiles" ` diff --git a/coin/provisioning/qtci-windows-7-x86/python.ps1 b/coin/provisioning/qtci-windows-7-x86/python.ps1 index 5f8aa2f8..0e401c02 100644 --- a/coin/provisioning/qtci-windows-7-x86/python.ps1 +++ b/coin/provisioning/qtci-windows-7-x86/python.ps1 @@ -1 +1 @@ -. "$PSScriptRoot\..\common\python.ps1" +. "$PSScriptRoot\..\common\02-python.ps1" diff --git a/coin/provisioning/qtci-windows-8-x86/python.ps1 b/coin/provisioning/qtci-windows-8-x86/python.ps1 index 5f8aa2f8..0e401c02 100644 --- a/coin/provisioning/qtci-windows-8-x86/python.ps1 +++ b/coin/provisioning/qtci-windows-8-x86/python.ps1 @@ -1 +1 @@ -. "$PSScriptRoot\..\common\python.ps1" +. "$PSScriptRoot\..\common\02-python.ps1" diff --git a/coin/provisioning/qtci-windows-8-x86_64/python.ps1 b/coin/provisioning/qtci-windows-8-x86_64/python.ps1 index 5f8aa2f8..0e401c02 100644 --- a/coin/provisioning/qtci-windows-8-x86_64/python.ps1 +++ b/coin/provisioning/qtci-windows-8-x86_64/python.ps1 @@ -1 +1 @@ -. "$PSScriptRoot\..\common\python.ps1" +. "$PSScriptRoot\..\common\02-python.ps1" -- cgit v1.2.3