fix compact error due to wrong order#159
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes a littlefs create --compact failure (“no-space” error) by making the compaction build step use the same source ordering as the initial filesystem creation (based on the host on-disk directory walk), and adds a regression test intended to reproduce the issue.
Changes:
- Update
create --compactto populate the compact filesystem directly from the original source paths rather than walking the initially-created filesystem. - Add a CLI test that runs
create --compact --no-padacross multiple file-count/size configurations.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/littlefs/__main__.py |
Changes compaction population logic to iterate sources instead of fs.walk("/"). |
test/cli/test_create_and_extract.py |
Adds a new test for create --compact across multiple configurations. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Thanks! also let me know when you want me to tag a release, i know the changes are stacking up. |
|
You can release whenever you want, I am using this REPO from source code. (#150 is still planned, probably will happen in the next 3 weeks) |
|
just released v0.17.1 |
I found out that in some cases --compact fails with no-space error.
Seems like the issue is because the order of creating the no-compact filesystem is based on the on-disk filesystem while the order of creating the compact filesystem is based on the non-compact filesystem.
I added test that reproduces the error, and fix that making also the compact filesystem be based on the on-disk filesystem.
To reproduce the error just run the test I added without the fix I added.