aviralgarg05 opened a new pull request, #3643: URL: https://github.com/apache/nuttx-apps/pull/3643
*Note: Please adhere to [Contributing Guidelines](https://github.com/apache/nuttx/blob/master/CONTRIBUTING.md).* ## Summary This is another slice of the ongoing GSoC 2026 Dynamic ELF loading and `nxpkg` work for NuttX. An earlier draft PR (#3474) carries the initial `nxpkg` package lifecycle helper. PR #3642 extends `nxpkg` with network sync, install hardening, and the rest of its CLI (`update` / `remove` / `rollback` / `available`). This PR adds the first graphical frontend on top of that: `system/nxstore`, an LVGL touchscreen app store. Series order for this PR: - base series context: #3474 (merged) - technical dependency: after #3642 — this PR's base branch is #3642's branch (`gsoc/nxpkg-sync-lifecycle-hardening-pr5`), not `master`, because `nxstore` calls `pkg_sync()` / `pkg_uninstall()` / `pkg_zalloc()` / `pkg_free()` / `pkg_metadata_find_installed()` / `pkg_metadata_find_latest()` and reads `manifest->description` — none of which exist yet on `master`, only as of #3642. This PR will not build standalone against `master` until #3642 merges; GitHub will retarget it automatically at that point and the diff will shrink to just this PR's own commit. - independent of: #3519, #3526, #3531 Concretely, `nxstore` is: - a card-based app list (`populate_app_list()`): each row shows name, version, and description/status, install/launch state reflected via icon glyph and color, and a sliding-segment progress bar during install (no real byte-level progress is available from `pkg_install()`, so this reads as "actively working" without fabricating a percentage) - a supervisor screen (`build_run_screen()` / `nxstore_enter_running_screen()`): a launched app gets a dedicated screen with a name label and a Close button, confined to a border region the launched app's own framebuffer output is expected to never draw into, so switching back to it doesn't fight over pixels with whatever the app already put in the framebuffer - close/reap handling (`close_running_app_event_cb()` / `nxstore_poll_running_app()`): sends `SIGTERM` and polls `waitpid(WNOHANG)`, explicitly treating `ECHILD` as "already gone" rather than "still running" (the close-button handler and the passive per-loop poll both race to reap the same child). There is deliberately no generic force-kill fallback: an earlier version of this code called `task_delete()` when `SIGTERM` wasn't reaped quickly enough, and on real hardware that fallback landed mid framebuffer/heap access and hung the entire board, not just the one task, on this flat-memory build. A launched app can only be closed if it cooperates by installing its own `SIGTERM` handler - toast notifications (`nxstore_toast()`) for install/uninstall/launch outcomes and app-closed events, additive to the durable per-row subtitle text - a bounded (15s) wait on DHCP completion before the boot-time catalog sync, since Wi-Fi association completing doesn't imply DHCP has — fetching before that resolves fails with `-ENETUNREACH`, which is indistinguishable from being genuinely offline without the wait ## Impact User impact: - adds a new `nxstore` command: an on-device, touchscreen graphical front-end for browsing, installing, launching, and closing `nxpkg` packages, instead of driving the same flow from the `nxpkg` CLI by hand Build impact: - adds a new application under `system/nxstore` - depends on `GRAPHICS_LVGL` and `SYSTEM_NXPKG` (and transitively, `NETUTILS_CJSON`/`NETUTILS_WEBCLIENT` via #3642) Runtime impact: - needs a working framebuffer (`/dev/fb0`) and touch input device (`/dev/input0`) - spawns launched packages with a fixed 32 KiB stack (`NXSTORE_LAUNCH_STACKSIZE`) — `posix_spawn`'s own default (`CONFIG_POSIX_SPAWN_DEFAULT_STACKSIZE`, 2 KiB) is far too small for a real LVGL/framebuffer app and overflowing it does not fail loudly Compatibility impact: - none for existing applications unless `CONFIG_SYSTEM_NXSTORE` is enabled ## Testing Host used for build: - OS: macOS 26.5 arm64 - compiler: `xtensa-esp-elf-gcc (crosstool-NG esp-14.2.0_20241119) 14.2.0` Target used for verification: - arch: `xtensa` - board/config used during runtime verification: `esp32s3-touch-lcd-7:nsh` - board: Waveshare ESP32-S3-Touch-LCD-7 (custom board directory, not yet upstream) Runtime flow verified on hardware, repeatedly, across the packages this project has shipped on top of `nxstore` (a calculator, Conway's Game of Life, a matching game, snake, brick breaker, and a Doom port — all separate follow-on PRs): 1. boot to the touchscreen app list, catalog synced automatically at boot 2. tap an uninstalled package's card — install runs in the background with a progress indicator, toast on completion 3. tap the now-installed package's card — it launches, and the supervisor bar with the Close button appears at the top of the screen 4. play/use the launched app for a few seconds 5. tap Close — `SIGTERM` is sent, the app reaps itself, and the app list reappears cleanly Specifically re-verified in this project's most recent hardware pass, directly relevant to `close_running_app_event_cb()` in this PR: launched a package with a previously-known Close-button regression (its own rendering was painting over the reserved top bar every frame), tapped Close, and confirmed via syslog that the sequence in this file executed correctly end-to-end: ``` nxstore: close cb fired, active=1 pid=13 nxstore: close SIGTERM sent to 13 nxstore: close reaped=0 gone=1 after 2 tries ``` This is a draft PR, stacked on the not-yet-merged #3642 — opening now to get the series in front of reviewers. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
