test[CI][littlefs]: add RT-Thread QEMU smoke coverage#35
Conversation
add DFS v2 mount, dentry, vnode and filesystem type registration paths for littlefs centralize DFS ABI differences across DFS v2, RT-Thread 5.x DFS v1 and legacy DFS layouts adapt read/write/lseek signatures and explicit offset handling for DFS v2 keep legacy DFS v1 behavior through compatibility macros verify basic build and QEMU littlefs DFS v2 smoke flow on bsp/qemu-vexpress-a9
avoid copying DFS_PATH_MAX bytes into struct dirent d_name use the actual d_name buffer size when filling littlefs directory entries keep d_namlen consistent with the copied name length after truncation fix stack corruption observed when listing littlefs directories on DFS v2
add RT-Thread qemu-vexpress-a9 compile checks for littlefs DFS profiles cover legacy DFS, RT-Thread 5.x DFS v1, DFS v2, and master builds reuse a prepared RT-Thread checkout across profile builds to reduce repeated downloads upload per-profile build logs for CI failure diagnosis
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
WalkthroughAdds a CI workflow, a composite setup action, a strict build orchestration script for RT-Thread + LittleFS (Kconfig wiring, source caching, ELF symbol checks), CI-only smoke/compile-check sources and a QEMU RAM MTD emulation, and refactors dfs_lfs.c to unify RT-Thread DFS v1/v2 ABIs with v2-aware file and mount operations. ChangesRT-Thread LittleFS CI and DFS v1/v2 Support
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
dfs_lfs.c (1)
808-845:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winOn
O_CREAT|O_DIRECTORY, a successfullfs_mkdiris not rolled back iflfs_dir_openlater fails.If
lfs_mkdirsucceeds (Line 813) butlfs_dir_openfails (Line 828), the freshly created directory remains on flash, but we report failure to the caller and freedfs_lfs_fd. On retry the nextmkdirwill hitLFS_ERR_EXIST. It's a narrow window —lfs_dir_openrarely fails on a directory that was just created — but on a real device it can leave inconsistent state.🛡️ Suggested rollback on dir_open failure
if (file->flags & O_CREAT) { `#ifndef` LFS_READONLY result = lfs_mkdir(dfs_lfs_fd->lfs, path); `#else` result = -EINVAL; `#endif` if (result != LFS_ERR_OK) { goto _error_dir; } else { time_t now = time(RT_NULL); lfs_setattr(dfs_lfs_fd->lfs, DFS_LFS_FILE_PATH(file), ATTR_TIMESTAMP, &now, sizeof(time_t)); } } result = lfs_dir_open(dfs_lfs_fd->lfs, &dfs_lfs_fd->u.dir, path); if (result != LFS_ERR_OK) { +#ifndef LFS_READONLY + if (file->flags & O_CREAT) + { + /* Roll back the directory we just created. */ + (void)lfs_remove(dfs_lfs_fd->lfs, path); + } +#endif goto _error_dir; }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@dfs_lfs.c` around lines 808 - 845, When lfs_mkdir succeeds but lfs_dir_open fails (in the open/create path around dfs_lfs_fd, lfs_mkdir and lfs_dir_open), roll back the created directory: call the LittleFS removal API (e.g., lfs_remove or rmdir equivalent) on DFS_LFS_FILE_PATH(file) when file->flags includes O_CREAT and mkdir returned OK, ignore non-critical errors from the removal, then proceed to free dfs_lfs_fd and return the translated error; update the error path at the _error_dir handling after lfs_dir_open to perform this cleanup so a partially-created directory is not left on flash.
🧹 Nitpick comments (11)
.github/ci/rtthread-littlefs/build.sh (4)
450-454: 💤 Low value
lfsrootMTD device is registered but never used.
qemu_lfs_mtd_devicesallocates and registers two devices, but the smoke test only ever exerciseslfsnor(LFS_SMOKE_DEVat Line 670). The unusedlfsrootinstance still consumes ~512 KiB of RAM (QEMU_LFS_MTD_TOTAL_SIZE) on every QEMU boot, which can be tight on the qemu-vexpress-a9 default heap. Consider dropping it (or wiring it into the test) to keep the smoke image lean.♻️ Proposed cleanup if `lfsroot` is genuinely unused
-/** `@brief` Number of RAM-backed MTD NOR devices used by the smoke test. */ -#define QEMU_LFS_MTD_DEVICE_COUNT 2U +/** `@brief` Number of RAM-backed MTD NOR devices used by the smoke test. */ +#define QEMU_LFS_MTD_DEVICE_COUNT 1U @@ static qemu_lfs_mtd_instance_t qemu_lfs_mtd_devices[QEMU_LFS_MTD_DEVICE_COUNT] = { - { .name = "lfsroot" }, { .name = "lfsnor" }, };🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/ci/rtthread-littlefs/build.sh around lines 450 - 454, The qemu_lfs_mtd_devices array registers two MTDs but lfsroot is never used by the smoke test (only LFS_SMOKE_DEV / "lfsnor" is exercised), wasting QEMU_LFS_MTD_TOTAL_SIZE RAM; remove the unused entry by deleting the qemu_lfs_mtd_devices element with .name = "lfsroot" (or alternatively wire "lfsroot" into the smoke test via LFS_SMOKE_DEV) so only the needed qemu_lfs_mtd_instance_t entries are allocated.
528-544: 💤 Low valueOff-by-one in MTD bounds check (
>should be>=).
((rt_size_t)offset > QEMU_LFS_MTD_TOTAL_SIZE)permitsoffset == QEMU_LFS_MTD_TOTAL_SIZEto fall through. Withlength == 0this is harmless, but combined with any positivelengththe second checklength > QEMU_LFS_MTD_TOTAL_SIZE - (rt_size_t)offsetcovers it. The same pattern is duplicated across read/write/erase. Tighten to>=for clarity and to avoid surprise if a future change assumes a strict in-range invariant after this check.♻️ Proposed tightening
- if ((storage == RT_NULL) || (data == RT_NULL) || (offset < 0) || - ((rt_size_t)offset > QEMU_LFS_MTD_TOTAL_SIZE) || - (length > QEMU_LFS_MTD_TOTAL_SIZE - (rt_size_t)offset)) + if ((storage == RT_NULL) || (data == RT_NULL) || (offset < 0) || + ((rt_size_t)offset >= QEMU_LFS_MTD_TOTAL_SIZE) || + (length > QEMU_LFS_MTD_TOTAL_SIZE - (rt_size_t)offset))Also applies to: 555-571, 581-602
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/ci/rtthread-littlefs/build.sh around lines 528 - 544, The bounds check in qemu_lfs_mtd_read is off-by-one: change the condition ((rt_size_t)offset > QEMU_LFS_MTD_TOTAL_SIZE) to ((rt_size_t)offset >= QEMU_LFS_MTD_TOTAL_SIZE) so an offset equal to TOTAL_SIZE is rejected; apply the same tightening to the analogous checks in qemu_lfs_mtd_write and qemu_lfs_mtd_erase (and any duplicated checks) so all three functions consistently reject offset == TOTAL_SIZE and avoid allowing out-of-range accesses.
1438-1438: 💤 Low value
copy_packageexcludesrtthread_workonly when it lives under the repo root.
relative_child_pathsilently returns no output whenchildis not insideparent. WithRTTHREAD_WORKDIRdefaulting toRUNNER_TEMP(outside the repo),exclude_relbecomes empty andcopy_packagefalls into the no-exclude branch. That is harmless today (the workdir is not under repo_root), but the call site reads as ifrtthread_workis always excluded. Consider documenting that the third argument is best-effort, or warning when an explicitexclude_diris passed but resolves to nothing.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/ci/rtthread-littlefs/build.sh at line 1438, The call to copy_package("$repo_root","$package_dir","$rtthread_work") assumes the third arg will be excluded but relative_child_path can return empty when "$rtthread_work" is outside "$repo_root" (RTTHREAD_WORKDIR defaults to RUNNER_TEMP), causing exclude_rel to be empty and the no-exclude branch to run silently; fix by making copy_package (or the call site) detect when relative_child_path returns empty and either (a) log a warning that the requested exclude_dir ("$rtthread_work") did not resolve under "$repo_root" and thus will not be excluded, or (b) treat the third argument as best-effort and document that behavior; update copy_package and/or relative_child_path to explicitly check for an empty exclude_rel and emit the warning including the values of RTTHREAD_WORKDIR/RUNNER_TEMP so callers see why exclusion didn't occur.
995-1044: ⚡ Quick win
$!captures the subshell PID, notqemu-system-arm; cleanup may not kill QEMU.Because the QEMU invocation is wrapped in
( ... ) > "$log_file" 2>&1 &,qemu_pid=$!records the subshell's PID. On most shells,kill "$qemu_pid"then signals only the subshell; theqemu-system-armchild can survive (especially when started viash ./qemu.sh), and the subsequentwait "$qemu_pid"returns immediately while QEMU keeps running. On ephemeral GH runners this rarely matters, but it can mask hangs locally and confuses log truncation, since QEMU may keep appending aftercat "$log_file".Two common fixes:
execinto qemu inside the subshell so$!is qemu itself, or signal the whole process group.🛡️ Suggested fix using
execinside the subshell( cd "$bsp_dir" if [ -f ./qemu.sh ]; then - QEMU_AUDIO_DRV=none sh ./qemu.sh + exec env QEMU_AUDIO_DRV=none sh ./qemu.sh else - qemu-system-arm -M vexpress-a9 -smp 2 -kernel rtthread.elf \ - -nographic -serial mon:stdio + exec qemu-system-arm -M vexpress-a9 -smp 2 -kernel rtthread.elf \ + -nographic -serial mon:stdio fi ) > "$log_file" 2>&1 &Note:
execinsidesh ./qemu.shis up to that script, so this only fully solves it for the inline branch. For theqemu.shbranch you may wantsetsid/pkill -P "$qemu_pid"on cleanup as well.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/ci/rtthread-littlefs/build.sh around lines 995 - 1044, The backgrounded subshell currently sets qemu_pid=$! which points to the subshell, not the qemu child; change the launch so qemu becomes the PID captured: inside the subshell replace the qemu invocations with exec (e.g. exec QEMU_AUDIO_DRV=none sh ./qemu.sh and exec qemu-system-arm ... ) so $! is qemu itself (reference qemu_pid); alternatively start the subshell in a new session (setsid ...) and on cleanup kill the process group (kill -TERM -$qemu_pid) to ensure the real qemu process is terminated — update both branches that run sh ./qemu.sh and qemu-system-arm accordingly and ensure the existing kill/wait logic uses qemu_pid or the negative PGID.dfs_lfs.c (4)
1299-1323: 💤 Low value
_dfs_lfs_create_vnodeORs callermodewithS_IFDIR/S_IFREGwithout masking type bits.If a future caller passes a mode that already includes
S_IFMTbits, the resultingvnode->modewill have inconsistent type/permission bits. Mask first to be safe:- vnode->mode = (type == FT_DIRECTORY) ? (S_IFDIR | mode) : (S_IFREG | mode); + vnode->mode = ((type == FT_DIRECTORY) ? S_IFDIR : S_IFREG) | (mode & ~S_IFMT);Today the only caller is the v2 DFS layer, which passes raw permission bits, so this is defensive only.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@dfs_lfs.c` around lines 1299 - 1323, The vnode->mode is currently set by ORing caller-supplied mode with S_IFDIR/S_IFREG which can preserve any S_IFMT bits the caller included; update _dfs_lfs_create_vnode to mask out file-type bits from the incoming mode before ORing (e.g. compute cleaned_mode = mode & ~S_IFMT and then set vnode->mode = (type == FT_DIRECTORY) ? (S_IFDIR | cleaned_mode) : (S_IFREG | cleaned_mode)) so vnode->mode always has correct type bits regardless of caller input.
1100-1150: 💤 Low value
SEEK_ENDfor directories usesvnode->size, which is always 0.In the v2 lseek translation (Lines 1109-1123),
SEEK_ENDaddsDFS_LFS_FILE_SIZE(file). For directories, lfs reportssize == 0fromlfs_stat, so_dfs_lfs_lookuppopulatesvnode->size = 0(Line 1289).lseek(dirfd, n, SEEK_END)thus behaves likeSEEK_SET, which is unlikely to be what callers expect for directories — though POSIX says the result oflseekon a directory is implementation-defined, so this is acceptable. Worth a one-line comment so the next reader doesn't think it's a bug.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@dfs_lfs.c` around lines 1100 - 1150, The SEEK_END branch in _dfs_lfs_lseek (switch over DFS_LFS_LSEEK_WHENCE) adds DFS_LFS_FILE_SIZE(file), but for directories vnode->size is always 0 because _dfs_lfs_lookup populates size from lfs_stat; add a one-line comment next to the SEEK_END case (or above the switch) explaining that directories report size==0 from lfs and therefore SEEK_END will act like SEEK_SET for directories, to avoid future confusion (reference symbols: _dfs_lfs_lseek, DFS_LFS_LSEEK_WHENCE, SEEK_END, DFS_LFS_FILE_SIZE(file), _dfs_lfs_lookup).
1267-1323: 💤 Low value
_dfs_lfs_lookupand_dfs_lfs_create_vnodeduplicate the vnode-init boilerplate.Both functions allocate a vnode, set
mnt,nlink,fops,data, and a type/mode pair. Pulling the common tail into a small helper (e.g.,_dfs_lfs_init_vnode(struct dfs_dentry*, int type, mode_t mode, off_t size)) would shrink each function to a few lines and make it harder to forget a field when extending vnode metadata later (e.g.,atime/ctimefields that v2 may grow). Optional in this PR.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@dfs_lfs.c` around lines 1267 - 1323, Create a small helper function (e.g., _dfs_lfs_init_vnode(struct dfs_dentry *dentry, int type, mode_t mode, off_t size)) that encapsulates the duplicated vnode allocation and initialization: call dfs_vnode_create(), set vnode->mnt = dentry->mnt, vnode->size = size, vnode->nlink = 1, vnode->type = type, set vnode->mode using S_IFDIR|mode for FT_DIRECTORY else S_IFREG|mode, set vnode->fops = &_dfs_lfs_fops and vnode->data = RT_NULL, and return the vnode or RT_NULL on failure; then replace the duplicated blocks in _dfs_lfs_lookup and _dfs_lfs_create_vnode with calls to this helper (in _dfs_lfs_lookup keep the existing _dfs_lfs_stat check and pass st.st_size as size).
421-462: 💤 Low value
_dfs_lfs_sync_file_posis single-fd safe, but please document the assumption.The helper assumes that the caller serializes all I/O on a given
dfs_lfs_fd_t. If two threads share a file descriptor (legal on POSIX withdup/O_RDONLY), thetell → seek → readwindow in v2 is racy: thread A computestarget=fpos, thread B reseeks underneath, thread A's subsequentlfs_file_readthen reads from the wrong offset. Holdingdfs_lfs->lockaround the sync+I/O pair would close the window, but it's a meaningful change. At minimum, a comment that this helper assumes per-fd serialization (matching DFS v1 behavior) would prevent surprises.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@dfs_lfs.c` around lines 421 - 462, Add a short comment inside _dfs_lfs_sync_file_pos documenting the assumption that callers must serialize I/O on a given dfs_lfs_fd_t (i.e., the function is single-fd safe only) because in DFS v2 the tell→seek→read window is racy if two threads share the same dfs_lfs_fd_t; mention that holding dfs_lfs->lock around the sync+I/O pair would eliminate the race if callers need multi-threaded access..github/workflows/rtthread.yml (2)
126-127: 💤 Low value
RTTHREAD_SOURCE_CACHE_DIRandRTTHREAD_SOURCE_ARCHIVEresolve outside the workspace.Both paths are computed as
${{ github.workspace }}/../.... That works onactions/cache@v4andactions/download-artifact@v4, but the..segment is not normalized in the cache key, so two checkouts with different workspace mount-points (e.g., self-hosted vs. hosted runners) could produce different effective paths and thrash the cache. If you stay onubuntu-22.04hosted runners only this is moot; otherwise, consider${{ runner.temp }}/rtthread-src-cacheand${{ runner.temp }}/rtthread-master-source, which are guaranteed to exist and be writable.Also applies to: 162-165, 284-285
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/rtthread.yml around lines 126 - 127, The PR uses RTTHREAD_SOURCE_CACHE_DIR and RTTHREAD_SOURCE_ARCHIVE computed as `${{ github.workspace }}/../...`, which can normalize differently across runners; change their definitions to use `${{ runner.temp }}/rtthread-src-cache` and `${{ runner.temp }}/rtthread-master-source` (or similar names) so the paths are inside runner.temp and guaranteed writable/consistent, and update all occurrences of RTTHREAD_SOURCE_CACHE_DIR, RTTHREAD_SOURCE_ARCHIVE (and related flags like RTTHREAD_SOURCE_CACHE_READ) in the workflow to reference the new runner.temp-based variables.
114-130: ⚖️ Poor tradeoffHeavy duplication between
test-littlefs-tagandtest-littlefs-master.The
env, dependency-install, ARM GCC download/install, Python setup, build, and log-upload steps are almost byte-identical between the two matrix jobs (only the source-archive vs. source-cache wiring differs). Extracting the shared steps into a composite action under.github/actions/setup-rtthread-build/(or a reusable workflow) would meaningfully reduce future maintenance and prevent the two jobs from drifting. Not blocking — purely a maintainability improvement.Also applies to: 272-287
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/rtthread.yml around lines 114 - 130, The two matrix jobs test-littlefs-tag and test-littlefs-master duplicate the same env block and steps (dependency-install, ARM GCC download/install, Python setup, build, log-upload) except for the source-archive vs source-cache wiring; extract these shared steps into a composite action (e.g., .github/actions/setup-rtthread-build/) or a reusable workflow, parameterize the differing bits (RTTHREAD_SOURCE_CACHE_DIR / source-archive input, RTTHREAD_REF/rtthread_ref, RTTHREAD_DFS_VERSION, RTTHREAD_BSP, RTTHREAD_REUSE_WORKDIR, RTTHREAD_RUN_SMOKE, RTTHREAD_QEMU_TIMEOUT, RTT_CC/RTT_EXEC_PATH), then update both jobs to call the composite action/reusable workflow with the appropriate inputs so the only job-specific logic remains the source wiring..github/ci/rtthread-littlefs/requirements.txt (1)
1-2: 💤 Low valueConsider upgrading scons to a more recent 4.x version if not intentionally pinned.
scons==4.0.1(August 2020) is significantly outdated. The latest stable release is 4.10.1. While 4.0.1 remains compatible with Python 3.7+ (including Python 3.10), newer versions provide bug fixes and improved support for modern Python versions. If this pin is not deliberate for reproducibility requirements, upgrading is low-effort and worthwhile.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/ci/rtthread-littlefs/requirements.txt around lines 1 - 2, Summary: scons is pinned to an old 4.0.1 in requirements.txt; update the pin to a newer 4.x release. Edit .github/ci/rtthread-littlefs/requirements.txt and replace the scons==4.0.1 entry with a current stable 4.x version (e.g., scons==4.10.1) unless the old pin is intentional for reproducibility; after updating, run the CI/local build that uses the requirements file to verify no regressions and adjust any CI scripts or constraints that reference the scons version.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@dfs_lfs.c`:
- Around line 808-845: When lfs_mkdir succeeds but lfs_dir_open fails (in the
open/create path around dfs_lfs_fd, lfs_mkdir and lfs_dir_open), roll back the
created directory: call the LittleFS removal API (e.g., lfs_remove or rmdir
equivalent) on DFS_LFS_FILE_PATH(file) when file->flags includes O_CREAT and
mkdir returned OK, ignore non-critical errors from the removal, then proceed to
free dfs_lfs_fd and return the translated error; update the error path at the
_error_dir handling after lfs_dir_open to perform this cleanup so a
partially-created directory is not left on flash.
---
Nitpick comments:
In @.github/ci/rtthread-littlefs/build.sh:
- Around line 450-454: The qemu_lfs_mtd_devices array registers two MTDs but
lfsroot is never used by the smoke test (only LFS_SMOKE_DEV / "lfsnor" is
exercised), wasting QEMU_LFS_MTD_TOTAL_SIZE RAM; remove the unused entry by
deleting the qemu_lfs_mtd_devices element with .name = "lfsroot" (or
alternatively wire "lfsroot" into the smoke test via LFS_SMOKE_DEV) so only the
needed qemu_lfs_mtd_instance_t entries are allocated.
- Around line 528-544: The bounds check in qemu_lfs_mtd_read is off-by-one:
change the condition ((rt_size_t)offset > QEMU_LFS_MTD_TOTAL_SIZE) to
((rt_size_t)offset >= QEMU_LFS_MTD_TOTAL_SIZE) so an offset equal to TOTAL_SIZE
is rejected; apply the same tightening to the analogous checks in
qemu_lfs_mtd_write and qemu_lfs_mtd_erase (and any duplicated checks) so all
three functions consistently reject offset == TOTAL_SIZE and avoid allowing
out-of-range accesses.
- Line 1438: The call to
copy_package("$repo_root","$package_dir","$rtthread_work") assumes the third arg
will be excluded but relative_child_path can return empty when "$rtthread_work"
is outside "$repo_root" (RTTHREAD_WORKDIR defaults to RUNNER_TEMP), causing
exclude_rel to be empty and the no-exclude branch to run silently; fix by making
copy_package (or the call site) detect when relative_child_path returns empty
and either (a) log a warning that the requested exclude_dir ("$rtthread_work")
did not resolve under "$repo_root" and thus will not be excluded, or (b) treat
the third argument as best-effort and document that behavior; update
copy_package and/or relative_child_path to explicitly check for an empty
exclude_rel and emit the warning including the values of
RTTHREAD_WORKDIR/RUNNER_TEMP so callers see why exclusion didn't occur.
- Around line 995-1044: The backgrounded subshell currently sets qemu_pid=$!
which points to the subshell, not the qemu child; change the launch so qemu
becomes the PID captured: inside the subshell replace the qemu invocations with
exec (e.g. exec QEMU_AUDIO_DRV=none sh ./qemu.sh and exec qemu-system-arm ... )
so $! is qemu itself (reference qemu_pid); alternatively start the subshell in a
new session (setsid ...) and on cleanup kill the process group (kill -TERM
-$qemu_pid) to ensure the real qemu process is terminated — update both branches
that run sh ./qemu.sh and qemu-system-arm accordingly and ensure the existing
kill/wait logic uses qemu_pid or the negative PGID.
In @.github/ci/rtthread-littlefs/requirements.txt:
- Around line 1-2: Summary: scons is pinned to an old 4.0.1 in requirements.txt;
update the pin to a newer 4.x release. Edit
.github/ci/rtthread-littlefs/requirements.txt and replace the scons==4.0.1 entry
with a current stable 4.x version (e.g., scons==4.10.1) unless the old pin is
intentional for reproducibility; after updating, run the CI/local build that
uses the requirements file to verify no regressions and adjust any CI scripts or
constraints that reference the scons version.
In @.github/workflows/rtthread.yml:
- Around line 126-127: The PR uses RTTHREAD_SOURCE_CACHE_DIR and
RTTHREAD_SOURCE_ARCHIVE computed as `${{ github.workspace }}/../...`, which can
normalize differently across runners; change their definitions to use `${{
runner.temp }}/rtthread-src-cache` and `${{ runner.temp
}}/rtthread-master-source` (or similar names) so the paths are inside
runner.temp and guaranteed writable/consistent, and update all occurrences of
RTTHREAD_SOURCE_CACHE_DIR, RTTHREAD_SOURCE_ARCHIVE (and related flags like
RTTHREAD_SOURCE_CACHE_READ) in the workflow to reference the new
runner.temp-based variables.
- Around line 114-130: The two matrix jobs test-littlefs-tag and
test-littlefs-master duplicate the same env block and steps (dependency-install,
ARM GCC download/install, Python setup, build, log-upload) except for the
source-archive vs source-cache wiring; extract these shared steps into a
composite action (e.g., .github/actions/setup-rtthread-build/) or a reusable
workflow, parameterize the differing bits (RTTHREAD_SOURCE_CACHE_DIR /
source-archive input, RTTHREAD_REF/rtthread_ref, RTTHREAD_DFS_VERSION,
RTTHREAD_BSP, RTTHREAD_REUSE_WORKDIR, RTTHREAD_RUN_SMOKE, RTTHREAD_QEMU_TIMEOUT,
RTT_CC/RTT_EXEC_PATH), then update both jobs to call the composite
action/reusable workflow with the appropriate inputs so the only job-specific
logic remains the source wiring.
In `@dfs_lfs.c`:
- Around line 1299-1323: The vnode->mode is currently set by ORing
caller-supplied mode with S_IFDIR/S_IFREG which can preserve any S_IFMT bits the
caller included; update _dfs_lfs_create_vnode to mask out file-type bits from
the incoming mode before ORing (e.g. compute cleaned_mode = mode & ~S_IFMT and
then set vnode->mode = (type == FT_DIRECTORY) ? (S_IFDIR | cleaned_mode) :
(S_IFREG | cleaned_mode)) so vnode->mode always has correct type bits regardless
of caller input.
- Around line 1100-1150: The SEEK_END branch in _dfs_lfs_lseek (switch over
DFS_LFS_LSEEK_WHENCE) adds DFS_LFS_FILE_SIZE(file), but for directories
vnode->size is always 0 because _dfs_lfs_lookup populates size from lfs_stat;
add a one-line comment next to the SEEK_END case (or above the switch)
explaining that directories report size==0 from lfs and therefore SEEK_END will
act like SEEK_SET for directories, to avoid future confusion (reference symbols:
_dfs_lfs_lseek, DFS_LFS_LSEEK_WHENCE, SEEK_END, DFS_LFS_FILE_SIZE(file),
_dfs_lfs_lookup).
- Around line 1267-1323: Create a small helper function (e.g.,
_dfs_lfs_init_vnode(struct dfs_dentry *dentry, int type, mode_t mode, off_t
size)) that encapsulates the duplicated vnode allocation and initialization:
call dfs_vnode_create(), set vnode->mnt = dentry->mnt, vnode->size = size,
vnode->nlink = 1, vnode->type = type, set vnode->mode using S_IFDIR|mode for
FT_DIRECTORY else S_IFREG|mode, set vnode->fops = &_dfs_lfs_fops and vnode->data
= RT_NULL, and return the vnode or RT_NULL on failure; then replace the
duplicated blocks in _dfs_lfs_lookup and _dfs_lfs_create_vnode with calls to
this helper (in _dfs_lfs_lookup keep the existing _dfs_lfs_stat check and pass
st.st_size as size).
- Around line 421-462: Add a short comment inside _dfs_lfs_sync_file_pos
documenting the assumption that callers must serialize I/O on a given
dfs_lfs_fd_t (i.e., the function is single-fd safe only) because in DFS v2 the
tell→seek→read window is racy if two threads share the same dfs_lfs_fd_t;
mention that holding dfs_lfs->lock around the sync+I/O pair would eliminate the
race if callers need multi-threaded access.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: d20dfa4f-3c07-4c19-bc9c-404af1ed7aa2
📒 Files selected for processing (4)
.github/ci/rtthread-littlefs/build.sh.github/ci/rtthread-littlefs/requirements.txt.github/workflows/rtthread.ymldfs_lfs.c
|
Note Unit test generation is a public access feature. Expect some limitations and changes as we gather feedback and continue to improve it. Generating unit tests... This may take up to 20 minutes. |
|
❌ Failed to create PR with unit tests: AGENT_CHAT: Failed to open pull request |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
🧹 Nitpick comments (4)
.github/ci/rtthread-littlefs/build.sh (2)
430-454: 💤 Low valueDrop the unused
lfsrootMTD device or wire it into the smoke test.
QEMU_LFS_MTD_DEVICE_COUNTis2and bothlfsrootandlfsnorare registered, but onlylfsnoris referenced bylittlefs_smoke.c(LFS_SMOKE_DEV). Each device carries a 512 KiBstorage[]BSS array, so the unusedlfsrootslot wastes ~512 KiB and registers a device that is never mounted. Either drop the second entry (and the_COUNTplumbing) or use it in the test (e.g., a second mount to validate independent volumes).🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/ci/rtthread-littlefs/build.sh around lines 430 - 454, The qemu LFS MTD array defines two devices (QEMU_LFS_MTD_DEVICE_COUNT, qemu_lfs_mtd_devices) but only "lfsnor" is used by the smoke test (littlefs_smoke.c via LFS_SMOKE_DEV), wasting ~512KiB and registering an unused "lfsroot"; either remove the unused entry and reduce QEMU_LFS_MTD_DEVICE_COUNT to 1 (drop the "lfsroot" initializer and any linking/count plumbing), or wire the second device into the test by updating littlefs_smoke.c to mount/verify both qemu_lfs_mtd_devices entries (use "lfsroot" as a second mount name) so both devices are exercised—choose one approach and update the related symbols (QEMU_LFS_MTD_DEVICE_COUNT, qemu_lfs_mtd_devices, and LFS_SMOKE_DEV usage) accordingly.
1086-1129: ⚡ Quick winGate
RT_USING_DEVICE_OPSon Kconfig availability.
apply_littlefs_kconfig_profileunconditionally writesRT_USING_DEVICE_OPS=y, but this symbol does not exist in the Kconfig tree for any tested matrix tag (v4.1.1, v5.0.0, v5.0.1, v5.0.2). Theset_kconfig_symbolfunction writes unknown symbols to.configwithout validation; whenscons --pyconfig-silentregenerates.configfrom actual Kconfig definitions, the unknown symbol is silently dropped. This can cause the smoke test to behave unexpectedly if DFS device-ops functionality is assumed.Gate it using the existing
kconfig_tree_has_symbolhelper, consistent with howRT_USING_DFS_V1/RT_USING_DFS_V2are already handled:♻️ Proposed gating
- set_kconfig_symbol "$config_file" RT_USING_DEVICE_OPS y + if kconfig_tree_has_symbol "$kconfig_root" RT_USING_DEVICE_OPS; then + set_kconfig_symbol "$config_file" RT_USING_DEVICE_OPS y + fi🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/ci/rtthread-littlefs/build.sh around lines 1086 - 1129, The script unconditionally sets RT_USING_DEVICE_OPS in apply_littlefs_kconfig_profile even when that symbol isn't present in the Kconfig tree; wrap the set_kconfig_symbol call for RT_USING_DEVICE_OPS with a kconfig_tree_has_symbol "$kconfig_root" RT_USING_DEVICE_OPS check (same pattern as RT_USING_DFS_V1/RT_USING_DFS_V2) so you only call set_kconfig_symbol when the symbol exists in the Kconfig tree, leaving behavior unchanged for supported trees and avoiding writing unknown symbols to .config..github/workflows/rtthread.yml (2)
142-230: 🏗️ Heavy liftExtract duplicated toolchain/dependency setup into a composite action.
test-littlefs-tag(lines 142–230) andtest-littlefs-master(lines 313–388) share ~75 lines of near-identical steps: ARM GCC cache prep,Cache ARM GCC toolchain,Install build dependencies(apt + pip),Install cached ARM GCC toolchain,Setup ARM GCC environment. Any change (new apt package, new toolchain version, new MD5, fixing the deprecated download URL above) has to land in two places and stays in lockstep by convention only. Pulling these into.github/actions/setup-rtthread-build/action.yml(composite action) would let both jobs reuse a single source of truth and also de-duplicate theenv:blocks (ARM_GCC_*).Also applies to: 313-388
199-216: ⚡ Quick winConsider alternatives to the legacy ARM GCC
gnu-rmURL for long-term stability.The hardcoded URL
https://developer.arm.com/-/media/Files/downloads/gnu-rm/${ARM_GCC_VERSION}/${ARM_GCC_ARCHIVE}currently works via a redirect to Azure blob storage (HTTP 302 → 200), but Arm's GNU embedded toolchain (gnu-rm) is marked discontinued. While the file remains accessible now, relying on external redirects introduces future risk: if Arm retires the asset or changes the redirect path, every cache miss (e.g., new runner OS, cache invalidation) will fail.Consider migrating to one of:
- The maintained
arm-gnu-toolchainfrom the new Arm downloads layout (e.g.,arm-gnu-toolchain-${ver}-x86_64-arm-none-eabi.tar.xz).- A durable third-party source such as
xpack-dev-tools/gcc-arm-none-eabi-xpackGitHub releases, which are signed and independently maintained.- A project-controlled mirror (artifact registry, release asset, or package repository) to eliminate external dependency.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/rtthread.yml around lines 199 - 216, The current download URL stored in the download_url variable (built from ARM_GCC_VERSION and ARM_GCC_ARCHIVE) relies on the legacy gnu-rm redirect and should be replaced with a more durable source; update the download_url assignment in the block using archive_path, ARM_GCC_VERSION and ARM_GCC_ARCHIVE to point to a maintained arm-gnu-toolchain URL, a trusted third‑party release (e.g., xpack-dev-tools/GCC release), or a project-controlled mirror/artifact registry, and add a fallback list or retry sequence that tries the alternative hosts before failing (keep the existing wget/timeout/attempts logic and preserve archive_path usage); optionally add checksum verification of the downloaded archive to ensure integrity.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In @.github/ci/rtthread-littlefs/build.sh:
- Around line 430-454: The qemu LFS MTD array defines two devices
(QEMU_LFS_MTD_DEVICE_COUNT, qemu_lfs_mtd_devices) but only "lfsnor" is used by
the smoke test (littlefs_smoke.c via LFS_SMOKE_DEV), wasting ~512KiB and
registering an unused "lfsroot"; either remove the unused entry and reduce
QEMU_LFS_MTD_DEVICE_COUNT to 1 (drop the "lfsroot" initializer and any
linking/count plumbing), or wire the second device into the test by updating
littlefs_smoke.c to mount/verify both qemu_lfs_mtd_devices entries (use
"lfsroot" as a second mount name) so both devices are exercised—choose one
approach and update the related symbols (QEMU_LFS_MTD_DEVICE_COUNT,
qemu_lfs_mtd_devices, and LFS_SMOKE_DEV usage) accordingly.
- Around line 1086-1129: The script unconditionally sets RT_USING_DEVICE_OPS in
apply_littlefs_kconfig_profile even when that symbol isn't present in the
Kconfig tree; wrap the set_kconfig_symbol call for RT_USING_DEVICE_OPS with a
kconfig_tree_has_symbol "$kconfig_root" RT_USING_DEVICE_OPS check (same pattern
as RT_USING_DFS_V1/RT_USING_DFS_V2) so you only call set_kconfig_symbol when the
symbol exists in the Kconfig tree, leaving behavior unchanged for supported
trees and avoiding writing unknown symbols to .config.
In @.github/workflows/rtthread.yml:
- Around line 199-216: The current download URL stored in the download_url
variable (built from ARM_GCC_VERSION and ARM_GCC_ARCHIVE) relies on the legacy
gnu-rm redirect and should be replaced with a more durable source; update the
download_url assignment in the block using archive_path, ARM_GCC_VERSION and
ARM_GCC_ARCHIVE to point to a maintained arm-gnu-toolchain URL, a trusted
third‑party release (e.g., xpack-dev-tools/GCC release), or a project-controlled
mirror/artifact registry, and add a fallback list or retry sequence that tries
the alternative hosts before failing (keep the existing wget/timeout/attempts
logic and preserve archive_path usage); optionally add checksum verification of
the downloaded archive to ensure integrity.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 7da2ad7b-eaa6-42e1-a745-1ebe435dfbcf
📒 Files selected for processing (3)
.github/ci/rtthread-littlefs/build.sh.github/ci/rtthread-littlefs/requirements.txt.github/workflows/rtthread.yml
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (3)
.github/ci/rtthread-littlefs/build.sh (3)
1008-1017: 💤 Low valueQEMU fallback launcher hardcodes
rtthread.elfand ignores$RTTHREAD_ELF.When
qemu.shis missing, the inline script invokesqemu-system-arm ... -kernel rtthread.elfrather than the configured$rtthread_elf. For the qemu-vexpress-a9 BSPqemu.shis normally present so this rarely triggers, but the inconsistency surprises future BSPs/customizations. Note the SC2016 hint here is a false positive — the single quotes are intentional for the inner sh.♻️ Proposed fix to honor RTTHREAD_ELF
- setsid -w sh -c ' - printf "%s\n" "$$" > "$2" - cd "$1" || exit 1 + setsid -w sh -c ' + printf "%s\n" "$$" > "$2" + cd "$1" || exit 1 if [ -f ./qemu.sh ]; then QEMU_AUDIO_DRV=none exec sh ./qemu.sh else - exec qemu-system-arm -M vexpress-a9 -smp 2 -kernel rtthread.elf \ + exec qemu-system-arm -M vexpress-a9 -smp 2 -kernel "$3" \ -nographic -serial mon:stdio fi - ' sh "$bsp_dir" "$qemu_pid_file" > "$log_file" 2>&1 & + ' sh "$bsp_dir" "$qemu_pid_file" "${RTTHREAD_ELF:-rtthread.elf}" > "$log_file" 2>&1 &🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/ci/rtthread-littlefs/build.sh around lines 1008 - 1017, The inline fallback launcher hardcodes "rtthread.elf" instead of using the configured RTTHREAD_ELF variable; update the inner sh block that runs qemu-system-arm (the else branch of the inline script that checks for ./qemu.sh) to pass the kernel as "$RTTHREAD_ELF" (or the project's configured $rtthread_elf variable name) instead of rtthread.elf, ensuring the quoted variable is exported/passed into the outer setsid -w sh -c '... ' environment so the inner sh can reference it.
419-967: 💤 Low valueNote:
lfsrootMTD device is registered but never used by the smoke test.
qemu_lfs_mtd_devices[]registers two devices (lfsroot,lfsnor) butLFS_SMOKE_DEVonly exerciseslfsnor. If the second device is intentional (e.g., reserved for a future root-FS check), consider adding a brief comment; otherwise dropping it would simplify the heredoc and reduce RAM consumption (the storage array is 512 KiB per instance which is non-trivial for a vexpress-a9 RAM image).🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/ci/rtthread-littlefs/build.sh around lines 419 - 967, The qemu_lfs_mtd_devices array registers two MTD instances ("lfsroot" and "lfsnor") but only "lfsnor" is used by the smoke test (LFS_SMOKE_DEV), wasting RAM; either remove the unused "lfsroot" entry from qemu_lfs_mtd_devices (and related loop in qemu_lfs_mtd_init will then only allocate one storage buffer) or keep the second entry but add a clear comment near qemu_lfs_mtd_devices and qemu_lfs_mtd_init explaining why "lfsroot" is reserved, so reviewers know it is intentional and the large storage allocation is deliberate (refer to qemu_lfs_mtd_devices, qemu_lfs_mtd_init, qemu_lfs_mtd_storage_of, and LFS_SMOKE_DEV to locate the relevant code).
1128-1160: ⚡ Quick winRegex patterns correctly match standard RT-Thread format; defensive relaxation is optional.
The grep patterns
^#define[[:space:]][[:space:]]*RT_USING_DFS$are correct for standard RT-Thread v4.1.1's Kconfig→rtconfig.h converter, which emits bare#definemacros (e.g.,#define RT_USING_DFS) for boolean configs, not#define RT_USING_DFS 1. However, if support for non-standard converter variants is desired, the patterns can be relaxed to accept optional numeric values without affecting the current build system.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/ci/rtthread-littlefs/build.sh around lines 1128 - 1160, The current grep checks in the build script strictly match bare defines (e.g., '^#define[[:space:]][[:space:]]*RT_USING_DFS$'); to allow non‑standard rtconfig.h variants that emit numeric values (e.g., '#define RT_USING_DFS 1') relax these regexes to allow an optional numeric token after the symbol (for example change occurrences of '^#define[[:space:]][[:space:]]*RT_USING_DFS$' to something like '^#define[[:space:]]+RT_USING_DFS([[:space:]]+[0-9]+)?$'), and apply the same relaxation to checks for RT_USING_DFS_V1, RT_USING_DFS_V2, RT_USING_MTD_NOR, RT_USING_HEAP, RT_USING_MUTEX and PKG_USING_LITTLEFS (references: the grep calls using "$rtconfig_file" and the dfs_version / kconfig_tree_has_symbol logic).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/ci/rtthread-littlefs/build.sh:
- Around line 1-1507: The qemu_lfs_mtd_read_id() function currently returns
rt_uint32_t which mismatches older RT-Thread v4.1.1 driver ops; define a
conditional typedef (e.g. qemu_lfs_mtd_id_ret_t) near the other typedefs
(alongside qemu_lfs_mtd_rw_ret_t and qemu_lfs_mtd_len_t) and change the function
signature to return qemu_lfs_mtd_id_ret_t, ensuring the qemu_lfs_mtd_ops.read_id
assignment remains correct; implement the typedef so it maps to rt_err_t for the
older ABI and rt_uint32_t for newer ABIs (using an appropriate preprocessor
check) and update the heredoc block containing qemu_lfs_mtd_read_id, the
typedef, and the ops initializer accordingly.
- Around line 502-509: The function qemu_lfs_mtd_read_id has the wrong return
type; change its signature to return rt_err_t (matching
rt_mtd_nor_driver_ops.read_id) instead of rt_uint32_t, and adjust the
implementation to return an rt_err_t status while writing the read ID into the
caller-provided buffer or out parameter as required by RT-Thread (wrap/assign
the ID into the provided pointer/buffer and return RT_EOK on success or an
appropriate error code on failure); update any callers or the struct assignment
using qemu_lfs_mtd_read_id to rely on the rt_err_t status semantics.
---
Nitpick comments:
In @.github/ci/rtthread-littlefs/build.sh:
- Around line 1008-1017: The inline fallback launcher hardcodes "rtthread.elf"
instead of using the configured RTTHREAD_ELF variable; update the inner sh block
that runs qemu-system-arm (the else branch of the inline script that checks for
./qemu.sh) to pass the kernel as "$RTTHREAD_ELF" (or the project's configured
$rtthread_elf variable name) instead of rtthread.elf, ensuring the quoted
variable is exported/passed into the outer setsid -w sh -c '... ' environment so
the inner sh can reference it.
- Around line 419-967: The qemu_lfs_mtd_devices array registers two MTD
instances ("lfsroot" and "lfsnor") but only "lfsnor" is used by the smoke test
(LFS_SMOKE_DEV), wasting RAM; either remove the unused "lfsroot" entry from
qemu_lfs_mtd_devices (and related loop in qemu_lfs_mtd_init will then only
allocate one storage buffer) or keep the second entry but add a clear comment
near qemu_lfs_mtd_devices and qemu_lfs_mtd_init explaining why "lfsroot" is
reserved, so reviewers know it is intentional and the large storage allocation
is deliberate (refer to qemu_lfs_mtd_devices, qemu_lfs_mtd_init,
qemu_lfs_mtd_storage_of, and LFS_SMOKE_DEV to locate the relevant code).
- Around line 1128-1160: The current grep checks in the build script strictly
match bare defines (e.g., '^#define[[:space:]][[:space:]]*RT_USING_DFS$'); to
allow non‑standard rtconfig.h variants that emit numeric values (e.g., '#define
RT_USING_DFS 1') relax these regexes to allow an optional numeric token after
the symbol (for example change occurrences of
'^#define[[:space:]][[:space:]]*RT_USING_DFS$' to something like
'^#define[[:space:]]+RT_USING_DFS([[:space:]]+[0-9]+)?$'), and apply the same
relaxation to checks for RT_USING_DFS_V1, RT_USING_DFS_V2, RT_USING_MTD_NOR,
RT_USING_HEAP, RT_USING_MUTEX and PKG_USING_LITTLEFS (references: the grep calls
using "$rtconfig_file" and the dfs_version / kconfig_tree_has_symbol logic).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 96be6f6a-b9ff-4c4b-a440-8bd3d85466bd
📒 Files selected for processing (4)
.github/actions/setup-rtthread-build/action.yml.github/ci/rtthread-littlefs/build.sh.github/ci/rtthread-littlefs/requirements.txt.github/workflows/rtthread.yml
✅ Files skipped from review due to trivial changes (1)
- .github/actions/setup-rtthread-build/action.yml
🚧 Files skipped from review as they are similar to previous changes (1)
- .github/workflows/rtthread.yml
- add QEMU littlefs smoke sources for RT-Thread BSP validation - split RT-Thread tag and master checks into separate GitHub Actions matrix jobs - add RT-Thread source archive/cache handling to reduce repeated clone cost - run compile and smoke verification against qemu-vexpress-a9 DFS v1/v2 profiles
拉取/合并请求描述:(PR description)
[
为什么提交这份PR (why to submit this PR)
当前 RT-Thread littlefs 包 CI 主要覆盖多版本编译检查,缺少在 QEMU BSP 上执行 littlefs 文件系统基本读写、目录遍历和卸载重挂载流程的自动化 smoke test。
该 PR 增加 qemu-vexpress-a9 场景下的 littlefs smoke test,并将 RT-Thread tag 与 master 的测试拆分为独立矩阵任务,提升 CI 覆盖度和失败定位效率。
你的解决方案是什么 (what is your solution)
.github/ci/rtthread-littlefs/build.sh中增加可选的RTTHREAD_RUN_SMOKE流程。.github/workflows/rtthread.yml拆分为 tag profile 和 master profile 两类 job,并加入 ARM GCC、Python 依赖、RT-Thread source 和 QEMU 相关准备步骤。.github/ci/rtthread-littlefs/requirements.txt固定kconfiglib与scons版本。请提供验证的bsp和config (provide the config and bsp)
BSP:
bsp/qemu-vexpress-a9.config:
RTTHREAD_DFS_VERSION=v1RTTHREAD_DFS_VERSION=v2RTTHREAD_RUN_SMOKE=1RT_USING_DFSDFS_USING_POSIXDFS_USING_WORKDIRRT_USING_DFS_DEVFSRT_USING_DFS_ROMFSRT_USING_DFS_TMPFSRT_USING_MTD_NORPKG_USING_LITTLEFSRT_USING_DFS_V1或RT_USING_DFS_V2action: 本地输入中未提供可引用的 GitHub Actions 成功链接;提交 PR 前请替换为当前 PR 分支对应的成功 workflow 链接。
]
当前拉取/合并请求的状态 Intent for your PR
必须选择一项 Choose one (Mandatory):
代码质量 Code Quality:
我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:
#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned upSummary by CodeRabbit
New Features
Tests
Chores