diff options
| author | nicole mazzuca <mazzucan@outlook.com> | 2020-12-21 15:40:21 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-12-21 15:40:21 -0800 |
| commit | c898283a41af23135c048c50836f2bc2eccea819 (patch) | |
| tree | 72bba2c653f4972e3abd28e5cda3c8574fff317c /scripts | |
| parent | 730187bfd9c314c29148495d2c2527797fad5d43 (diff) | |
| download | vcpkg-c898283a41af23135c048c50836f2bc2eccea819.tar.gz vcpkg-c898283a41af23135c048c50836f2bc2eccea819.zip | |
[vcpkg registries] support versions (#15114)
* [vcpkg registries] support versions
This PR merges the Registries changes and the versioning changes, so that one can use both at the same time.
There is one major difference between this PR and the RFC (#13590), which is that instead of version files looking like:
```json
[
...
]
```
version files look like:
```
{
"versions": [
...
]
}
```
this is to support interop between this PR and existing demos and the like;
fixing this, along with perhaps renaming `port_versions` to `port-versions` should be done after this is merged,
should be a trivial change.
Diffstat (limited to 'scripts')
14 files changed, 53 insertions, 21 deletions
diff --git a/scripts/azure-pipelines/end-to-end-tests-dir/create.ps1 b/scripts/azure-pipelines/end-to-end-tests-dir/create.ps1 index 53686fe50..9d59da539 100644 --- a/scripts/azure-pipelines/end-to-end-tests-dir/create.ps1 +++ b/scripts/azure-pipelines/end-to-end-tests-dir/create.ps1 @@ -1,8 +1,8 @@ . $PSScriptRoot/../end-to-end-tests-prelude.ps1
# Test vcpkg create
-$CurrentTest = "create zlib"
-Write-Host $CurrentTest
+$Script:CurrentTest = "create zlib"
+Write-Host $Script:CurrentTest
./vcpkg --x-builtin-ports-root=$TestingRoot/ports create zlib https://github.com/madler/zlib/archive/v1.2.11.tar.gz zlib-1.2.11.tar.gz
Throw-IfFailed
diff --git a/scripts/azure-pipelines/end-to-end-tests-dir/integrate-install.ps1 b/scripts/azure-pipelines/end-to-end-tests-dir/integrate-install.ps1 index 387697751..38362ba8c 100644 --- a/scripts/azure-pipelines/end-to-end-tests-dir/integrate-install.ps1 +++ b/scripts/azure-pipelines/end-to-end-tests-dir/integrate-install.ps1 @@ -2,24 +2,24 @@ if (-not $IsLinux -and -not $IsMacOS) { . $PSScriptRoot/../end-to-end-tests-prelude.ps1
# Test msbuild props and targets
- $CurrentTest = "zlib:x86-windows-static msbuild scripts\testing\integrate-install\..."
- Write-Host $CurrentTest
+ $Script:CurrentTest = "zlib:x86-windows-static msbuild scripts\testing\integrate-install\..."
+ Write-Host $Script:CurrentTest
./vcpkg $commonArgs install zlib:x86-windows-static --x-binarysource=clear
Throw-IfFailed
foreach ($project in @("VcpkgTriplet", "VcpkgTriplet2", "VcpkgUseStatic", "VcpkgUseStatic2")) {
- $CurrentTest = "msbuild scripts\testing\integrate-install\$project.vcxproj"
+ $Script:CurrentTest = "msbuild scripts\testing\integrate-install\$project.vcxproj"
./vcpkg $commonArgs env "msbuild scripts\testing\integrate-install\$project.vcxproj /p:VcpkgRoot=$TestingRoot /p:IntDir=$TestingRoot\int\ /p:OutDir=$TestingRoot\out\ "
Throw-IfFailed
Remove-Item -Recurse -Force $TestingRoot\int
Remove-Item -Recurse -Force $TestingRoot\out
}
- $CurrentTest = "zlib:x86-windows msbuild scripts\testing\integrate-install\..."
- Write-Host $CurrentTest
+ $Script:CurrentTest = "zlib:x86-windows msbuild scripts\testing\integrate-install\..."
+ Write-Host $Script:CurrentTest
./vcpkg $commonArgs install zlib:x86-windows --x-binarysource=clear
Throw-IfFailed
foreach ($project in @("Project1", "NoProps")) {
- $CurrentTest = "msbuild scripts\testing\integrate-install\$project.vcxproj"
- Write-Host $CurrentTest
+ $Script:CurrentTest = "msbuild scripts\testing\integrate-install\$project.vcxproj"
+ Write-Host $Script:CurrentTest
./vcpkg $commonArgs env "msbuild scripts\testing\integrate-install\$project.vcxproj /p:VcpkgRoot=$TestingRoot /p:IntDir=$TestingRoot\int\ /p:OutDir=$TestingRoot\out\ "
Throw-IfFailed
Remove-Item -Recurse -Force $TestingRoot\int
diff --git a/scripts/azure-pipelines/end-to-end-tests-dir/registries.ps1 b/scripts/azure-pipelines/end-to-end-tests-dir/registries.ps1 new file mode 100644 index 000000000..b985a61f5 --- /dev/null +++ b/scripts/azure-pipelines/end-to-end-tests-dir/registries.ps1 @@ -0,0 +1,13 @@ +. "$PSScriptRoot/../end-to-end-tests-prelude.ps1" + + +$commonArgs += @("--x-builtin-port-versions-dir=$PSScriptRoot/../../e2e_ports/port_versions") + +Run-Vcpkg install @commonArgs 'vcpkg-internal-e2e-test-port' +Throw-IfNotFailed + +Run-Vcpkg install @commonArgs --feature-flags=registries 'vcpkg-internal-e2e-test-port' +Throw-IfFailed + +Run-Vcpkg install @commonArgs --feature-flags=registries 'zlib' +Throw-IfFailed diff --git a/scripts/azure-pipelines/end-to-end-tests-dir/spaces.ps1 b/scripts/azure-pipelines/end-to-end-tests-dir/spaces.ps1 index 49796c1b0..b7aaf6462 100644 --- a/scripts/azure-pipelines/end-to-end-tests-dir/spaces.ps1 +++ b/scripts/azure-pipelines/end-to-end-tests-dir/spaces.ps1 @@ -1,8 +1,8 @@ . $PSScriptRoot/../end-to-end-tests-prelude.ps1
##### Test spaces in the path
-$CurrentTest = "zlib with spaces in path"
-Write-Host $CurrentTest
+$Script:CurrentTest = "zlib with spaces in path"
+Write-Host $Script:CurrentTest
./vcpkg install zlib "--triplet" $Triplet `
"--no-binarycaching" `
"--x-buildtrees-root=$TestingRoot/build Trees" `
diff --git a/scripts/azure-pipelines/end-to-end-tests-prelude.ps1 b/scripts/azure-pipelines/end-to-end-tests-prelude.ps1 index 057df9fa6..0c675e9bf 100644 --- a/scripts/azure-pipelines/end-to-end-tests-prelude.ps1 +++ b/scripts/azure-pipelines/end-to-end-tests-prelude.ps1 @@ -12,9 +12,9 @@ $commonArgs = @( "--x-buildtrees-root=$buildtreesRoot",
"--x-install-root=$installRoot",
"--x-packages-root=$packagesRoot",
- "--overlay-ports=scripts/e2e_ports"
+ "--overlay-ports=scripts/e2e_ports/overlays"
)
-$CurrentTest = 'unassigned'
+$Script:CurrentTest = 'unassigned'
function Refresh-TestRoot {
Remove-Item -Recurse -Force $TestingRoot -ErrorAction SilentlyContinue
@@ -28,7 +28,7 @@ function Require-FileExists { [string]$File
)
if (-Not (Test-Path $File)) {
- throw "'$CurrentTest' failed to create file '$File'"
+ throw "'$Script:CurrentTest' failed to create file '$File'"
}
}
@@ -38,26 +38,29 @@ function Require-FileNotExists { [string]$File
)
if (Test-Path $File) {
- throw "'$CurrentTest' should not have created file '$File'"
+ throw "'$Script:CurrentTest' should not have created file '$File'"
}
}
function Throw-IfFailed {
if ($LASTEXITCODE -ne 0) {
- throw "'$CurrentTest' had a step with a nonzero exit code"
+ throw "'$Script:CurrentTest' had a step with a nonzero exit code"
}
}
function Throw-IfNotFailed {
if ($LASTEXITCODE -eq 0) {
- throw "'$CurrentTest' had a step with an unexpectedly zero exit code"
+ throw "'$Script:CurrentTest' had a step with an unexpectedly zero exit code"
}
}
function Run-Vcpkg {
- param([string[]]$TestArgs)
- $CurrentTest = "./vcpkg $($testArgs -join ' ')"
- Write-Host $CurrentTest
+ Param(
+ [Parameter(ValueFromRemainingArguments)]
+ [string[]]$TestArgs
+ )
+ $Script:CurrentTest = "./vcpkg $($testArgs -join ' ')"
+ Write-Host $Script:CurrentTest
./vcpkg @testArgs
}
diff --git a/scripts/azure-pipelines/end-to-end-tests.ps1 b/scripts/azure-pipelines/end-to-end-tests.ps1 index f6b5c2e6b..029120d54 100644 --- a/scripts/azure-pipelines/end-to-end-tests.ps1 +++ b/scripts/azure-pipelines/end-to-end-tests.ps1 @@ -34,7 +34,7 @@ $ErrorActionPreference = "Stop" $AllTests = Get-ChildItem $PSScriptRoot/end-to-end-tests-dir/*.ps1
if ($Filter -ne $Null) {
- $AllTests = $AllTests | ? { $_ -match $Filter }
+ $AllTests = $AllTests | ? { $_.Name -match $Filter }
}
$n = 1
$m = $AllTests.Count
diff --git a/scripts/e2e_ports/vcpkg-uses-test-cmake/portfile.cmake b/scripts/e2e_ports/overlays/vcpkg-uses-test-cmake/portfile.cmake index 571ae3b7a..571ae3b7a 100644 --- a/scripts/e2e_ports/vcpkg-uses-test-cmake/portfile.cmake +++ b/scripts/e2e_ports/overlays/vcpkg-uses-test-cmake/portfile.cmake diff --git a/scripts/e2e_ports/vcpkg-uses-test-cmake/vcpkg.json b/scripts/e2e_ports/overlays/vcpkg-uses-test-cmake/vcpkg.json index 9f34e058d..9f34e058d 100644 --- a/scripts/e2e_ports/vcpkg-uses-test-cmake/vcpkg.json +++ b/scripts/e2e_ports/overlays/vcpkg-uses-test-cmake/vcpkg.json diff --git a/scripts/e2e_ports/vcpkg-uses-vcpkg-common-functions/portfile.cmake b/scripts/e2e_ports/overlays/vcpkg-uses-vcpkg-common-functions/portfile.cmake index 9207d30b1..9207d30b1 100644 --- a/scripts/e2e_ports/vcpkg-uses-vcpkg-common-functions/portfile.cmake +++ b/scripts/e2e_ports/overlays/vcpkg-uses-vcpkg-common-functions/portfile.cmake diff --git a/scripts/e2e_ports/vcpkg-uses-vcpkg-common-functions/vcpkg.json b/scripts/e2e_ports/overlays/vcpkg-uses-vcpkg-common-functions/vcpkg.json index 7c16ffe82..7c16ffe82 100644 --- a/scripts/e2e_ports/vcpkg-uses-vcpkg-common-functions/vcpkg.json +++ b/scripts/e2e_ports/overlays/vcpkg-uses-vcpkg-common-functions/vcpkg.json diff --git a/scripts/e2e_ports/port_versions/baseline.json b/scripts/e2e_ports/port_versions/baseline.json new file mode 100644 index 000000000..953e8752d --- /dev/null +++ b/scripts/e2e_ports/port_versions/baseline.json @@ -0,0 +1,3 @@ +{ + "vcpkg-internal-e2e-test-port": { "version-string": "1.0.0" } +} diff --git a/scripts/e2e_ports/port_versions/v-/vcpkg-internal-e2e-test-port.json b/scripts/e2e_ports/port_versions/v-/vcpkg-internal-e2e-test-port.json new file mode 100644 index 000000000..ce7698ebb --- /dev/null +++ b/scripts/e2e_ports/port_versions/v-/vcpkg-internal-e2e-test-port.json @@ -0,0 +1,8 @@ +{ + "versions": [ + { + "version-string": "1.0.0", + "git-tree": "1dc3e42a3c0cafe2884d379af4399273238b986e" + } + ] +} diff --git a/scripts/e2e_ports/vcpkg-internal-e2e-test-port/portfile.cmake b/scripts/e2e_ports/vcpkg-internal-e2e-test-port/portfile.cmake new file mode 100644 index 000000000..065116c27 --- /dev/null +++ b/scripts/e2e_ports/vcpkg-internal-e2e-test-port/portfile.cmake @@ -0,0 +1 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) diff --git a/scripts/e2e_ports/vcpkg-internal-e2e-test-port/vcpkg.json b/scripts/e2e_ports/vcpkg-internal-e2e-test-port/vcpkg.json new file mode 100644 index 000000000..a25da6d23 --- /dev/null +++ b/scripts/e2e_ports/vcpkg-internal-e2e-test-port/vcpkg.json @@ -0,0 +1,4 @@ +{ + "name": "vcpkg-internal-e2e-test-port", + "version-string": "1.0.0" +} |
