aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/azure-pipelines/azure-pipelines.yml2
-rwxr-xr-xscripts/azure-pipelines/osx/Install-Prerequisites.ps1118
-rw-r--r--scripts/azure-pipelines/osx/README.md110
-rwxr-xr-xscripts/azure-pipelines/osx/Setup-VagrantMachines.ps154
-rw-r--r--scripts/azure-pipelines/osx/Utilities.psm161
-rw-r--r--scripts/azure-pipelines/osx/azure-pipelines.yml2
-rw-r--r--scripts/azure-pipelines/osx/configuration/Vagrantfile-box.rb36
-rw-r--r--scripts/azure-pipelines/osx/configuration/Vagrantfile-vm.rb (renamed from scripts/azure-pipelines/osx/configuration/Vagrantfile)64
-rw-r--r--scripts/azure-pipelines/osx/configuration/installables.json43
-rw-r--r--scripts/azure-pipelines/osx/configuration/installables.schema.json27
-rw-r--r--scripts/azure-pipelines/osx/configuration/vagrant-box-configuration.json21
-rw-r--r--scripts/azure-pipelines/osx/configuration/vagrant-box-configuration.schema.json18
-rw-r--r--scripts/azure-pipelines/osx/configuration/vagrant-configuration.schema.json11
-rw-r--r--scripts/ci.baseline.txt3
14 files changed, 309 insertions, 261 deletions
diff --git a/scripts/azure-pipelines/azure-pipelines.yml b/scripts/azure-pipelines/azure-pipelines.yml
index 9f6526cb7..5e667b272 100644
--- a/scripts/azure-pipelines/azure-pipelines.yml
+++ b/scripts/azure-pipelines/azure-pipelines.yml
@@ -4,7 +4,7 @@
variables:
windows-pool: 'PrWin-2021-04-23'
linux-pool: 'PrLin-2021-04-25'
- osx-pool: 'PrOsx-2020-09-28'
+ osx-pool: 'PrOsx-2021-04-16'
stages:
- stage: FormatChecks
diff --git a/scripts/azure-pipelines/osx/Install-Prerequisites.ps1 b/scripts/azure-pipelines/osx/Install-Prerequisites.ps1
index cb82f83b0..120202583 100755
--- a/scripts/azure-pipelines/osx/Install-Prerequisites.ps1
+++ b/scripts/azure-pipelines/osx/Install-Prerequisites.ps1
@@ -8,10 +8,7 @@ Installs the set of prerequisites for the macOS CI hosts.
.DESCRIPTION
Install-Prerequisites.ps1 installs all of the necessary prerequisites
to run the vcpkg macOS CI in a vagrant virtual machine,
-skipping all prerequisites that are already installed.
-
-.PARAMETER Force
-Don't skip the prerequisites that are already installed.
+skipping all prerequisites that are already installed and of the right version.
.INPUTS
None
@@ -20,10 +17,7 @@ None
None
#>
[CmdletBinding()]
-Param(
- [Parameter()]
- [Switch]$Force
-)
+Param()
Set-StrictMode -Version 2
@@ -37,21 +31,51 @@ Import-Module "$PSScriptRoot/Utilities.psm1"
$Installables = Get-Content "$PSScriptRoot/configuration/installables.json" | ConvertFrom-Json
$Installables.Applications | ForEach-Object {
- if (-not (Get-CommandExists $_.TestCommand)) {
+ $VersionCommand = $_.VersionCommand
+ $InstalledVersion = (& $VersionCommand[0] $VersionCommand[1..$VersionCommand.Length])
+ if (-not $?) {
Write-Host "$($_.Name) not installed; installing now"
- } elseif ($Force) {
- Write-Host "$($_.Name) found; attempting to upgrade or re-install"
} else {
- Write-Host "$($_.Name) already installed"
- return
+ $InstalledVersion = $InstalledVersion -join "`n"
+ if ($InstalledVersion -match $_.VersionRegex) {
+ if ($Matches.Count -ne 2) {
+ Write-Error "$($_.Name) has a malformed version regex ($($_.VersionRegex)); it should have a single capture group
+ (it has $($Matches.Count - 1))"
+ throw
+ }
+ if ($Matches[1] -eq $_.Version) {
+ Write-Host "$($_.Name) already installed and at the correct version ($($Matches[1]))"
+ return
+ } else {
+ Write-Host "$($_.Name) already installed but with the incorrect version
+ installed version: '$($Matches[1])'
+ required version : '$($_.Version)'
+upgrading now."
+ }
+ } else {
+ Write-Warning "$($_.Name)'s version command ($($VersionCommand -join ' ')) returned a value we did not expect:
+ $InstalledVersion
+ expected a version matching the regex: $($_.VersionRegex)
+Installing anyways."
+ }
}
- $pathToDmg = "~/Downloads/$($_.Name).dmg"
- Get-RemoteFile -OutFile $pathToDmg -Uri $_.DmgUrl -Sha256 $_.Sha256
+ if ($null -ne (Get-Member -InputObject $_ -Name 'DmgUrl')) {
+ $pathToDmg = "~/Downloads/$($_.Name).dmg"
+ Get-RemoteFile -OutFile $pathToDmg -Uri $_.DmgUrl -Sha256 $_.Sha256
+
+ hdiutil attach $pathToDmg -mountpoint /Volumes/setup-installer
+ sudo installer -pkg "/Volumes/setup-installer/$($_.InstallerPath)" -target /
+ hdiutil detach /Volumes/setup-installer
+ } elseif ($null -ne (Get-Member -InputObject $_ -Name 'PkgUrl')) {
+ $pathToPkg = "~/Downloads/$($_.Name).pkg"
+ Get-RemoteFile -OutFile $pathToPkg -Uri $_.PkgUrl -Sha256 $_.Sha256
- hdiutil attach $pathToDmg -mountpoint /Volumes/setup-installer
- sudo installer -pkg "/Volumes/setup-installer/$($_.InstallerPath)" -target /
- hdiutil detach /Volumes/setup-installer
+ sudo installer -pkg $pathToPkg -target /
+ } else {
+ Write-Error "$($_.Name) does not have an installer in the configuration file."
+ throw
+ }
}
$Installables.Brew | ForEach-Object {
@@ -64,31 +88,45 @@ $Installables.Brew | ForEach-Object {
default {
Write-Error "Invalid kind: $_. Expected either empty, or 'cask'."
}
- }
- }
+ }
+ }
}
-
-# Install plugins
-$installedExtensionPacks = Get-InstalledVirtualBoxExtensionPacks
-
-$Installables.VBoxExtensions | ForEach-Object {
- $extension = $_
- $installedExts = $installedExtensionPacks | Where-Object { $_.Pack -eq $extension.FullName -and $_.Usable -eq 'true' }
-
- if ($null -eq $installedExts) {
- Write-Host "VBox extension: $($extension.Name) not installed; installing now"
- } elseif ($Force) {
- Write-Host "VBox extension: $($extension.Name) found; attempting to upgrade or re-install"
+brew upgrade
+
+$installedVagrantPlugins = @{}
+vagrant plugin list --machine-readable | ForEach-Object {
+ $timestamp, $target, $type, $data = $_ -split ','
+ switch ($type) {
+ # these are not important
+ 'ui' { }
+ 'plugin-version-constraint' { }
+ 'plugin-name' {
+ $installedVagrantPlugins[$data] = $Null
+ }
+ 'plugin-version' {
+ $version = $data -replace '%!\(VAGRANT_COMMA\)',','
+ if ($version -notmatch '^(.*), global') {
+ Write-Error "Invalid version string for plugin ${target}: $version"
+ throw
+ }
+ $installedVagrantPlugins[$target] = $Matches[1]
+ }
+ default {
+ Write-Warning "Unknown plugin list member type $type for plugin $target"
+ }
+ }
+}
+$Installables.VagrantPlugins | ForEach-Object {
+ if (-not $installedVagrantPlugins.Contains($_.Name)) {
+ Write-Host "$($_.Name) not installed; installing now"
+ } elseif ($installedVagrantPlugins[$_.Name] -ne $_.Version) {
+ Write-Host "$($_.Name) already installed but with the incorrect version
+ installed version: '$($installedVagrantPlugins[$_.Name])'
+ required version: '$($_.Version)'"
} else {
- Write-Host "VBox extension: $($extension.Name) already installed"
+ Write-Host "$($_.Name) already installed and at the correct version ($($_.Version))"
return
}
- $pathToExt = "~/Downloads/$($extension.FullName -replace ' ','_').vbox-extpack"
-
- Get-RemoteFile -OutFile $pathToExt -Uri $extension.Url -Sha256 $extension.Sha256 | Out-Null
-
- Write-Host 'Attempting to install extension with sudo; you may need to enter your password'
- sudo VBoxManage extpack install --replace $pathToExt
- sudo VBoxManage extpack cleanup
+ vagrant plugin install $_.Name --plugin-version $_.Version
}
diff --git a/scripts/azure-pipelines/osx/README.md b/scripts/azure-pipelines/osx/README.md
index ec88b09c7..9f253a06c 100644
--- a/scripts/azure-pipelines/osx/README.md
+++ b/scripts/azure-pipelines/osx/README.md
@@ -6,6 +6,10 @@
- [Table of Contents](#table-of-contents)
- [Basic Usage](#basic-usage)
- [Setting up a new macOS machine](#setting-up-a-new-macos-machine)
+ - [Troubleshooting](#troubleshooting)
+ - [Creating a new Vagrant box](#creating-a-new-vagrant-box)
+ - [VM Software Versions](#vm-software-versions)
+ - [(Internal) Accessing the macOS fileshare](#internal-accessing-the-macos-fileshare)
## Basic Usage
@@ -70,7 +74,7 @@ for the physical machine; i.e., vcpkgmm-04 would use 04.
$ ./Setup-VagrantMachines.ps1 \
-MachineId XX \
-DevopsPat '<get this from azure devops; it needs agent pool read and manage access>' \
- -Date <this is the date of the pool; 2020-09-28 at time of writing>
+ -Date <this is the date of the pool; 2021-04-16 at time of writing>
$ cd ~/vagrant/vcpkg-eg-mac
$ vagrant up
```
@@ -89,6 +93,13 @@ $ sudo shutdown -r now
and wait for the machine to start back up. Then, start again from where the error was emitted.
+### Troubleshooting
+
+The following are issues that we've run into:
+
+- (with a Parallels box) `vagrant up` doesn't work, and vagrant gives the error that the VM is `'stopped'`.
+ - Try logging into the GUI with the KVM, and retrying `vagrant up`.
+
## Creating a new Vagrant box
Whenever we want to install updated versions of the command line tools,
@@ -100,74 +111,99 @@ you can set up your own vagrant boxes that are the same as ours by doing the fol
You'll need some prerequisites:
-- macinbox - installable via `sudo gem install macinbox`
- vagrant - found at <https://www.vagrantup.com/>
-- VirtualBox - found at <https://www.virtualbox.org/>
-- A macOS installer application - you can get this from the App Store (although I believe only the latest is available)
-- An Xcode Command Line Tools installer - you can get this from Apple's developer website,
+ - The vagrant-parallels plugin - `vagrant plugin install vagrant-parallels`
+- Parallels - found at <https://parallels.com>
+- An Xcode installer - you can get this from Apple's developer website,
although you'll need to sign in first: <https://developer.apple.com/downloads>
-First, you'll need to create a base box;
+First, you'll need to create a base VM;
this is where you determine what version of macOS is installed.
+Just follow the Parallels process for creating a macOS VM.
+Once you've done this, you can run through the installation of macOS onto a new VM.
+You should set the username to `vagrant`.
+
+Once it's finished installing, make sure to turn on the SSH server.
+Open System Preferences, then go to Sharing > Remote Login,
+and turn it on.
+You'll then want to add the vagrant SSH keys to the VM's vagrant user.
+Open the terminal application and run the following:
+
+```sh
+$ # basic stuff
+$ date | sudo tee '/etc/vagrant_box_build_time'
+$ printf 'vagrant\tALL=(ALL)\tNOPASSWD:\tALL\n' | sudo tee -a '/etc/sudoers.d/vagrant'
+$ sudo chmod 0440 '/etc/sudoers.d/vagrant'
+$ # then install vagrant keys
+$ mkdir -p ~/.ssh
+$ curl -fsSL 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' >~/.ssh/authorized_keys
+$ chmod 0600 ~/.ssh/authorized_keys
```
-> sudo macinbox \
- --box-format virtualbox \
- --name macos-ci-base \
- --installer <path to macOS installer> \
- --no-gui
-```
-Once you've done that, create a Vagrantfile that looks like the following:
+Finally, you'll need to install the Parallel Tools.
+From your host, in the top bar,
+go to Actions > Install Parallels Tools...,
+and then follow the instructions.
+
+Now, let's package the VM into a base box.
+(The following instructions are adapted from
+[these official instructions][base-box-instructions]).
-```rb
-Vagrant.configure('2') do |config|
- config.vm.box = 'macos-ci-base'
- config.vm.boot_timeout = 600
- config.vm.synced_folder ".", "/vagrant", disabled: true
-end
+Run the following commands:
+
+```sh
+$ cd ~/Parallels
+$ echo '{ "provider": "parallels" }' >metadata.json
+$ tar zgvf <current date>.box ./metadata.json ./<name of VM>.pvm
```
-then, run the following in that vagrant directory:
+This will create a box file which contains all the necessary data.
+You can delete the `metadata.json` file after.
+
+Once you've done that, you can upload it to the fileshare,
+under `share/boxes/vcpkg-ci-base`, add it to `share/boxes/vcpkg-ci-base.json`,
+and finally add it to vagrant:
```sh
-$ vagrant up
-$ vagrant scp <path to Command Line Tools for Xcode installer> :clt.dmg
-$ vagrant ssh -c 'hdiutil attach clt.dmg -mountpoint /Volumes/setup-installer'
-$ vagrant ssh -c 'sudo installer -pkg "/Volumes/setup-installer/Command Line Tools.pkg" -target /'
-$ vagrant ssh -c 'hdiutil detach /Volumes/setup-installer'
-$ vagrant ssh -c 'rm clt.dmg'
-$ vagrant ssh -c '/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"'
-$ vagrant reload
+$ vagrant box add ~/vagrant/share/boxes/vcpkg-ci-base.json
```
-if that works, you can now package the box:
+Then, we'll create the final box,
+which contains all the necessary programs for doing CI work.
+Copy `configuration/Vagrantfile-box.rb` as `Vagrantfile`, and
+`configuration/vagrant-box-configuration.json`
+into a new directory; into that same directory,
+download the Xcode command line tools dmg, and name it `clt.dmg`.
+Then, run the following in that directory:
```sh
-$ vagrant ssh -c 'umount testmnt && rmdir testmnt'
+$ vagrant up
$ vagrant package
```
This will create a `package.box`, which is the box file for the base VM.
-Then, you can `vagrant box add <package.box> --name <name for the box>`,
-and you'll have the base vcpkg box added for purposes of `Setup-VagrantMachines.ps1`!
-
-Once you've created the base box, if you're making it the new base box for the CI,
-upload it to the fileshare, under `share/vcpkg-boxes`.
-Then, add the metadata about the box (the name and version) to the JSON file there.
+Once you've created this box, if you're making it the new box for the CI,
+upload it to the fileshare, under `share/boxes/vcpkg-ci`.
+Then, add the metadata about the box (the name and version) to
+`share/boxes/vcpkg-ci.json`.
Once you've done that, add the software versions under [VM Software Versions](#vm-software-versions).
+[base-box-instructions]: https://parallels.github.io/vagrant-parallels/docs/boxes/base.html
+
### VM Software Versions
* 2020-09-28:
* macOS: 10.15.6
* Xcode CLTs: 12
+* 2021-04-16:
+ * macOS: 11.2.3
+ * Xcode CLTs: 12.4
### (Internal) Accessing the macOS fileshare
The fileshare is located on `vcpkgmm-01`, under the `fileshare` user, in the `share` directory.
In order to get `sshfs` working on the physical machine,
-you'll need to do the same thing one needs to do for building the base box.
You can run `Install-Prerequisites.ps1` to grab the right software, then either:
```sh
diff --git a/scripts/azure-pipelines/osx/Setup-VagrantMachines.ps1 b/scripts/azure-pipelines/osx/Setup-VagrantMachines.ps1
index c44858044..88b64594a 100755
--- a/scripts/azure-pipelines/osx/Setup-VagrantMachines.ps1
+++ b/scripts/azure-pipelines/osx/Setup-VagrantMachines.ps1
@@ -12,6 +12,8 @@ configuration JSON file into ~/vagrant/vcpkg-eg-mac.
.PARAMETER MachineId
The number to give the machine; should match [0-9]{2}.
+Defaults to the numbers at the end of the machine name,
+assuming that that machine name matches `VCPKGMM-[0-9]{2}`.
.PARAMETER DevopsPat
The personal access token which has Read & Manage permissions on the ADO pool.
@@ -36,12 +38,6 @@ Defaults to 'vcpkg-eg-mac'.
The name of the box to use. Defaults to 'vcpkg/macos-ci',
which is only available internally.
-.PARAMETER Force
-Delete any existing vagrant/vcpkg-eg-mac directory.
-
-.PARAMETER DiskSize
-The size to make the temporary disks in gigabytes. Defaults to 350.
-
.INPUTS
None
@@ -50,7 +46,7 @@ None
#>
[CmdletBinding(PositionalBinding=$False, DefaultParameterSetName='DefineDate')]
Param(
- [Parameter(Mandatory=$True)]
+ [Parameter(Mandatory=$False)]
[String]$MachineId,
[Parameter(Mandatory=$True)]
@@ -72,13 +68,7 @@ Param(
[String]$BaseName = 'vcpkg-eg-mac',
[Parameter()]
- [String]$BoxName = 'vcpkg/macos-ci',
-
- [Parameter()]
- [Int]$DiskSize = 250,
-
- [Parameter()]
- [Switch]$Force
+ [String]$BoxName = 'vcpkg/macos-ci'
)
Set-StrictMode -Version 2
@@ -92,33 +82,43 @@ if (-not [String]::IsNullOrEmpty($Date)) {
$AgentPool = "PrOsx-$Date"
}
+if ([String]::IsNullOrEmpty($MachineId)) {
+ $hostname = hostname -s
+ if ($hostname -match '^VCPKGMM-([0-9]{2})$') {
+ $MachineId = $matches[1]
+ } else {
+ Write-Error "Hostname ($hostname) does not match the expected format (VCPKGMM-NN). Please pass -MachineId in order to give the VM a number."
+ }
+}
+
if (Test-Path '~/vagrant/vcpkg-eg-mac') {
- if ($Force) {
+ Push-Location '~/vagrant/vcpkg-eg-mac'
+ try {
Write-Host 'Deleting existing directories'
- Remove-Item -Recurse -Force -Path '~/vagrant/vcpkg-eg-mac' | Out-Null
- } else {
- throw '~/vagrant/vcpkg-eg-mac already exists; try re-running with -Force'
+ vagrant destroy -f
+ Remove-Item -Recurse -Force -LiteralPath '~/vagrant/vcpkg-eg-mac' | Out-Null
+ } finally {
+ Pop-Location
}
}
Write-Host 'Creating new directories'
if (-not (Test-Path -Path '~/vagrant')) {
- New-Item -ItemType 'Directory' -Path '~/vagrant' | Out-Null
+ New-Item -ItemType 'Directory' -Path '~/vagrant' | Out-Null
}
New-Item -ItemType 'Directory' -Path '~/vagrant/vcpkg-eg-mac' | Out-Null
Copy-Item `
- -Path "$PSScriptRoot/configuration/Vagrantfile" `
+ -Path "$PSScriptRoot/configuration/Vagrantfile-vm.rb" `
-Destination '~/vagrant/vcpkg-eg-mac/Vagrantfile'
$configuration = @{
- pat = $DevopsPat;
- agent_pool = $AgentPool;
- devops_url = $DevopsUrl;
- machine_name = "${BaseName}-${MachineId}";
- box_name = $BoxName;
- box_version = $BoxVersion;
- disk_size = $DiskSize;
+ pat = $DevopsPat
+ agent_pool = $AgentPool
+ devops_url = $DevopsUrl
+ machine_name = "${BaseName}-${MachineId}"
+ box_name = $BoxName
+ box_version = $BoxVersion
}
ConvertTo-Json -InputObject $configuration -Depth 5 `
| Set-Content -Path '~/vagrant/vcpkg-eg-mac/vagrant-configuration.json'
diff --git a/scripts/azure-pipelines/osx/Utilities.psm1 b/scripts/azure-pipelines/osx/Utilities.psm1
index b7ad489bb..1b70d61f7 100644
--- a/scripts/azure-pipelines/osx/Utilities.psm1
+++ b/scripts/azure-pipelines/osx/Utilities.psm1
@@ -88,64 +88,3 @@ Please make sure that the hash in the powershell file is correct.
Get-Item $OutFile
}
-<#
-.SYNOPSIS
-Gets the list of installed extensions as powershell objects.
-
-.DESCRIPTION
-Get-InstalledVirtualBoxExtensionPacks gets the installed extensions,
-returning objects that look like:
-
-{
- Pack = 'Oracle VM VirtualBox Extension Pack';
- Version = '6.1.10';
- ...
-}
-
-.INPUTS
-None
-
-.OUTPUTS
-PSCustomObject
- The list of VBox Extension objects that are installed.
-#>
-function Get-InstalledVirtualBoxExtensionPacks
-{
- [CmdletBinding()]
- [OutputType([PSCustomObject])]
- Param()
-
- $lines = VBoxManage list extpacks
-
- $result = @()
-
- $currentObject = $null
- $currentKey = ""
- $currentString = ""
-
- $lines | ForEach-Object {
- $Line = $_
- if ($Line[0] -eq ' ') {
- $currentString += "`n$($Line.Trim())"
- } else {
- if ($null -ne $currentObject) {
- $currentObject.$currentKey = $currentString
- }
- $currentKey, $currentString = $Line -Split ':'
- $currentString = $currentString.Trim()
-
- if ($currentKey.StartsWith('Pack no')) {
- $currentKey = 'Pack'
- if ($null -ne $currentObject) {
- Write-Output ([PSCustomObject]$currentObject)
- }
- $currentObject = @{}
- }
- }
- }
-
- if ($null -ne $currentObject) {
- $currentObject.$currentKey = $currentString
- Write-Output ([PSCustomObject]$currentObject)
- }
-}
diff --git a/scripts/azure-pipelines/osx/azure-pipelines.yml b/scripts/azure-pipelines/osx/azure-pipelines.yml
index 52e974c93..6f327c1e9 100644
--- a/scripts/azure-pipelines/osx/azure-pipelines.yml
+++ b/scripts/azure-pipelines/osx/azure-pipelines.yml
@@ -14,7 +14,7 @@ jobs:
value: /Users/vagrant/Data
- name: VCPKG_DOWNLOADS
value: /Users/vagrant/Data/downloads
- - group: azblob-test-sas-group
+ - group: osx-2021-04-16
- name: BINARY_SOURCE_STUB
value: "x-azblob,$(azblob-root-url),$(azblob-test-sas)"
diff --git a/scripts/azure-pipelines/osx/configuration/Vagrantfile-box.rb b/scripts/azure-pipelines/osx/configuration/Vagrantfile-box.rb
new file mode 100644
index 000000000..90ad6c4c5
--- /dev/null
+++ b/scripts/azure-pipelines/osx/configuration/Vagrantfile-box.rb
@@ -0,0 +1,36 @@
+require 'json'
+
+configuration = JSON.parse(File.read("#{__dir__}/vagrant-box-configuration.json"))
+
+Vagrant.configure('2') do |config|
+ config.vm.box = 'vcpkg/macos-ci-base'
+ config.vm.box_version = configuration['box_version']
+ config.vm.synced_folder '.', '/Users/vagrant/shared'
+
+ config.vm.provision 'shell',
+ run: 'once',
+ name: 'Install Xcode Command Line Tools: attach dmg file',
+ inline: 'hdiutil attach shared/clt.dmg -mountpoint /Volumes/setup-installer',
+ privileged: false
+ config.vm.provision 'shell',
+ run: 'once',
+ name: 'Install Xcode Command Line Tools: run installer',
+ inline: 'installer -pkg "/Volumes/setup-installer/Command Line Tools.pkg" -target /',
+ privileged: true
+ config.vm.provision 'shell',
+ run: 'once',
+ name: 'Install XCode Command Line Tools: detach dmg file',
+ inline: 'hdiutil detach /Volumes/setup-installer',
+ privileged: false
+
+ config.vm.provision 'shell',
+ run: 'once',
+ name: 'Install brew',
+ inline: '/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"',
+ privileged: false
+ config.vm.provision 'shell',
+ run: 'once',
+ name: 'Install brew applications',
+ inline: "brew install #{configuration['brew'].join(' ')} && brew install --cask #{configuration['brew-cask'].join(' ')}",
+ privileged: false
+end
diff --git a/scripts/azure-pipelines/osx/configuration/Vagrantfile b/scripts/azure-pipelines/osx/configuration/Vagrantfile-vm.rb
index 08c472fe6..ed689ab7b 100644
--- a/scripts/azure-pipelines/osx/configuration/Vagrantfile
+++ b/scripts/azure-pipelines/osx/configuration/Vagrantfile-vm.rb
@@ -1,79 +1,35 @@
require 'json'
-require "erb"
-include ERB::Util
-
configuration = JSON.parse(File.read("#{__dir__}/vagrant-configuration.json"))
server = {
:hostname => configuration['machine_name'],
:box => configuration['box_name'],
:box_version => configuration['box_version'],
- :disk_size => configuration['disk_size'],
:ram => 12000,
- :cpu => 5
+ :cpu => 11
}
-brew_formulas = [
- 'autoconf',
- 'automake',
- 'bison',
- 'gfortran',
- 'gperf',
- 'libtool',
- 'meson',
- 'mono',
- 'nasm',
- 'pkg-config',
- 'yasm' ]
-
-brew_cask_formulas = [
- 'powershell' ]
-
-azure_agent_url = 'https://vstsagentpackage.azureedge.net/agent/2.179.0/vsts-agent-osx-x64-2.179.0.tar.gz'
+azure_agent_url = 'https://vstsagentpackage.azureedge.net/agent/2.185.1/vsts-agent-osx-x64-2.185.1.tar.gz'
devops_url = configuration['devops_url']
agent_pool = configuration['agent_pool']
pat = configuration['pat']
Vagrant.configure('2') do |config|
- # give them extra time to boot up
- config.vm.boot_timeout = 600
-
config.vm.box = server[:box]
config.vm.box_version = server[:box_version]
config.vm.hostname = server[:hostname]
config.vm.synced_folder '.', '/vagrant', disabled: true
- diskname = "#{server[:hostname]}-data.vmdk"
-
- # I don't like this, but as far as I can tell, it's the only way
- # to do this. When vagrant finishes the `disk` feature, switch
- # over to that -- Nicole Mazzuca
- if (not File.exists? diskname) then
- system "VBoxManage createmedium --filename #{diskname} --size #{1024 * server[:disk_size]} --variant Fixed"
- end
-
- config.vm.provider 'virtualbox' do |vb|
- vb.memory = server[:ram]
- vb.cpus = server[:cpu]
- vb.customize ['modifyvm', :id, '--ioapic', 'on']
- vb.customize ['storageattach', :id,
- '--storagectl', 'SATA Controller',
- '--port', '1', '--device', '0', '--type', 'hdd',
- '--medium', "#{diskname}"
- ]
+ config.vm.provider 'parallels' do |prl|
+ prl.memory = server[:ram]
+ prl.cpus = server[:cpu]
end
config.vm.provision 'shell',
run: 'once',
- name: 'Format and mount the data filesystem',
- inline: 'diskutil partitionDisk /dev/disk0 1 GPT jhfs+ data 0',
- privileged: true
-
- config.vm.provision 'shell',
- run: 'once',
- name: 'Link the data filesystem to the home directory',
- inline: "ln -s /Volumes/data ~/Data",
+ name: 'Create the data directory',
+ inline: "mkdir ~/Data",
privileged: false
config.vm.provision 'shell',
@@ -90,12 +46,6 @@ Vagrant.configure('2') do |config|
config.vm.provision 'shell',
run: 'once',
- name: 'Install brew applications',
- inline: "brew install #{brew_formulas.join(' ')} && brew install --cask #{brew_cask_formulas.join(' ')}",
- privileged: false
-
- config.vm.provision 'shell',
- run: 'once',
name: 'Add VM to azure agent pool',
inline: "cd ~/myagent;\
./config.sh --unattended \
diff --git a/scripts/azure-pipelines/osx/configuration/installables.json b/scripts/azure-pipelines/osx/configuration/installables.json
index 7a7ba400c..1b2c2d015 100644
--- a/scripts/azure-pipelines/osx/configuration/installables.json
+++ b/scripts/azure-pipelines/osx/configuration/installables.json
@@ -3,35 +3,38 @@
"Applications": [
{
- "Name": "VirtualBox",
- "TestCommand": "VBoxManage",
- "DmgUrl": "https://download.virtualbox.org/virtualbox/6.1.16/VirtualBox-6.1.16-140961-OSX.dmg",
- "Sha256": "D7DF0F05D9A9E7CBA50EA01DA264AC20948B1C9C0E0CCCD2D628085C9F434D45",
- "InstallerPath": "VirtualBox.pkg"
- },
- {
"Name": "vagrant",
- "TestCommand": "vagrant",
- "DmgUrl": "https://releases.hashicorp.com/vagrant/2.2.14/vagrant_2.2.14_x86_64.dmg",
- "Sha256": "76B849B26E6D6187A7829212B05545D3B424E05F1BCD0F7163DA1E5117084FA6",
+ "VersionCommand": [ "vagrant", "-v" ],
+ "VersionRegex": "Vagrant (.*)",
+ "Version": "2.2.15",
+ "DmgUrl": "https://releases.hashicorp.com/vagrant/2.2.15/vagrant_2.2.15_x86_64.dmg",
+ "Sha256": "5C2B290C4FA2371E255C56B1E96DED3D0C838D54CB7F0E8E6CF154E9F206A20E",
"InstallerPath": "vagrant.pkg"
- }
- ],
- "Brew": [
+ },
{
"Name": "osxfuse",
- "Kind": "cask"
+ "VersionCommand": [ "cat", "/Library/Filesystems/macfuse.fs/Contents/version.plist" ],
+ "VersionRegex": "<key>CFBundleVersion</key>[\\n\\t ]*<string>([0-9.]+)</string>",
+ "Version": "4.1.0",
+ "DmgUrl": "https://github.com/osxfuse/osxfuse/releases/download/macfuse-4.1.0/macfuse-4.1.0.dmg",
+ "Sha256": "3CB6A49406FD036C50EF1B4AD717A377F4DCF182811BDE172D69F1C289791085",
+ "InstallerPath": "Install macFUSE.pkg"
},
{
- "Name": "sshfs"
+ "Name": "sshfs",
+ "VersionCommand": [ "sshfs", "--version" ],
+ "VersionRegex": "SSHFS version [0-9.]* \\(OSXFUSE SSHFS (.*)\\)",
+ "Version": "2.5.0",
+ "PkgUrl": "https://github.com/osxfuse/sshfs/releases/download/osxfuse-sshfs-2.5.0/sshfs-2.5.0.pkg",
+ "Sha256": "F8F4F71814273EA42DBE6CD92199F7CFF418571FFD1B10C0608878D3472D2162"
}
],
- "VBoxExtensions": [
+ "Brew": [
+ ],
+ "VagrantPlugins": [
{
- "Name": "Extension Pack",
- "FullName": "Oracle VM VirtualBox Extension Pack",
- "Url": "https://download.virtualbox.org/virtualbox/6.1.16/Oracle_VM_VirtualBox_Extension_Pack-6.1.16.vbox-extpack",
- "Sha256": "9802482B77B95A954CB5111793DA10D009009A4E9A9C4EAA4BD1AE5DAFE9DB46"
+ "Name": "vagrant-parallels",
+ "Version": "2.2.1"
}
]
}
diff --git a/scripts/azure-pipelines/osx/configuration/installables.schema.json b/scripts/azure-pipelines/osx/configuration/installables.schema.json
index 13476e776..b7ec7ae80 100644
--- a/scripts/azure-pipelines/osx/configuration/installables.schema.json
+++ b/scripts/azure-pipelines/osx/configuration/installables.schema.json
@@ -10,7 +10,7 @@
"required": [
"Applications",
"Brew",
- "VBoxExtensions"
+ "VagrantPlugins"
],
"properties": {
"Applications": {
@@ -21,7 +21,18 @@
"Name": {
"type": "string"
},
- "TestCommand": {
+ "VersionCommand": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "minItems": 1
+ },
+ "VersionRegex": {
+ "type": "string",
+ "format": "regex"
+ },
+ "Version": {
"type": "string"
},
"DmgUrl": {
@@ -53,23 +64,17 @@
}
}
},
- "VBoxExtensions": {
+ "VagrantPlugins": {
"type": "array",
"items": {
"type": "object",
+ "required": [ "Name", "Version" ],
"properties": {
"Name": {
"type": "string"
},
- "FullName": {
+ "Version": {
"type": "string"
- },
- "Url": {
- "type": "string",
- "format": "uri"
- },
- "Sha256": {
- "$ref": "#/definitions/sha256"
}
}
}
diff --git a/scripts/azure-pipelines/osx/configuration/vagrant-box-configuration.json b/scripts/azure-pipelines/osx/configuration/vagrant-box-configuration.json
new file mode 100644
index 000000000..d800c257a
--- /dev/null
+++ b/scripts/azure-pipelines/osx/configuration/vagrant-box-configuration.json
@@ -0,0 +1,21 @@
+{
+ "$schema": "./vagrant-vm-configuration.schema.json",
+ "brew": [
+ "autoconf",
+ "automake",
+ "bison",
+ "gettext",
+ "gfortran",
+ "gperf",
+ "gtk-doc",
+ "libtool",
+ "meson",
+ "mono",
+ "nasm",
+ "pkg-config",
+ "yasm"
+ ],
+ "brew-cask": [
+ "powershell"
+ ]
+}
diff --git a/scripts/azure-pipelines/osx/configuration/vagrant-box-configuration.schema.json b/scripts/azure-pipelines/osx/configuration/vagrant-box-configuration.schema.json
new file mode 100644
index 000000000..80845f70f
--- /dev/null
+++ b/scripts/azure-pipelines/osx/configuration/vagrant-box-configuration.schema.json
@@ -0,0 +1,18 @@
+{
+ "$schema": "https://json-schema.org/draft-07/schema",
+ "type": "object",
+ "required": [
+ "brew",
+ "brew-cask"
+ ],
+ "properties": {
+ "brew": {
+ "type": "array",
+ "items": { "type": "string" }
+ },
+ "brew-cask": {
+ "type": "array",
+ "items": { "type": "string" }
+ }
+ }
+}
diff --git a/scripts/azure-pipelines/osx/configuration/vagrant-configuration.schema.json b/scripts/azure-pipelines/osx/configuration/vagrant-configuration.schema.json
index 3d6b619e8..91540d77c 100644
--- a/scripts/azure-pipelines/osx/configuration/vagrant-configuration.schema.json
+++ b/scripts/azure-pipelines/osx/configuration/vagrant-configuration.schema.json
@@ -5,9 +5,11 @@
"required": [
"pat",
- "base_name",
- "disk_size",
- "machine_identifiers"
+ "agent_pool",
+ "devops_url",
+ "machine_name",
+ "box_name",
+ "box_version"
],
"properties": {
@@ -28,9 +30,6 @@
},
"box_version": {
"type": "string"
- },
- "disk_size": {
- "type": "integer"
}
}
}
diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt
index f0b12d494..08e0fb086 100644
--- a/scripts/ci.baseline.txt
+++ b/scripts/ci.baseline.txt
@@ -1834,3 +1834,6 @@ wangle:x64-windows-static-md=fail
# See https://developercommunity.visualstudio.com/t/Toolset-169-regression-vcxproj-producin/1356639
dimcli:x64-windows-static-md=fail
dimcli:x64-windows-static=fail
+
+# cppgraphqlgen triggers an ICE on Apple Clang that comes with MacOS 11.
+cppgraphqlgen:x64-osx=fail