From df0895550b5178a369c40ddf185dffe745b06f3e Mon Sep 17 00:00:00 2001 From: Nicole Mazzuca Date: Wed, 29 Jul 2020 10:02:37 -0700 Subject: [PATCH 1/4] [vcpkg-ci] fix macos setup scripts --- scripts/azure-pipelines/osx/Setup-VagrantMachines.ps1 | 4 ++-- scripts/azure-pipelines/osx/Utilities.psm1 | 2 +- scripts/azure-pipelines/osx/configuration/VagrantFile | 2 +- .../osx/configuration/vagrant-configuration.schema.json | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/azure-pipelines/osx/Setup-VagrantMachines.ps1 b/scripts/azure-pipelines/osx/Setup-VagrantMachines.ps1 index fb153a28ab26b5..5600cb1ed6fc84 100755 --- a/scripts/azure-pipelines/osx/Setup-VagrantMachines.ps1 +++ b/scripts/azure-pipelines/osx/Setup-VagrantMachines.ps1 @@ -19,7 +19,7 @@ The username for the archives share. .PARAMETER ArchivesAccessKey The access key for the archives share. -.PARAMETER ArchivesUri +.PARAMETER ArchivesUrn The URN of the archives share; looks like `foo.windows.core.net`. .PARAMETER ArchivesShare @@ -105,7 +105,7 @@ $configuration = @{ archives = @{ username = $ArchivesUsername; access_key = $ArchivesAccessKey; - url = $ArchivesUri; + urn = $ArchivesUrn; share = $ArchivesShare; }; } diff --git a/scripts/azure-pipelines/osx/Utilities.psm1 b/scripts/azure-pipelines/osx/Utilities.psm1 index 6fffa15225944d..7aedb6106d251f 100644 --- a/scripts/azure-pipelines/osx/Utilities.psm1 +++ b/scripts/azure-pipelines/osx/Utilities.psm1 @@ -31,7 +31,7 @@ function Get-CommandExists [String]$Name ) - $null -ne (Get-Command -Name $Command -ErrorAction SilentlyContinue) + $null -ne (Get-Command -Name $Name -ErrorAction SilentlyContinue) } <# diff --git a/scripts/azure-pipelines/osx/configuration/VagrantFile b/scripts/azure-pipelines/osx/configuration/VagrantFile index b142b8189a95c2..3e275950564f52 100644 --- a/scripts/azure-pipelines/osx/configuration/VagrantFile +++ b/scripts/azure-pipelines/osx/configuration/VagrantFile @@ -29,7 +29,7 @@ devops_url = 'https://dev.azure.com/vcpkg' agent_pool = 'vcpkgAgentPool' pat = configuration['pat'] archives = configuration['archives'] -archives_url = "//#{archives['username']}:#{url_encode(archives['access_key'])}@#{archives['url']}/#{archives['share']}" +archives_url = "//#{archives['username']}:#{url_encode(archives['access_key'])}@#{archives['urn']}/#{archives['share']}" Vagrant.configure('2') do |config| # give them extra time to boot up diff --git a/scripts/azure-pipelines/osx/configuration/vagrant-configuration.schema.json b/scripts/azure-pipelines/osx/configuration/vagrant-configuration.schema.json index 0518df3b6f1f43..f0abc1673419ce 100644 --- a/scripts/azure-pipelines/osx/configuration/vagrant-configuration.schema.json +++ b/scripts/azure-pipelines/osx/configuration/vagrant-configuration.schema.json @@ -34,13 +34,13 @@ "required": [ "username", "access_key", - "url", + "urn", "share" ], "properties": { "username": { "type": "string" }, "access_key": { "type": "string" }, - "url": { "type": "string" }, + "urn": { "type": "string" }, "share": { "type": "string" } } } From adde78c2cdc070eda1310fee83bfd47481ccf01f Mon Sep 17 00:00:00 2001 From: Nicole Mazzuca Date: Wed, 29 Jul 2020 10:08:17 -0700 Subject: [PATCH 2/4] the disk feature is still experimental --- .../osx/configuration/VagrantFile | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/scripts/azure-pipelines/osx/configuration/VagrantFile b/scripts/azure-pipelines/osx/configuration/VagrantFile index 3e275950564f52..019710e11ec5b9 100644 --- a/scripts/azure-pipelines/osx/configuration/VagrantFile +++ b/scripts/azure-pipelines/osx/configuration/VagrantFile @@ -42,7 +42,25 @@ Vagrant.configure('2') do |config| node.vm.hostname = machine[:hostname] node.vm.synced_folder '.', '/vagrant', disabled: true - node.vm.disk :disk, name: "#{machine[:hostname]}-data", size: "#{config['disk_size']}GB" + diskname = "#{machine[: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 * 220}" + end + + node.vm.provider 'virtualbox' do |vb| + vb.memory = machine[:ram] + vb.cpus = machine[:cpu] + vb.customize ['modifyvm', :id, '--ioapic', 'on'] + vb.customize ['storageattach', :id, + '--storagectl', 'SATA Controller', + '--port', '1', '--device', '0', '--type', 'hdd', + '--medium', "#{diskname}" + ] + end node.vm.provision 'shell', run: 'once', From 63a16b5227182039f869c67de6c3664edda866a8 Mon Sep 17 00:00:00 2001 From: Nicole Mazzuca Date: Wed, 29 Jul 2020 10:13:59 -0700 Subject: [PATCH 3/4] fix Get-InstalledVirtualBoxExtensionPacks --- scripts/azure-pipelines/osx/Utilities.psm1 | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/azure-pipelines/osx/Utilities.psm1 b/scripts/azure-pipelines/osx/Utilities.psm1 index 7aedb6106d251f..b7ad489bb7995a 100644 --- a/scripts/azure-pipelines/osx/Utilities.psm1 +++ b/scripts/azure-pipelines/osx/Utilities.psm1 @@ -124,6 +124,7 @@ function Get-InstalledVirtualBoxExtensionPacks $currentString = "" $lines | ForEach-Object { + $Line = $_ if ($Line[0] -eq ' ') { $currentString += "`n$($Line.Trim())" } else { From 9b9738206c9952a0b36d1d8dc0472434e4d87c6d Mon Sep 17 00:00:00 2001 From: Nicole Mazzuca Date: Wed, 29 Jul 2020 10:16:02 -0700 Subject: [PATCH 4/4] use new bash install script for brew instead of old-style ruby --- scripts/azure-pipelines/osx/README.md | 2 +- scripts/azure-pipelines/osx/configuration/VagrantFile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/azure-pipelines/osx/README.md b/scripts/azure-pipelines/osx/README.md index b0fdde43464c6b..0395908f0174f0 100644 --- a/scripts/azure-pipelines/osx/README.md +++ b/scripts/azure-pipelines/osx/README.md @@ -25,7 +25,7 @@ and `Setup-VagrantMachines.ps1`, and make sure to push any changes! Before anything else, one must download `brew` and `powershell`. ```sh -$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" +$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" $ brew cask install powershell ``` diff --git a/scripts/azure-pipelines/osx/configuration/VagrantFile b/scripts/azure-pipelines/osx/configuration/VagrantFile index 019710e11ec5b9..1e1cce50f06c99 100644 --- a/scripts/azure-pipelines/osx/configuration/VagrantFile +++ b/scripts/azure-pipelines/osx/configuration/VagrantFile @@ -89,7 +89,7 @@ Vagrant.configure('2') do |config| node.vm.provision 'shell', run: 'once', name: 'Install brew and xcode command line tools', - inline: '/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"', + inline: '/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"', privileged: false node.vm.provision 'shell',