Skip to content

Commit cc6266b

Browse files
GytisCepkCopilot
andcommitted
Ensure Electron binary is downloaded before AppArmor setup in CI
Electron 42 no longer downloads the binary during npm install. Add a CI step to trigger the download before configuring the AppArmor profile for the sandbox. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 0cd5d6c commit cc6266b

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

common/config/azure-pipelines/templates/integration-test-steps.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,23 @@ steps:
3434
node ./common/scripts/install-run-rush webpack:test -v
3535
displayName: "Rush build"
3636
37+
# Electron 42+ no longer downloads the binary during npm install (postinstall removed).
38+
# Ensure the binary is present before configuring the AppArmor profile.
39+
- script: |
40+
ELECTRON_DIR=$(find $PWD/common/temp/node_modules/.pnpm -path "*/electron@*/node_modules/electron" -type d 2>/dev/null | head -n 1)
41+
if [ ! -d "$ELECTRON_DIR" ]; then
42+
echo "##vso[task.logissue type=warning]Unable to find Electron package directory"
43+
elif [ -f "$ELECTRON_DIR/dist/electron" ]; then
44+
echo "Electron binary already present"
45+
elif [ -f "$ELECTRON_DIR/install.js" ]; then
46+
echo "Downloading Electron binary..."
47+
node "$ELECTRON_DIR/install.js"
48+
else
49+
echo "##vso[task.logissue type=warning]Unable to find Electron install script at $ELECTRON_DIR/install.js"
50+
fi
51+
displayName: "Ensure Electron binary is downloaded"
52+
condition: and(succeededOrFailed(), eq(variables['Agent.OS'], 'Linux'))
53+
3754
# Starting Ubuntu 24.04, unprivileged user namespaces are restricted by default via AppArmor.
3855
# Electron's sandbox requires user namespaces, so we create an AppArmor profile that grants the 'userns' permission to the Electron binary.
3956
# See: https://discourse.ubuntu.com/t/ubuntu-24-04-lts-noble-numbat-release-notes/39890#p-99950-unprivileged-user-namespace-restrictions-15

0 commit comments

Comments
 (0)