devops: fix swiftshader on Chromium Windows (#6391)

References #6390
This commit is contained in:
Andrey Lushnikov 2021-05-03 11:25:01 -07:00 committed by GitHub
parent dddfbaaeb2
commit fd4253991f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 0 deletions

View File

@ -136,6 +136,8 @@ function archive_compiled_chromium() {
if [[ $1 == "--compile-win"* ]]; then
$COPY_COMMAND "${CR_CHECKOUT_PATH}/src/out/Default/"*.manifest "output/${CHROMIUM_FOLDER_NAME}/"
# See https://github.com/microsoft/playwright/issues/6390
node "${SCRIPT_PATH}/fix_windows_swiftshader.js" "output/${CHROMIUM_FOLDER_NAME}/vk_swiftshader_icd.json"
fi
cd output

View File

@ -0,0 +1,13 @@
// See https://github.com/microsoft/playwright/issues/6390
const fs = require('fs');
const FILE_PATH = process.argv[2];
if (!fs.existsSync(FILE_PATH) || !FILE_PATH.endsWith('.json'))
return;
const json = JSON.parse(fs.readFileSync(FILE_PATH, 'utf8'));
if (json.ICD && json.ICD.library_path && json.ICD.library_path.startsWith('.\\')) {
json.ICD.library_path = json.ICD.library_path.substring(2);
fs.writeFileSync(FILE_PATH, JSON.stringify(json), 'utf8');
}