diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2018-09-23 11:29:13 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-23 11:29:13 +0300 |
commit | 0543322fb43ed47d5d8afb1eff33366671e308a2 (patch) | |
tree | 8ef1188580027e5f55b3cd5b2d9a12e29834e7e5 | |
parent | 87370e1c934b92cc432a5e70d69080b113a90e0e (diff) | |
parent | 3563df04258b32c98a25185b9d59b14bacfb7ce6 (diff) | |
download | meson-0543322fb43ed47d5d8afb1eff33366671e308a2.zip meson-0543322fb43ed47d5d8afb1eff33366671e308a2.tar.gz meson-0543322fb43ed47d5d8afb1eff33366671e308a2.tar.bz2 |
Merge pull request #4158 from GoaLitiuM/d-windows-ci
Appveyor: Install DMD compiler
-rw-r--r-- | .appveyor.yml | 15 | ||||
-rw-r--r-- | ci/install-dmd.ps1 | 71 | ||||
-rw-r--r-- | test cases/failing/88 dub compiler/meson.build | 6 |
3 files changed, 92 insertions, 0 deletions
diff --git a/.appveyor.yml b/.appveyor.yml index 85725c3..78f9f33 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -105,6 +105,21 @@ install: - cmd: if %compiler%==cygwin ( set WRAPPER=ci\run-in-cygwin.bat ) - cmd: if %compiler%==cygwin ( %WRAPPER% which %PYTHON% ) else ( where %PYTHON% ) + # Setup D compiler and dub packages + - ps: | + If($Env:compiler.StartsWith('msvc') -and $Env:backend -eq 'ninja') { + & .\ci\install-dmd.ps1 + $arch = 'x86_mscoff' + If($Env:arch -eq 'x64') { + $arch = 'x86_64' + } + & dub fetch urld + & dub build urld --compiler=dmd --arch=$arch + & dub fetch dubtestproject + & dub build dubtestproject:test1 --compiler=dmd --arch=$arch + & dub build dubtestproject:test2 --compiler=dmd --arch=$arch + } + # pkg-config is needed for the pkg-config tests on msvc - ps: | If($Env:compiler.StartsWith('msvc')) { diff --git a/ci/install-dmd.ps1 b/ci/install-dmd.ps1 new file mode 100644 index 0000000..fc8226c --- /dev/null +++ b/ci/install-dmd.ps1 @@ -0,0 +1,71 @@ +param ( + [string]$Version = $null +) +Set-StrictMode -Version latest +$ErrorActionPreference = "Stop" +$ProgressPreference = "SilentlyContinue" + +# default installation directory +$dmd_install = "C:\D" +$dmd_version_file = "C:\cache\DMD_LATEST" + +#echo "Fetching latest DMD version..." +if (!$Version) { + $dmd_latest_url = "http://downloads.dlang.org/releases/LATEST" + $retries = 10 + for ($i = 1; $i -le $retries; $i++) { + try { + [system.io.directory]::CreateDirectory((Split-Path -parent $dmd_version_file)) > $null + Invoke-WebRequest -URI $dmd_latest_url -OutFile $dmd_version_file + break + } catch [net.WebException] { + if ($i -eq $retries) { + break + } + $backoff = (10 * $i) # backoff 10s, 20s, 30s... + echo ('{0}: {1}' -f $dmd_latest_url, $_.Exception.Message) + echo ('Retrying in {0}s...' -f $backoff) + Start-Sleep -m ($backoff * 1000) + } catch { + throw + } + } + if (Test-Path $dmd_version_file) { + $dmd_version = Get-Content -Path $dmd_version_file + } else { + throw "Failed to resolve latest DMD version" + } +} else { + $dmd_version = $Version +} +$dmd_url = "http://downloads.dlang.org/releases/2.x/$dmd_version/dmd.$dmd_version.windows.zip" +$dmd_filename = [System.IO.Path]::GetFileName($dmd_url) +$dmd_archive = Join-Path ($env:temp) $dmd_filename + +#echo "Downloading $dmd_filename..." +$retries = 10 +for ($i = 1; $i -le $retries; $i++) { + try { + (New-Object net.webclient).DownloadFile($dmd_url, $dmd_archive) + break + } catch [net.WebException] { + if ($i -eq $retries) { + throw # fail on last retry + } + $backoff = (10 * $i) # backoff 10s, 20s, 30s... + echo ('{0}: {1}' -f $dmd_url, $_.Exception.Message) + echo ('Retrying in {0}s...' -f $backoff) + Start-Sleep -m ($backoff * 1000) + } +} + +#echo "Extracting $dmd_filename..." +Expand-Archive $dmd_archive -Force -DestinationPath $dmd_install + +# add to environment path +#echo "Installing DMD..." +$dmd_bin = Join-Path $dmd_install "dmd2\windows\bin" +$Env:Path = $Env:Path + ";" + $dmd_bin + +#echo "Testing DMD..." +& dmd.exe --version 2>&1>$null diff --git a/test cases/failing/88 dub compiler/meson.build b/test cases/failing/88 dub compiler/meson.build index f5bc494..2f0b801 100644 --- a/test cases/failing/88 dub compiler/meson.build +++ b/test cases/failing/88 dub compiler/meson.build @@ -1,3 +1,9 @@ project('dub', 'd', meson_version: '0.48.0') +if meson.get_compiler('d').get_id() == 'dmd' + if host_machine.system() == 'windows' or host_machine.system() == 'cygwin' + error('MESON_SKIP_TEST Windows test environment lacks multiple D compilers.') + endif +endif + dependency('dubtestproject:test2', method: 'dub') # Compiler mismatch |