summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBert Belder <bertbelder@gmail.com>2018-08-25 19:02:21 +0200
committerBert Belder <bertbelder@gmail.com>2018-08-26 18:27:23 +0200
commit7041f2e5f19e8c9dfbe82d0ebf6456d9c9072aca (patch)
treeaf603efa21becd848b7426dae5c3e6b9c1616bbd
parentdc105cca5ad907d77354b0570a38f3abf964d8a6 (diff)
appveyor: verify that ninja files do not use absolute path names
Using absolute paths is generally not intended, and it makes ccache/sccache much less effective.
-rw-r--r--.appveyor.yml16
1 files changed, 16 insertions, 0 deletions
diff --git a/.appveyor.yml b/.appveyor.yml
index 54efd1042..9e37f3640 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -331,6 +331,22 @@ after_test:
throw "Build should be up-to-date but isnt't."
}
+ # Verify that generated ninja files do not use absolute path names.
+ # If they do, it makes ccache/sccache much less effective.
+ - ps: |-
+ $trap = "NO_ABS_PATH_PLS"
+ $dir = "$env:APPVEYOR_BUILD_FOLDER\out\$trap"
+ Exec { gn gen $dir | Out-Null }
+ $files = Get-Tree $dir -File -Force -Recurse | where Extension -ne ".dll"
+ Select-String $trap -Path $files -SimpleMatch | tee -Variable line_matches
+ if ($line_matches) {
+ $ctx = $line_matches.Line |
+ Select-String "[^\s;,]*[\s=]*[^\s;,=]*$trap[^\s;,]*" -AllMatches |
+ foreach { $_.Matches.Value -replace '\$(.)', '$1' } |
+ sort -Unique
+ throw @("Absolute path(s) found in build script:") + $ctx -join "`n "
+ }
+
# If this build is going to be deployed, build a zip file.
- ps: |-
if ($env:APPVEYOR_REPO_TAG -eq "true") {