system/nxpkg: Complete the package lifecycle and command line. - #3720
Conversation
🔗 Cross-repo PR dependenciesThe read-only Build run reported the following dependent PR(s) and fetched head SHA(s): CI run: https://github.com/apache/nuttx-apps/actions/runs/31526679208 |
9dbbc31
77f790d to
9dbbc31
Compare
9dbbc31 to
51b68e8
Compare
🔗 Cross-repo PR dependenciesThe read-only Build run reported the following dependent PR(s) and fetched head SHA(s): CI run: https://github.com/apache/nuttx-apps/actions/runs/31814249024 |
dcbae37 to
0d01415
Compare
|
@aviralgarg05 please squash into one patch. |
🔗 Cross-repo PR dependenciesThe read-only Build run reported the following dependent PR(s) and fetched head SHA(s): CI run: https://github.com/apache/nuttx-apps/actions/runs/31878516149 |
0d01415 to
6eeb4f6
Compare
🔗 Cross-repo PR dependenciesThe read-only Build run reported the following dependent PR(s) and fetched head SHA(s): CI run: https://github.com/apache/nuttx-apps/actions/runs/31879827062 |
6eeb4f6 to
8094f09
Compare
Add the remaining package commands. Order database and payload updates so failures do not leave stale version pointers. Signed-off-by: aviralgarg05 <gargaviral99@gmail.com>
8094f09 to
6fa06f0
Compare
🔗 Cross-repo PR dependenciesThe read-only Build run reported the following dependent PR(s) and fetched head SHA(s): CI run: https://github.com/apache/nuttx-apps/actions/runs/31955914104 |
Note: Please adhere to Contributing Guidelines.
Depends-On: /pull/3719
Summary
Install wrote the current and previous pointer files, and removed the
payload of a pruned version, around the database save rather than after it.
A failure in between left the database naming a version whose files were
already gone. Reinstalling a version that was already present treated its
directory as newly created, so a failed reinstall deleted a working
install. Uninstall and rollback took only the database lock, which left
another install free to work on the same package at the same time.
The database is now committed first, and only then are pointers refreshed
or files deleted. A crash can therefore strand files that are reclaimable,
but never leaves the database pointing at a payload that is gone. Uninstall
and rollback take the per-package lock as well, and install picks up state
left behind by an earlier attempt that was interrupted.
Only
install,listandavailablewere reachable from the shell, so apackage could be put on a device but never updated, rolled back or removed.
sync,update,removeandrollbackare now wired up, and the CLIreports the errno the library returns rather than a plain failure.
This is the last of four parts of #3642, which was one commit covering
several unrelated changes.
Impact
payload the database still refers to.
Testing
Build host: macOS 26.5, arm64,
xtensa-esp-elf-gcc 14.2.0(
esp-14.2.0_20251107).Target: Xtensa / ESP32-S3, Waveshare ESP32-S3-Touch-LCD-7.
nxstyle,tools/checkpatch.sh,codespellandgit diff --checkonevery changed file
system/nxpkgsources compiled for the target with this commitapplied on top of system/nxpkg: Fetch the catalog and artifacts over the network. #3719
On the target, against a repository on the SD card, the following were
exercised: install, update to a second version, rollback to the first,
remove, a package lock held against a second install returning
-EBUSY, alock reclaimed from an exited owner and from an earlier boot, and an
artifact whose SHA-256 did not match, which left no database entry, version
directory, lock or transaction file behind.
This commit does not build on
masteralone because it uses declarationsand helpers added by the three parts before it; the
Depends-Online abovelets CI apply those first.
PR verification Self-Check