electron_app accepts declared file or tree-artifact labels:
extra_resources = {":settings": "config/settings.json"},
extra_files = {":notice": "licenses/NOTICE.txt"},extra_resources copies beneath resources/ on Linux/Windows and
Contents/Resources/ on macOS. extra_files copies beneath the distribution root
on Linux/Windows and Contents/ on macOS, matching
electron-builder's content directories.
Both stay outside app.asar.
Mappings require normalized relative destinations. Tree contents retain relative paths, including dotfiles. Assembly preserves executable status, normalizes modes to 0755/0644 and timestamps to epoch. It rejects app/ASAR destinations, duplicate paths, file/directory collisions and runtime-file replacement. Windows/macOS collision checks ignore case. Raw directory symlinks in tree artifacts remain unsupported; Bazel tree artifacts do not support symlinks.
Declare internal resource links separately on Linux/macOS:
extra_resources = {":settings": "versions/v1/settings.json"},
resource_symlinks = {"current": "versions/v1", "nested/config": "current"},Targets are relative to the resource root. Links retain filesystem semantics,
including chains and directory aliases. Missing targets, escapes, cycles,
collisions and links into app/ASAR paths fail before assembly writes output.
Linux apps with links use a ZIP-backed ElectronAppInfo artifact, avoiding
unsupported symlinks in Bazel tree outputs. Release archives and DEB packaging
stream that ZIP; immutable imports validate its layout and CPU. macOS retains
links through signing and its app ZIP. Generated trees carry logical resource
links through ElectronFileTreeInfo.symlink_manifest; see
file selection. Windows junction/link installation remains
open.
The a27aaca BB suite passed actual app ZIP, immutable import, TAR and DEB action boundaries, including relocated directory aliases and target updates observed through links. The seven cross-build variants and four native host types passed. macOS native smoke checks both resource links after signing and ZIP relocation, through Electron's filesystem API.
At runtime, process.resourcesPath locates extra resources. Its parent locates
extra files on all three platforms. The desktop example reads a packaged notice
there during native smoke.
The Linux/macOS example also mounts the generated renderer provider at
extra_resources[":renderer_files"] = "generated" and
extra_files[":renderer_files"] = "generated-files". Native smoke checks real
file/directory symlinks after relocation, canonical paths, filtered files and
empty directories through both mounts. The
3809857 BB cross-build
and native matrix
passed these checks on Linux x64/macOS ARM64, including installed updates and
macOS signing/DMG relocation.
:plain_link_app uses asar = False with the same generated provider. Its
:plain_links release ZIP goes through validated extraction and native Electron
filesystem checks on Linux x64/macOS ARM64, including a strict macOS signature
check. Linux ARM64 is cross-built only. The
75416bc BB cross-build
and native matrix
passed both plain-app gates alongside the ASAR, installer and updater checks.
BB assembly tests and seven cross-build variants passed. Native smoke passed on Linux x64, macOS ARM64 and Windows x64/ARM64, including installed DEB/NSIS flows. Assembly tests cover file/tree layout on all platforms, relocation, ASAR exclusion, executable modes, dotfiles and rejected app/runtime collisions.