From 9bd2132cfa62c53b8ec902ebe9469ea57a121eb4 Mon Sep 17 00:00:00 2001 From: Jon Turney Date: Thu, 8 Nov 2018 18:38:33 +0000 Subject: [PATCH 1/7] azure: Rewrite importing visual studio environment variables Rewrite this in a cruder way that doesn't require installing things (and so can work with the vs2015 image) --- ci/azure-steps.yml | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/ci/azure-steps.yml b/ci/azure-steps.yml index 630376136..40904584d 100644 --- a/ci/azure-steps.yml +++ b/ci/azure-steps.yml @@ -51,14 +51,23 @@ steps: $origPath = $env:Path # import visual studio variables if ($env:compiler -eq 'msvc2015') { - $vsver = $env:compiler.Replace('msvc', '') + $vcvars = "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" } else { - $vsver = '2017' + $vcvars = "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" } - Set-PSRepository -Name PSGallery -InstallationPolicy Trusted - Install-Module Pscx -Scope CurrentUser -AllowClobber - Install-Module VSSetup -Scope CurrentUser - Import-VisualStudioVars -VisualStudioVersion $vsver -Architecture $(arch) + + ## ask cmd.exe to output the environment table after the batch file completes + $tempFile = [IO.Path]::GetTempFileName() + cmd /c " `"$vcvars`" $env:arch && set > `"$tempFile`" " + + ## go through the environment variables in the temp file. + ## for each of them, set the variable in our local environment. + Get-Content $tempFile | Foreach-Object { + if($_ -match "^(.*?)=(.*)$") { + Set-Content "env:\$($matches[1])" $matches[2] + } + } + Remove-Item $tempFile if ($env:compiler -eq 'clang-cl') { # drop visual studio from PATH From 5ec4da7829e27325661448240db14be59053f54b Mon Sep 17 00:00:00 2001 From: Jon Turney Date: Thu, 8 Nov 2018 18:39:56 +0000 Subject: [PATCH 2/7] azure: Install python3 for vs2015 image We can't run the standard python installer on the vs2015 image, so we use an installation of chocolately python3 instead --- ci/azure-steps.yml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/ci/azure-steps.yml b/ci/azure-steps.yml index 40904584d..1c7e125ca 100644 --- a/ci/azure-steps.yml +++ b/ci/azure-steps.yml @@ -1,10 +1,5 @@ steps: - powershell: | - # test_find_program exercises some behaviour which relies on .py being in PATHEXT - $env:PATHEXT += ';.py' - - where.exe python - python ./skip_ci.py --base-branch-env=SYSTEM_PULLREQUEST_TARGETBRANCH --is-pull-env=SYSTEM_PULLREQUEST_PULLREQUESTID --base-branch-origin if ($LastExitCode -ne 0) { throw ('error in skip_ci.py') @@ -45,6 +40,17 @@ steps: Set-Content "env:$p" "$v" } + # download and install python3 and add to path (since it's not installed in vs2015 image!) + if ($env:compiler -eq 'msvc2015') { + Set-ExecutionPolicy Bypass -Scope Process -Force + iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) + choco install python3 -y --no-progress --params "/InstallDir:C:\Python3" + $env:Path = "C:\Python3;$env:Path" + } + + # test_find_program exercises some behaviour which relies on .py being in PATHEXT + $env:PATHEXT += ';.py' + # add downloads to PATH $env:Path = "$env:SYSTEM_WORKFOLDER;$env:Path" @@ -97,6 +103,9 @@ steps: MSBuild /version } + where.exe python + python --version + python run_tests.py --backend $(backend) echo "##vso[task.setvariable variable=test_status]$LastExitCode" From a59978cfa2287fe2c116cd9edf53559306692fe9 Mon Sep 17 00:00:00 2001 From: Jon Turney Date: Wed, 10 Oct 2018 18:00:45 +0100 Subject: [PATCH 3/7] azure: Enable vs2015 jobs Don't run MPI runtime installer, which fails with vs2015 image --- azure-pipelines.yml | 36 ++++++++++++++++++------------------ ci/azure-steps.yml | 7 +++++-- 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 5f7e3c424..abfd1a326 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -10,24 +10,24 @@ variables: CI: 1 jobs: -#- job: vs2015 -# pool: -# vmImage: vs2015-win2012r2 -# -# strategy: -# maxParallel: 10 -# matrix: -# vc2015x86ninja: -# arch: x86 -# compiler: msvc2015 -# backend: ninja -# vc2015x86vs: -# arch: x86 -# compiler: msvc2015 -# backend: vs2015 -# -# steps: -# - template: ci/azure-steps.yml +- job: vs2015 + pool: + vmImage: vs2015-win2012r2 + + strategy: + maxParallel: 10 + matrix: + vc2015x86ninja: + arch: x86 + compiler: msvc2015 + backend: ninja + vc2015x86vs: + arch: x86 + compiler: msvc2015 + backend: vs2015 + + steps: + - template: ci/azure-steps.yml - job: vs2017 pool: diff --git a/ci/azure-steps.yml b/ci/azure-steps.yml index 1c7e125ca..db532c81c 100644 --- a/ci/azure-steps.yml +++ b/ci/azure-steps.yml @@ -31,8 +31,11 @@ steps: DownloadFile -Source 'http://nirbheek.in/files/binaries/pkg-config/win32/pkg-config.exe' -Destination $(System.WorkFolder)\pkg-config.exe DownloadFile -Source 'https://download.microsoft.com/download/D/B/B/DBB64BA1-7B51-43DB-8BF1-D1FB45EACF7A/msmpisdk.msi' -Destination msmpisdk.msi DownloadFile -Source 'https://download.microsoft.com/download/D/B/B/DBB64BA1-7B51-43DB-8BF1-D1FB45EACF7A/MSMpiSetup.exe' -Destination MSMpiSetup.exe - Start-Process msiexec.exe -ArgumentList '/i msmpisdk.msi /quiet' -Wait - Start-Process .\MSMpiSetup.exe -ArgumentList '-unattend -full' -Wait + if ($env:compiler -ne 'msvc2015') { + Start-Process msiexec.exe -ArgumentList '/i msmpisdk.msi /quiet' -Wait + # installer fails "requires an interactive window station" with vs2015 image + Start-Process .\MSMpiSetup.exe -ArgumentList '-unattend -full' -Wait + } # import ms-mpi env vars (set by installer) foreach ($p in "MSMPI_INC", "MSMPI_LIB32", "MSMPI_LIB64") { From 3354a64056360acf3402a3d5c987c53c9f9b8c2d Mon Sep 17 00:00:00 2001 From: Jon Turney Date: Thu, 8 Nov 2018 23:53:58 +0000 Subject: [PATCH 4/7] azure: Match release branch names as well --- azure-pipelines.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index abfd1a326..bab9bfa1f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -4,6 +4,8 @@ trigger: branches: include: - 'master' + # Release branches + - '0.*' variables: MESON_FIXED_NINJA: 1 From bb01b10a27a5a0d7bf5a7193fb27cd9dad18274d Mon Sep 17 00:00:00 2001 From: Jon Turney Date: Thu, 8 Nov 2018 23:58:34 +0000 Subject: [PATCH 5/7] azure: Simplify how we always publish test results Use a more concise way of always publishing test results, even when tests failed --- ci/azure-steps.yml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/ci/azure-steps.yml b/ci/azure-steps.yml index db532c81c..8bd8c76c1 100644 --- a/ci/azure-steps.yml +++ b/ci/azure-steps.yml @@ -111,28 +111,21 @@ steps: python run_tests.py --backend $(backend) - echo "##vso[task.setvariable variable=test_status]$LastExitCode" - - continueOnError: true - - task: PublishTestResults@2 inputs: testResultsFiles: meson-test-run.xml testRunTitle: $(System.JobName) publishRunAttachments: true + condition: not(canceled()) - task: CopyFiles@2 inputs: contents: 'meson-test-run.*' targetFolder: $(Build.ArtifactStagingDirectory) + condition: not(canceled()) - task: PublishBuildArtifacts@1 inputs: artifactName: $(System.JobName) # publishing artifacts from PRs from a fork is currently blocked condition: eq(variables['system.pullrequest.isfork'], false) - -- powershell: | - # after publishing test results, even if some failed - # exit with the test status - exit $(test_status) From 7f9aa9208cdefba78203e450f0573df84aeda5c9 Mon Sep 17 00:00:00 2001 From: Jon Turney Date: Tue, 13 Nov 2018 13:57:26 +0000 Subject: [PATCH 6/7] azure: Remove unneeded maxParallel Default is unlimited, not 1 --- azure-pipelines.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index bab9bfa1f..9cc01a1ba 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -17,7 +17,6 @@ jobs: vmImage: vs2015-win2012r2 strategy: - maxParallel: 10 matrix: vc2015x86ninja: arch: x86 @@ -36,7 +35,6 @@ jobs: vmImage: VS2017-Win2016 strategy: - maxParallel: 10 matrix: vc2017x64ninja: arch: x64 From eab97e0c4441923c2cb09838488da0f34dab497a Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Thu, 8 Nov 2018 17:42:02 +0100 Subject: [PATCH 7/7] Workaround python 3.7.1 requiring that PYTHONPATH end in os.sep --- run_meson_command_tests.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/run_meson_command_tests.py b/run_meson_command_tests.py index 390868a91..6dc7964da 100755 --- a/run_meson_command_tests.py +++ b/run_meson_command_tests.py @@ -124,7 +124,9 @@ class CommandTests(unittest.TestCase): pylibdir = prefix / get_pypath() bindir = prefix / get_pybindir() pylibdir.mkdir(parents=True) - os.environ['PYTHONPATH'] = str(pylibdir) + # XXX: join with empty name so it always ends with os.sep otherwise + # distutils complains that prefix isn't contained in PYTHONPATH + os.environ['PYTHONPATH'] = os.path.join(str(pylibdir), '') os.environ['PATH'] = str(bindir) + os.pathsep + os.environ['PATH'] self._run(python_command + ['setup.py', 'install', '--prefix', str(prefix)]) # Check that all the files were installed correctly