examples/elf: Extend nxpkg validation coverage.#3531
Conversation
c180ecf to
04e17b4
Compare
04e17b4 to
4429450
Compare
acassis
left a comment
There was a problem hiding this comment.
@aviralgarg05 please test CMake as well, NuttX used both building systems
bf8be7a to
7f20e7e
Compare
|
@xiaoxiang781216 PTAL |
|
This PR is ready to merge :) |
linguini1
left a comment
There was a problem hiding this comment.
This change enforces that the user has Python as part of the build system, which I remember was a contentious issue.
Also, is the elf example not different from the nxpkg application? I don't think we should be generating nxpkg test artifacts from the elf example. It would be better to include those under some test/ directory.
|
@aviralgarg05 please convert these tools to C, I think it is safer |
|
I pushed an update for this. The Python generators added by this PR are gone now. The fixture helper is now a small C host tool, and the CMake path uses the existing in-tree tooling style instead of introducing new Python build steps. I kept the fixture under |
14f6e92 to
8ef5065
Compare
Extend the examples/elf ROMFS path so nxpkg validation can use generated package fixtures instead of hand-managed metadata. Generate index.json, bad-index.json, pkgtest.nsh, and pkgfail.nsh from the built hello ELF, recording the correct target arch/compat metadata and SHA-256 digest for the valid fixture. Keep mismatched- target and missing-artifact cases alongside the valid fixture so nxpkg target selection and failure handling can be exercised from the same example tree. Group the paired fixture outputs in one make step so parallel builds do not re-enter the generator independently. This keeps the fixture metadata tied to the actual built hello artifact instead of relying on manually maintained hashes or ad hoc shell setup, making follow-up review and later test reruns more predictable. There is no intended loader or board-behavior change; this is limited to fixture generation inside examples/elf. Assisted-by: Claude:claude-sonnet-5 Assisted-by: OpenAI Codex:gpt-5.6-sol Signed-off-by: aviralgarg05 <gargaviral99@gmail.com>
8ef5065 to
98a74df
Compare
|
Updated as one signed commit. The C host generator is shared by the Make and CMake paths, and the CMake graph now defines the loadable |
|
One additional scope clarification: the loadable fixture itself now lives under |
Summary
Generate reproducible
nxpkgvalidation fixtures from theexamples/elfhelloartifact.A C host helper creates:
index.jsonfor a valid package and a mismatched target;bad-index.jsonfor a missing artifact;pkgtest.nshfor the successful install/list path; andpkgfail.nshfor the expected failure path.The SHA-256 digest and target metadata are derived from the artifact and build
configuration instead of being maintained by hand.
The generated scripts seed both the original
/etc/nxpkg/index.jsoncataloglocation and #3642's default
/var/lib/nxpkg/index.jsnlocation. This keepsthe standalone fixtures usable before and after the storage migration.
Impact
examples/elf; a C host helper is used by Make and CMake.fixture.
artifact and build metadata.
Testing
Host:
xtensa-esp-elf-gcc 14.2.0(
esp-14.2.0_20241119)Target:
esp32s3-xiao:elfCONFIG_EXAMPLES_ELF_ROMFS=yandCONFIG_SYSTEM_NXPKG=y. The relatedNuttX branch's current
esp32s3-xiao:elfdefconfig does not enableCONFIG_SYSTEM_NXPKG, so that prerequisite must be added before collectingthe final target log.
Verification:
hellotarget and verifiedelf_artifactspath;nuttx.binlink.Testing logs before change:
Testing logs after change:
The full retained serial transcript should be attached with the signed update.
PR verification Self-Check