Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump littlefs version #7

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sosthene-nitrokey
Copy link
Contributor

@sosthene-nitrokey sosthene-nitrokey commented Jun 9, 2023

This release bumps the on-disk minor version of littlefs from lfs2.0 -> lfs2.1.

This change is backwards-compatible, but after the first write with the new version, the image on disk will no longer be mountable by older versions of littlefs.

This should cause any backward compatibility issues, but we should be certain when we do this update, as rollbacks won't be possible.

For example if Nitrokey publishes a test release with this update, users would be able to roll back to a stable release without this change, which would make the filesystem unreadable.

Copy link
Member

@robin-nitrokey robin-nitrokey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good but not tested yet.

@sosthene-nitrokey
Copy link
Contributor Author

It's weird, it fails to compile for embedded targets because bindgen fails to find string.h, but that doesn't happen on main.

@elpiel
Copy link

elpiel commented Jun 25, 2023

I can test this new bump. Does it require any changes on littlefs2 crate except patching the littlefs2-sys crate?

Would be nice to update the littlefs version which it updates to in the Readme.

@elpiel
Copy link

elpiel commented Jun 26, 2023

I do get the string.h build error as well, however, I believe I saw something about it in the changelog of one of the littlefs version. I couldn't find it

--- stderr
littlefs/lfs_util.h:26:10: fatal error: 'string.h' file not found
thread 'main' panicked at 'Unable to generate bindings: ClangDiagnostic("littlefs/lfs_util.h:26:10: fatal error: 'string.h' file not found\n")', /home/elpiel/.cargo/git/checkouts/littlefs2-sys-5af80ead47d0653a/2afa881/build.rs:34:10
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

Let me know how I can fix this error so I can test the new version. (see #7 (comment))

@@ -26,6 +26,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
let bindings = bindgen::Builder::default()
.header("littlefs/lfs.h")
.clang_arg(format!("--target={}", target))
.clang_arg("-I/usr/arm-none-eabi/include")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this should be documented. I had a compiler just not at this location so I had to make a symlink ln -s for this to work.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally I would prefer something that does not need that kind of hack and works even on weird distros.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what are the options honestly as I'm not experienced with C/C++ but I'm happy to say that so far this version is working with my initial testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants