Skip to content

fix(blanc): start 1.43 ECS builds under zypak - #842

Merged
jing2uo merged 1 commit into
mainfrom
fix/blanc-ecs
Oct 25, 2026
Merged

jing2uo merged 1 commit into
mainfrom
fix/blanc-ecs

Conversation

@jing2uo

@jing2uo jing2uo commented Oct 25, 2026

Copy link
Copy Markdown
Collaborator

Fixes #838.

Blanc 1.43 moved to castLabs ECS (Widevine Electron). Two things broke for the Flatpak, both diagnosed with upstream in bnfy/blanc#580:

  • Unpack: AppRun now execs a native blanc-ecs-launcher and no longer names the Electron binary (BIN=). apply_extra.sh falls back to the AppDir's root desktop file, which electron-builder names after the same executableName (blanc.desktop → blanc).
  • Start: a CHROME_DESKTOP leaked from the launching environment (a VS Code terminal sets code.desktop) makes Electron's GetApplicationName() call g_desktop_app_info_new() in the zygote. Inside Flatpak GIO then starts a gmain thread, and the zygote aborts (CHECK, SIGTRAP) because it must be single-threaded to enter the sandbox. Fixed with --unset-env=CHROME_DESKTOP in finish-args, the same treatment as ELECTRON_RUN_AS_NODE: zypak's portal-spawned children get Flatpak's environment, so the wrapper can't unset it for them.

The wrapper still execs the Electron ELF under zypak. The ECS launcher replaces LD_PRELOAD, which would drop zypak's hooks. The wrapper sets what main.js requires from the launcher instead: BLANC_ECS_LAUNCHER_ROOT, plus BLANC_ECS_FULL_PROFILE with the same profile passed as --user-data-dir. A user-supplied --user-data-dir is rejected with a message, because Blanc's profile guard would refuse it anyway. Protected (DRM) playback is unavailable, and the metainfo now says so.

This overlaps with #841 from the Blanc maintainer, which takes the same approach. The differences: this PR doesn't run the vendor launcher's --ecs-query-cdm on every start (it only fed a log line and added a way to fail at startup), it keeps resolving the launcher name from the AppDir instead of hardcoding blanc, and it adds no app-specific test.

Tested (local build, publish.sh --verify, Hyprland)

  • Unpacks as a system install: check-apply-extra.sh passes with the 1.43.1 pin.
  • Starts and draws: X11 (:99, launched from a VS Code terminal with CHROME_DESKTOP=code.desktop set) and native Wayland.
  • Renderer sandbox: renderers have Seccomp: 2, NoNewPrivs: 1 and a separate network namespace.
  • Browsing: X11, a URL loads. Wayland, URLs and searches typed into the address editor load.
  • Data survives a restart: after closing the window normally the session comes back and browsing works. If Blanc is killed instead (flatpak kill, CDP Browser.close), it records an unclean exit and holds every navigation until the user picks restore or fresh on the start page. That is upstream's own behaviour, not a packaging issue.
  • Nothing new in the home folder: ls -A ~ is unchanged. The profile is ~/.var/app/com.blancbrowser.Blanc/config/Blanc.
  • --user-data-dir: both forms exit 2 with the message.

Not tested: DRM (unavailable by design), file chooser, notifications, screen sharing, tray/MPRIS bus names.

Possibly pre-existing: on Wayland the window's app_id is blanc, while the desktop file has StartupWMClass=Blanc. Not compared against 1.42.1.

Blanc 1.43 moved to castLabs ECS and its AppRun now execs a native
blanc-ecs-launcher instead of naming the Electron binary, so apply_extra
could no longer find the launcher (#838).

- apply_extra: when AppRun has no BIN= line, take the executable name from
  the AppDir's root desktop file (electron-builder names it after the same
  executableName).
- manifest: unset CHROME_DESKTOP. A value leaked from the launching
  environment (e.g. code.desktop) makes Electron look the desktop file up
  through GIO inside the zygote; GIO starts a thread and the zygote aborts
  before entering the sandbox. zypak's portal-spawned children get
  Flatpak's environment, so the wrapper cannot unset it for them.
- wrapper: keep exec'ing the Electron ELF under zypak (the ECS launcher
  replaces LD_PRELOAD and would drop zypak's hooks), and set the
  environment main.js requires from it: BLANC_ECS_LAUNCHER_ROOT and
  BLANC_ECS_FULL_PROFILE, with the same profile passed as --user-data-dir.
  A conflicting --user-data-dir is rejected with a message.
- metainfo: protected (DRM) playback is unavailable in this package.

Diagnosed together with upstream in bnfy/blanc#580.
@jing2uo
jing2uo merged commit d59bb36 into main Oct 25, 2026
@jing2uo
jing2uo deleted the fix/blanc-ecs branch October 25, 2026 02:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

update-check: com.blancbrowser.Blanc no longer unpacks

1 participant