build: fixup windows source cache for release (#46272)

* build: fixup windows source cache for release

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>

* build: fixup ffmpeg gn gen

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>

* build: add build-tools depot_tools to PATH

There are some cases where it is still expected that depot_tools be in the path

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>

* put back regular gn gen for ffmpeg

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>

* build: add retry to moving source cache

This resolves the error: `Move-Item : The process cannot access the file because it is being used by another process.`

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
This commit is contained in:
trop[bot] 2025-03-25 17:45:38 -07:00 committed by GitHub
parent ac22aa932f
commit 7a950f09ae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 27 additions and 15 deletions

View file

@ -185,7 +185,7 @@ runs:
if: ${{ inputs.is-release == 'true' }} if: ${{ inputs.is-release == 'true' }}
run: | run: |
cd src cd src
e d gn gen out/ffmpeg --args="import(\"//electron/build/args/ffmpeg.gn\") use_remoteexec=true $GN_EXTRA_ARGS" gn gen out/ffmpeg --args="import(\"//electron/build/args/ffmpeg.gn\") use_remoteexec=true $GN_EXTRA_ARGS"
e build --target electron:electron_ffmpeg_zip -C ../../out/ffmpeg -j $NUMBER_OF_NINJA_PROCESSES e build --target electron:electron_ffmpeg_zip -C ../../out/ffmpeg -j $NUMBER_OF_NINJA_PROCESSES
- name: Generate Hunspell Dictionaries ${{ inputs.step-suffix }} - name: Generate Hunspell Dictionaries ${{ inputs.step-suffix }}
shell: bash shell: bash

View file

@ -19,3 +19,4 @@ runs:
e d cipd.bat --version e d cipd.bat --version
cp "C:\Python311\python.exe" "C:\Python311\python3.exe" cp "C:\Python311\python.exe" "C:\Python311\python3.exe"
fi fi
echo "$HOME/.electron_build_tools/third_party/depot_tools" >> $GITHUB_PATH

View file

@ -97,18 +97,28 @@ runs:
$TEMP_DIR=New-Item -ItemType Directory -Path temp-cache $TEMP_DIR=New-Item -ItemType Directory -Path temp-cache
$TEMP_DIR_PATH = $TEMP_DIR.FullName $TEMP_DIR_PATH = $TEMP_DIR.FullName
C:\ProgramData\Chocolatey\bin\7z.exe -y x $src_cache -o"$TEMP_DIR_PATH" C:\ProgramData\Chocolatey\bin\7z.exe -y x $src_cache -o"$TEMP_DIR_PATH"
if (Test-Path "temp-cache\src") {
Write-Host "Relocating Cache"
Remove-Item -Recurse -Force src
Move-Item temp-cache\src src
Write-Host "Deleting zip file" - name: Move Src Cache (Windows)
Remove-Item -Force $src_cache if: ${{ inputs.target-platform == 'win' }}
} uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0
if (-Not (Test-Path "src\third_party\blink")) { with:
Write-Host "Cache was not correctly restored - exiting" timeout_minutes: 30
exit 1 max_attempts: 3
} retry_on: error
shell: powershell
command: |
if (Test-Path "temp-cache\src") {
Write-Host "Relocating Cache"
Remove-Item -Recurse -Force src
Move-Item temp-cache\src src
Write-Host "Wiping Electron Directory" Write-Host "Deleting zip file"
Remove-Item -Recurse -Force src\electron Remove-Item -Force $src_cache
}
if (-Not (Test-Path "src\third_party\blink")) {
Write-Host "Cache was not correctly restored - exiting"
exit 1
}
Write-Host "Wiping Electron Directory"
Remove-Item -Recurse -Force src\electron

View file

@ -25,7 +25,8 @@ jobs:
image: ghcr.io/electron/build:${{ inputs.build-image-sha }} image: ghcr.io/electron/build:${{ inputs.build-image-sha }}
options: --user root --device /dev/fuse --cap-add SYS_ADMIN options: --user root --device /dev/fuse --cap-add SYS_ADMIN
volumes: volumes:
- /mnt/cross-instance-cache:/mnt/cross-instance-cache - /mnt/win-cache:/mnt/win-cache
- /var/run/sas:/var/run/sas
env: env:
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_win=True' GCLIENT_EXTRA_ARGS: '--custom-var=checkout_win=True'
TARGET_OS: 'win' TARGET_OS: 'win'