Skip to content

feat(cross): support augment libraries in native (local) builds#115

Merged
jwinarske merged 1 commit into
mainfrom
jw/native-augment-staging
Jul 12, 2026
Merged

feat(cross): support augment libraries in native (local) builds#115
jwinarske merged 1 commit into
mainfrom
jw/native-augment-staging

Conversation

@jwinarske

Copy link
Copy Markdown
Contributor

Summary

A native build (emb cross . --build, no --target) couldn't use augment libraries resolved by a CMake config / find_program — most importantly sentry-native under BUILD_CRASH_HANDLER=ON. Two gaps:

  1. The --build path skipped augment staging entirely for native (if (!native …)).
  2. --prepare staged into profile.targetSysroot, which is empty for a native profile → DESTDIR=/ → the augment installed into the host /usr (Permission denied without root).

So a native embedder configure failed at find_package(sentry) / crashpad resolution.

Changes

  • Native augments now build into a separate per-workspace overlay (stageInto: null) instead of the sysroot. The existing _separateOverlay wiring already exposes that prefix as CMAKE_FIND_ROOT_PATH / CMAKE_PREFIX_PATH, so find_package(CONFIG) and find_program resolve it with no extra plumbing. --prepare stages the same way.
  • pkgConfigEnv: for a native build (no sysroot) prepend the overlay via PKG_CONFIG_PATH instead of replacing the search path with PKG_CONFIG_LIBDIR — otherwise the host's system packages (xkbcommon, …) become invisible and the backend build fails.

Host-satisfied augments (found via pkg-config) are still skipped, so this only builds what the host lacks (e.g. sentry-native).

Testing

  • dart analyze clean; dart test test/src/cross/* green (incl. overlay_builder_test, cross_builder_test).
  • End-to-end: emb cross . --backend software -D BUILD_CRASH_HANDLER=ON -D INTEGRATION_TEST_CRASH_HANDLER=ON --build on x86_64 now builds a homescreen with the crash handler — sentry-native staged into the overlay (<overlay>/usr/lib64/cmake/sentry), find_package(sentry) + crashpad find_program resolve it, host xkbcommon still resolves, binary links (1684 sentry/crashpad symbols).

Enables the ivi-homescreen crash-handler CI to build the PR-under-test via emb local instead of a pinned workspace checkout.

A native `emb cross . --build` (no --target) skipped augment staging
entirely, and `--prepare` staged into `targetSysroot` — empty for a
native profile, so the install landed in the host `/usr` (needs root).
An augment resolved by a CMake config / find_program (e.g. sentry-native
under BUILD_CRASH_HANDLER) was therefore unavailable to a native embedder
configure.

- Build non-host-satisfied augments for native too, into a separate
  per-workspace overlay prefix (stageInto: null) instead of the sysroot.
  The existing _separateOverlay wiring adds it as CMAKE_FIND_ROOT_PATH /
  CMAKE_PREFIX_PATH, so find_package(CONFIG) / find_program resolve it.
- --prepare stages the same way for native.
- pkgConfigEnv: for a native build (no sysroot) PREPEND the overlay via
  PKG_CONFIG_PATH rather than REPLACING the search path with
  PKG_CONFIG_LIBDIR, so the host's system packages (xkbcommon, ...) still
  resolve alongside the overlay.

Signed-off-by: Joel Winarske <joel.winarske@linux.com>
@jwinarske jwinarske changed the title cross: support augment libraries in native (local) builds feat(cross): support augment libraries in native (local) builds Jul 12, 2026
@jwinarske
jwinarske force-pushed the jw/native-augment-staging branch from 7498924 to f63e4ed Compare July 12, 2026 01:07
@jwinarske
jwinarske merged commit 91c8b09 into main Jul 12, 2026
39 checks passed
@jwinarske
jwinarske deleted the jw/native-augment-staging branch July 12, 2026 01:13
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.

1 participant